Enigma2 plugin to to play various online streams (mostly Latvian).

record2.py 708B

1234567891011121314151617
  1. import UserDict
  2. class Rec(UserDict.DictMixin):
  3. "Dict like class allowing a.x instead of a['x']"
  4. def __init__(self, dict=None, **kwargs):
  5. self.__dict__ = {}
  6. if dict is not None:
  7. self.update(dict)
  8. if len(kwargs):
  9. self.update(kwargs)
  10. def __setitem__(self, name, value): setattr(self, name, value)
  11. def __getitem__(self, name): return getattr(self,name,None)
  12. def __getattr__(self,key): return None
  13. def has_key(self,key): return True if self.__dict__.has_key(key) else False
  14. def keys(self): return list(self.__dict__)
  15. def __len__(self): return len(self.__dict__)
  16. def __nonzero__(self): return len(self.__dict__)