home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2011 February / maximum-cd-2011-02.iso / DiscContents / digsby_setup85.exe / lib / util / plistutil.pyo (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2010-11-24  |  1.4 KB  |  48 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyo (Python 2.6)
  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.     return plist
  11.  
  12.  
  13. def _from_data(cdata):
  14.     return cdata.decode('base64')
  15.  
  16.  
  17. def _to_data(data):
  18.     return data.encode('base64')
  19.  
  20.  
  21. def plist_to_real(plist):
  22.     return float(plist._cdata)
  23.  
  24.  
  25. def plist_to_string(plist):
  26.     return unicode(plist._cdata)
  27.  
  28.  
  29. def plist_to_array(plist):
  30.     return map(plisttype_to_pytype, plist._children)
  31.  
  32.  
  33. def plist_to_dict(plist):
  34.     result = { }
  35.     key = None
  36.     value = None
  37.     for child in plist._children:
  38.         if child._name == 'key':
  39.             key = child._cdata
  40.             continue
  41.         value = plisttype_to_pytype(child)
  42.         result[key] = value
  43.         key = None
  44.         value = None
  45.     
  46.     return result
  47.  
  48.