示例#1
0
 def populate(self, hash):
     ChangeLog.populate(self, hash)
     # Fix the time
     tm = self['mtime']
     if type(tm) in (IntType, LongType):
         # A UNIX timestamp
         self['mtime'] = gmtime(tm)
     if type(self['filedigest']) == StringType:
         self['checksum'] = self['filedigest']
         del(self['filedigest'])
示例#2
0
 def populate(self, hash):
     ChangeLog.populate(self, hash)
     # Fix the time
     tm = self['mtime']
     if type(tm) in (IntType, LongType):
         # A UNIX timestamp
         self['mtime'] = localtime(tm)
     if type(self['filedigest']) == StringType:
         self['checksum'] = self['filedigest']
         del (self['filedigest'])
示例#3
0
 def populate(self, hash):
     ChangeLog.populate(self, hash)
     # Fix the time
     tm = self['time']
     if type(tm) in (IntType, LongType):
         # A UNIX timestamp
         self['time'] = gmtime(tm)
     # In changelog, data is either in UTF-8, or in any other
     # undetermined encoding. Assume ISO-Latin-1 if not UTF-8.
     for i in ('text', 'name'):
         try:
             self[i] = unicode(self[i], "utf-8")
         except UnicodeDecodeError:
             self[i] = unicode(self[i], "iso-8859-1")
示例#4
0
 def populate(self, hash):
     ChangeLog.populate(self, hash)
     # Fix the time
     tm = self['time']
     if type(tm) in (IntType, LongType):
         # A UNIX timestamp
         self['time'] = localtime(tm)
     # In changelog, data is either in UTF-8, or in any other
     # undetermined encoding. Assume ISO-Latin-1 if not UTF-8.
     for i in ('text', 'name'):
         try:
             self[i] = UnicodeType(self[i], "utf-8")
         except UnicodeDecodeError:
             self[i] = UnicodeType(self[i], "iso-8859-1")