summaryrefslogtreecommitdiffstats
path: root/src/Gui/CCDump.py
blob: 0c7b29c0a346716f80af8c71c1326433644796cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# -*- coding: utf-8 -*-
from datetime import datetime

TYPE = 0
EDITABLE = 1
CONTENT = 2

class Dump():
    """Class for mapping the debug dump to python object"""
    def __init__(self):
        self.UUID = None
        self.UID = None
        self.Count = None
        self.Executable = None
        self.Package = None
        self.Time = None
        self.Description = None
    
    def getUUID(self):
        return self.UUID[CONTENT]
    
    def getUID(self):
        return self.UID[CONTENT]
        
    def getCount(self):
        return self.Count[CONTENT]
    
    def getExecutable(self):
        return self.Executable[CONTENT]
        
    def getPackage(self):
        return self.Package[CONTENT]
    
    def getTime(self,format):
        #print format
        if format:
            try:
                return datetime.fromtimestamp(int(self.Time[CONTENT])).strftime(format)
            except Exception, e:
                print e
        return int(self.Time[CONTENT])
        
    def getPackageName(self):
        return self.Package[CONTENT][:self.Package[CONTENT].find("-")]
        
    def getDescription(self):
        return self.Description[CONTENT]