[Sugar-devel] [PATCH Log] Collector adds user's logs and activities SL #3240

Manuel Kaufmann humitos at gmail.com
Fri Jun 1 09:33:49 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 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/logcollect.py b/logcollect.py
index 82c1bba..5d6e683 100644
--- a/logcollect.py
+++ b/logcollect.py
@@ -230,10 +230,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
@@ -295,7 +296,9 @@ class LogCollect:
                                    "logcollect: could not add %s: %s" % (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.10



More information about the Sugar-devel mailing list