From 38a19b7d942bf177e006499d1d54d65b41809e45 Mon Sep 17 00:00:00 2001 From: Manuel Kaufmann Date: Fri, 01 Jun 2012 13:31:35 +0000 Subject: Collector adds user's logs and activities SL #3240 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 Reviewed-by: Gonzalo Odiard --- 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: -- cgit v0.9.1