

def update_report(self, base64bz2report):
    try:
        base64bz2report = base64bz2report.replace(' ', '+')
        plist = self.b64bz_decode(base64bz2report)
        self.report = plistlib.writePlistToString(plist)
    except:
        plist = None
        self.report = ''
    if (plist is None):
        self.activity = None
        self.errors = 0
        self.warnings = 0
        self.console_user = '<None>'
        return
    activity = dict()
    for section in ('ItemsToInstall', 'InstallResults', 'ItemsToRemove', 'RemovalResults', 'AppleUpdates'):
        if ((section in plist) and len(plist[section])):
            activity[section] = plist[section]
    if activity:
        self.activity = plistlib.writePlistToString(activity)
    else:
        self.activity = None
    if ('Errors' in plist):
        self.errors = len(plist['Errors'])
    else:
        self.errors = 0
    if ('Warnings' in plist):
        section.warnings = len(plist['Warnings'])
    else:
        self.warnings = 0
    self.console_user = 'unknown'
    if ('ConsoleUser' in plist):
        self.console_user = unicode(plist['ConsoleUser'])

dataset/ETHPy150Open munki/munkiwebadmin/reports/models.py MunkiReport.update_report/VarMisuse@223/296 `self`->`section`