Fixed a bug with fremantle and contexts plus logging device to file
authorepage <eopage@byu.net>
Tue, 8 Dec 2009 01:10:11 +0000 (01:10 +0000)
committerepage <eopage@byu.net>
Tue, 8 Dec 2009 01:10:11 +0000 (01:10 +0000)
git-svn-id: file:///svnroot/ejpi/trunk@78 df6cc7de-23d0-4ae0-bb86-c17aa67b2a9d

src/constants.py
src/ejpi.py
src/ejpi_glade.py

index 76dff03..f432fb3 100644 (file)
@@ -3,7 +3,7 @@ import os
 __pretty_app_name__ = "e**(j pi) + 1 = 0"
 __app_name__ = "ejpi"
 __version__ = "0.9.6"
-__build__ = 7
+__build__ = 8
 _data_path_ = os.path.join(os.path.expanduser("~"), ".ejpi")
 __app_magic__ = 0xdeadbeef
 _user_logpath_ = "%s/ejpi.log" % _data_path_
index 193a066..403cca1 100755 (executable)
@@ -21,6 +21,9 @@ except OSError, e:
 
 logging.basicConfig(level=logging.DEBUG, filename=constants._user_logpath_)
 _moduleLogger.info("ejpi %s-%s" % (constants.__version__, constants.__build__))
+_moduleLogger.info("OS: %s" % (os.uname()[0], ))
+_moduleLogger.info("Kernel: %s (%s) for %s" % os.uname()[2:])
+_moduleLogger.info("Hostname: %s" % os.uname()[1])
 
 
 ejpi_glade.run_calculator()
index b8e0085..a31d4f7 100755 (executable)
@@ -227,10 +227,11 @@ class Calculator(object):
                except ImportError:
                        osso = None
                self._osso = None
+               self._deviceState = None
                if osso is not None:
                        self._osso = osso.Context(constants.__app_name__, constants.__version__, False)
-                       device = osso.DeviceState(self._osso)
-                       device.set_device_state_callback(self._on_device_state_change, 0)
+                       self._deviceState = osso.DeviceState(self._osso)
+                       self._deviceState.set_device_state_callback(self._on_device_state_change, 0)
                else:
                        _moduleLogger.warning("No OSSO support")
 
@@ -322,11 +323,17 @@ class Calculator(object):
 
        @gtk_toolbox.log_exception(_moduleLogger)
        def _on_close(self, *args, **kwds):
-               if self._osso is not None:
-                       self._osso.close()
-
                try:
                        self.__save_history()
+
+                       try:
+                               self._deviceState.close()
+                       except AttributeError:
+                               pass # Either None or close was removed (in Fremantle)
+                       try:
+                               self._osso.close()
+                       except AttributeError:
+                               pass # Either None or close was removed (in Fremantle)
                finally:
                        gtk.main_quit()