From ed95468b58cc0b7a99b4bacb37f359034751dea0 Mon Sep 17 00:00:00 2001
Message-Id: <ed95468b58cc0b7a99b4bacb37f359034751dea0.1338557574.git.humitos@gmail.com>
From: Manuel Kaufmann <humitos@gmail.com>
Date: Fri, 1 Jun 2012 10:31:35 -0300
Subject: [PATCH Log] 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 <humitos@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
|
b
|
class MachineProperties: |
230 | 230 | |
231 | 231 | def installed_activities(self): |
232 | 232 | s = '' |
233 | | for path in glob.glob('/usr/share/activities/*.activity'): |
| 233 | for path in glob.glob('/usr/share/sugar/activities/*.activity'): |
234 | 234 | s += os.path.basename(path) + '\n' |
235 | 235 | |
236 | | for path in glob.glob('/home/olpc/Activities/*'): |
| 236 | home = os.path.expanduser('~') |
| 237 | for path in glob.glob(os.path.join(home, 'Activities', '*')): |
237 | 238 | s += '~' + os.path.basename(path) + '\n' |
238 | 239 | |
239 | 240 | return s |
… |
… |
class LogCollect: |
295 | 296 | "logcollect: could not add %s: %s" % (fn, e)) |
296 | 297 | |
297 | 298 | # Include all current ones from sugar/logs |
298 | | for path in glob.glob('/home/olpc/.sugar/default/logs/*.log'): |
| 299 | home = os.path.expanduser('~') |
| 300 | for path in glob.glob(os.path.join(home, '.sugar', 'default', |
| 301 | 'logs', '*.log')): |
299 | 302 | try: |
300 | 303 | if os.access(path, os.F_OK): |
301 | 304 | if logbytes == 0: |