Ticket #3240: 0002-Log-collector-adds-user-s-logs-and-list-installed-ac.patch

File 0002-Log-collector-adds-user-s-logs-and-list-installed-ac.patch, 2.0 KB (added by humitos, 12 years ago)
  • logcollect.py

    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: 
    229229
    230230    def installed_activities(self):
    231231        s = ''
    232         for path in glob.glob('/usr/share/activities/*.activity'):
     232        for path in glob.glob('/usr/share/sugar/activities/*.activity'):
    233233            s += os.path.basename(path) + '\n'
    234234
    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', '*')):
    236237            s += '~' + os.path.basename(path) + '\n'
    237238
    238239        return s
    class LogCollect: 
    296297                                       (fn, e))
    297298
    298299                # 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')):
    300303                    try:
    301304                        if os.access(path, os.F_OK):
    302305                            if logbytes == 0: