home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2009 June / maximum-cd-2009-06.iso / DiscContents / digsby_setup.exe / lib / util / plistutil.pyo (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2009-02-26  |  1.5 KB  |  49 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyo (Python 2.5)
  3.  
  4.  
  5. def plisttype_to_pytype(plist):
  6.     type = plist._name
  7.     transformer = globals().get('plist_to_%s' % type, None)
  8.     if transformer is not None:
  9.         return transformer(plist)
  10.     else:
  11.         return plist
  12.  
  13.  
  14. def _from_data(cdata):
  15.     return cdata.decode('base64')
  16.  
  17.  
  18. def _to_data(data):
  19.     return data.encode('base64')
  20.  
  21.  
  22. def plist_to_real(plist):
  23.     return float(plist._cdata)
  24.  
  25.  
  26. def plist_to_string(plist):
  27.     return unicode(plist._cdata)
  28.  
  29.  
  30. def plist_to_array(plist):
  31.     return map(plisttype_to_pytype, plist._children)
  32.  
  33.  
  34. def plist_to_dict(plist):
  35.     result = { }
  36.     key = None
  37.     value = None
  38.     for child in plist._children:
  39.         if child._name == 'key':
  40.             key = child._cdata
  41.             continue
  42.         value = plisttype_to_pytype(child)
  43.         result[key] = value
  44.         key = None
  45.         value = None
  46.     
  47.     return result
  48.  
  49.