PageRenderTime 3ms CodeModel.GetById 0ms RepoModel.GetById 0ms app.codeStats 0ms

/examples/kitchensink/Sink.py

http://pyjamas.googlecode.com/
Python | 38 lines | 34 code | 4 blank | 0 comment | 0 complexity | b14cae95af8e938e065b73a999044419 MD5 | raw file
Possible License(s): LGPL-2.1, Apache-2.0
  1. from ui import Composite
  2. class Sink(Composite):
  3. def __init__(self):
  4. pass
  5. def onHide(self):
  6. pass
  7. def onShow(self):
  8. pass
  9. def baseURL(self):
  10. return ""
  11. class SinkInfo:
  12. def __init__(self, name, desc, object_type):
  13. self.name=name
  14. self.description=desc
  15. self.object_type=object_type
  16. self.instance=None
  17. def createInstance(self):
  18. if self.object_type.__new__:
  19. return self.object_type.__new__()
  20. return self.object_type()
  21. def getDescription(self):
  22. return self.description
  23. def getInstance(self):
  24. if self.instance==None:
  25. self.instance=self.createInstance()
  26. return self.instance
  27. def getName(self):
  28. return self.name