PageRenderTime 295ms CodeModel.GetById 121ms app.highlight 2ms RepoModel.GetById 108ms 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
 1from ui import Composite
 2
 3class Sink(Composite):
 4    def __init__(self):
 5        pass
 6    
 7    def onHide(self):
 8        pass
 9        
10    def onShow(self):
11        pass
12
13    def baseURL(self):
14        return ""
15
16class SinkInfo:
17    def __init__(self, name, desc, object_type):
18        self.name=name
19        self.description=desc
20        self.object_type=object_type
21        self.instance=None
22
23    def createInstance(self):
24        if self.object_type.__new__:
25            return self.object_type.__new__()
26        return self.object_type()
27
28    def getDescription(self):
29        return self.description
30
31    def getInstance(self):
32        if self.instance==None:
33            self.instance=self.createInstance()
34        return self.instance
35    
36    def getName(self):
37        return self.name
38