Beispiel #1
0
    def __init__(self, class_or_classid):
        import types

        if isinstance(class_or_classid, types.StringTypes):
            self.control_class = resolveclass(class_or_classid)
        else:
            self.control_class = class_or_classid
Beispiel #2
0
Datei: app.py Projekt: rctk/rctk
def check_classid(classid):
    o = resolveclass(classid)
    if not callable(o):
        raise AppNotCallable(classid)
    if inspect.isclass(o) and not issubclass(o, App):
        # old style or just plain wrong
        warnings.warn("Deprecation Warning: Please subclass rctk.app.App", DeprecationWarning)
Beispiel #3
0
    def __init__(self, classid, debug, args, kw, startupdir):
        self.last_access = time.time()
        self.state = State()
        self.set_global_state()
        self.classid = classid
        self.debug = debug
        self.appclass = resolveclass(classid)

        self.app = self.appclass(*args, **kw)
        self.tk = factory(self.app, debug=debug)

        self.tk.startupdir = startupdir # ??
        self.crashed = False
Beispiel #4
0
    def __init__(self, sessionclass, classid, frontendclass=None, startupdir="", 
                 debug=False, *args, **kw):
        self.sessionclass = sessionclass
        self.classid = classid
        self.frontendclass = Loader.load(frontendclass or self.DEFAULT_FRONTEND)
        self.startupdir = startupdir
        self.debug = debug
        self.args = args
        self.kw = kw

        ##
        ## import the application class. This will allow the application
        ## to register all its non-dynamic resources
        self.appclass = resolveclass(classid)
        app_frontend = getattr(self.appclass, 'frontend', None)
        if app_frontend:
            self.frontendclass = app_frontend

        self.sessions = {}

        check_classid(self.classid)
Beispiel #5
0
 def load(cls, name):
     return resolveclass(name)