From f80b509be0ebb517347fa82ccd1ba8896f43c9f5 Mon Sep 17 00:00:00 2001
Message-Id: <f80b509be0ebb517347fa82ccd1ba8896f43c9f5.1336686222.git.humitos@gmail.com>
In-Reply-To: <d7405a7396fc41d29219575b596ffb8fddefaf43.1336686222.git.humitos@gmail.com>
References: <d7405a7396fc41d29219575b596ffb8fddefaf43.1336686222.git.humitos@gmail.com>
From: Manuel Kaufmann <humitos@gmail.com>
Date: Thu, 10 May 2012 18:43:29 -0300
Subject: [PATCH Log 2/2] Log collector adds user's logs and list installed
activities
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 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/logcollect.py b/logcollect.py
index 956cc24..c1157b9 100644
a
|
b
|
class MachineProperties: |
229 | 229 | |
230 | 230 | def installed_activities(self): |
231 | 231 | s = '' |
232 | | for path in glob.glob('/usr/share/activities/*.activity'): |
| 232 | for path in glob.glob('/usr/share/sugar/activities/*.activity'): |
233 | 233 | s += os.path.basename(path) + '\n' |
234 | 234 | |
235 | | for path in glob.glob('/home/olpc/Activities/*'): |
| 235 | home = os.path.expanduser('~') |
| 236 | for path in glob.glob(os.path.join(home, 'Activities', '*')): |
236 | 237 | s += '~' + os.path.basename(path) + '\n' |
237 | 238 | |
238 | 239 | return s |
… |
… |
class LogCollect: |
296 | 297 | (fn, e)) |
297 | 298 | |
298 | 299 | # Include all current ones from sugar/logs |
299 | | for path in glob.glob('/home/olpc/.sugar/default/logs/*.log'): |
| 300 | home = os.path.expanduser('~') |
| 301 | for path in glob.glob(os.path.join(home, '.sugar', 'default', |
| 302 | 'logs', '*.log')): |
300 | 303 | try: |
301 | 304 | if os.access(path, os.F_OK): |
302 | 305 | if logbytes == 0: |