[nanny] Add py2exe paths to Win32Chrono
- From: Roberto Majadas <telemaco src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nanny] Add py2exe paths to Win32Chrono
- Date: Sun, 23 Jan 2011 18:03:31 +0000 (UTC)
commit 8fe078f5ff4837566f0629d418f98155b3de64ac
Author: Roberto Majadas <roberto majadas openshine com>
Date: Sat Sep 25 18:59:01 2010 +0200
Add py2exe paths to Win32Chrono
daemon/src/Win32Chrono.py | 16 ++++++++++------
1 files changed, 10 insertions(+), 6 deletions(-)
---
diff --git a/daemon/src/Win32Chrono.py b/daemon/src/Win32Chrono.py
index 22fc51a..e883e97 100644
--- a/daemon/src/Win32Chrono.py
+++ b/daemon/src/Win32Chrono.py
@@ -25,6 +25,7 @@
import gobject
import os
+import sys
import pickle
import datetime
@@ -53,12 +54,15 @@ class Win32Chrono(gobject.GObject) :
'''Init function for NannyChrono class.'''
gobject.GObject.__init__(self)
self.quarterback = quarterback
-
- file_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
- for x in range(6):
- file_dir = os.path.dirname(file_dir)
- root_path = file_dir
- self.apps_list_path = os.path.join(root_path, "etc", "nanny", "applists")
+ if not hasattr(sys, "frozen") :
+ file_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
+ for x in range(6):
+ file_dir = os.path.dirname(file_dir)
+ root_path = file_dir
+ self.apps_list_path = os.path.join(root_path, "etc", "nanny", "applists")
+ else:
+ root_path = os.path.dirname(os.path.dirname(unicode(sys.executable, sys.getfilesystemencoding( ))))
+ self.apps_list_path = os.path.join(root_path, "etc", "nanny", "applists")
self.day = datetime.date.today().day
self.categories = ['session', 'browser', 'email', 'im']
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]