Ticket #3240: 0001-Collector-adds-user-s-logs-and-activities-SL-3240.patch

File 0001-Collector-adds-user-s-logs-and-activities-SL-3240.patch, 1.9 KB (added by humitos, 12 years ago)

Version withtout applying the pep8 patch before

  • logcollect.py

    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: 
    230230       
    231231    def installed_activities(self):       
    232232        s = ''       
    233         for path in glob.glob('/usr/share/activities/*.activity'):
     233        for path in glob.glob('/usr/share/sugar/activities/*.activity'):
    234234            s += os.path.basename(path) + '\n'
    235235
    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', '*')):
    237238            s += '~' + os.path.basename(path) + '\n'
    238239           
    239240        return s
    class LogCollect: 
    295296                                   "logcollect: could not add %s: %s" % (fn, e))
    296297                       
    297298                # 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')):
    299302                    try:
    300303                        if os.access(path, os.F_OK):
    301304                            if logbytes == 0: