[Sugar-devel] [PATCH Log 2/2] Log collector adds user's logs and list installed activities

Manuel Kaufmann humitos at gmail.com
Thu May 10 17:46:01 EDT 2012


When the user creates a zipfile with the log collector utility, all
his installed activities are listed in info.txt (inside the zipfile)
and all the sugar logs of the session are attached.

Signed-off-by: Manuel Kaufmann <humitos at gmail.com>
---
 logcollect.py |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/logcollect.py b/logcollect.py
index 956cc24..c1157b9 100644
--- a/logcollect.py
+++ b/logcollect.py
@@ -229,10 +229,11 @@ class MachineProperties:
 
     def installed_activities(self):
         s = ''
-        for path in glob.glob('/usr/share/activities/*.activity'):
+        for path in glob.glob('/usr/share/sugar/activities/*.activity'):
             s += os.path.basename(path) + '\n'
 
-        for path in glob.glob('/home/olpc/Activities/*'):
+        home = os.path.expanduser('~')
+        for path in glob.glob(os.path.join(home, 'Activities', '*')):
             s += '~' + os.path.basename(path) + '\n'
 
         return s
@@ -296,7 +297,9 @@ class LogCollect:
                                        (fn, e))
 
                 # Include all current ones from sugar/logs
-                for path in glob.glob('/home/olpc/.sugar/default/logs/*.log'):
+                home = os.path.expanduser('~')
+                for path in glob.glob(os.path.join(home, '.sugar', 'default',
+                                                   'logs', '*.log')):
                     try:
                         if os.access(path, os.F_OK):
                             if logbytes == 0:
-- 
1.7.7.6



More information about the Sugar-devel mailing list