示例#1
0
    def __init__(self, tid, ds=None, pretype=None):
        """
        creates a new instance of a thing
        don't actually call this outside the datalayer unless you know what you are doing
        """
        self.datasource = ds
        if pretype is not None:
            self.type = pretype
        if self.datasource is None:
            self.datasource = datasource.getDatasource()

        # chain that defered onto our new one
        if tid > 0:
            self.ready = defer.Deferred()
            self.update = True  # changes will cause and update
            self.loadThing(tid).chainDeferred(self.ready)
        else:
            self.update = False  # changes will cause creation
            # we are already ready so make it a prefired deferred
            self.ready = defer.succeed(None)
示例#2
0
from .diag import DiagFactory
import datasource
from twisted.internet import reactor
from twisted.python import log
log.msg("""running diag for the fsbbs.data
be careful with this it allows db access to EVERYONE
""")


reactor.listenTCP(8734,DiagFactory(datasource.getDatasource()))
reactor.run()



示例#3
0
 def __init__(self,service):
     log.msg("launching diag")
     self.ds = datasource.getDatasource()