[X2Go-Commits] pyhoca-gui.git - build-59a18b6e3b5d3f1dd8f07f26433d37fe5984a57d (branch) updated: 0.1.0.10-170-g5ccc732

X2Go dev team git-admin at x2go.org
Tue Aug 27 13:22:14 CEST 2013


The branch, build-59a18b6e3b5d3f1dd8f07f26433d37fe5984a57d has been updated
       via  5ccc7328d8c4e55a07afb1d10484100c19b400a6 (commit)
      from  e6e40b946b276f669dbb250a15db51f21d095b57 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
-----------------------------------------------------------------------

Summary of changes:
 debian/changelog |    2 ++
 pyhoca-gui       |   11 ++++++++---
 2 files changed, 10 insertions(+), 3 deletions(-)

The diff of changes is:
diff --git a/debian/changelog b/debian/changelog
index dc5dd6b..9b1b494 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -88,6 +88,8 @@ pyhoca-gui (0.1.2.0-0~x2go1) UNRELEASED; urgency=low
     - Provide code for Windows packaging (py2exe, NSIS) in PyHoca-GUI's
       setup.py.
     - Ship PulseAudio 1.1 with PyHoca-GUI.
+    - Stdout/stderr diversion when frozen with py2exe: stdout will overwrite
+      the last log file, stderr will append to the very same file.
   * Depend on Python X2Go 0.1.2.0.
   * Install GNOME icons via dh_links.
   * Install X2Go icons with explicit install paths.
diff --git a/pyhoca-gui b/pyhoca-gui
index 291e4b6..196c26a 100755
--- a/pyhoca-gui
+++ b/pyhoca-gui
@@ -28,9 +28,14 @@ PROG_PID  = os.getpid()
 
 if hasattr(sys, 'frozen') and sys.frozen in ("windows_exe", "console_exe"):
     class Win32_Logging(object):
+
         softspace = 0
         _fname = os.path.join(os.environ['AppData'], PROG_NAME, '%s.log' % PROG_NAME)
         _file = None
+
+        def __init__(self, filemode='a'):
+            self._filemode = filemode
+
         def write(self, text, **kwargs):
             if self._file is None:
                 try:
@@ -38,7 +43,7 @@ if hasattr(sys, 'frozen') and sys.frozen in ("windows_exe", "console_exe"):
                         os.mkdir(os.path.dirname(self._fname))
                     except:
                         pass
-                    self._file = open(self._fname, 'w+')
+                    self._file = open(self._fname, self._filemode)
                 except:
                     pass
             else:
@@ -49,8 +54,8 @@ if hasattr(sys, 'frozen') and sys.frozen in ("windows_exe", "console_exe"):
             if self._file is not None:
                 self._file.flush()
 
-    sys.stdout = Win32_Logging()
-    sys.stderr = Win32_Logging()
+    sys.stdout = Win32_Logging(filemode='w+')
+    sys.stderr = Win32_Logging(filemode='a')
     del Win32_Logging
 
 import gevent


hooks/post-receive
-- 
pyhoca-gui.git (Python X2Go Client (wxPython GUI))

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "pyhoca-gui.git" (Python X2Go Client (wxPython GUI)).




More information about the x2go-commits mailing list