#Construct the program by cat-ing all the python files together
-echo "#!/usr/bin/python" > $BUILD_BASE/usr/local/bin/gc_dialer.py
+echo "#!/usr/bin/python2.5" > $BUILD_BASE/usr/local/bin/gc_dialer.py
#echo "from __future__ import with_statement" >> $BUILD_BASE/usr/local/bin/gc_dialer.py
cat gc_dialer/gc_dialer.py gc_dialer/gcbackend.py gc_dialer/browser_emu.py | grep -e '^import ' | sort -u >> $BUILD_BASE/usr/local/bin/gc_dialer.py
cat gc_dialer/browser_emu.py gc_dialer/gcbackend.py gc_dialer/gc_dialer.py | grep -v 'browser_emu' | grep -v 'gcbackend' | grep -v "#!" >> $BUILD_BASE/usr/local/bin/gc_dialer.py
def on_device_state_change(self, shutdown, save_unsaved_data, memory_low, system_inactivity, message, userData):
"""
+ For shutdown or save_unsaved_data, our only state is cookies and I think the cookie manager handles that for us.
+ For system_inactivity, we have no background tasks to pause
+
@todo Might be useful to do something when going in offline mode or low memory
@note Hildon specific
"""
- pass
+ if shutdown or save_unsaved_data:
+ pass
+
+ if memory_low:
+ self.gcd.clear_caches()
+ re.purge()
+ gc.collect()
+
+ #if offline (how do I tell this? the message somehow?)
+ # disable the gui?
+ # disable clearing of caches and when they click dial, request to connect?
def setNumber(self, number):
self.phonenumber = makeugly(number)