def main(): # TODO: Log to a file?! log.startLogging(sys.stdout) # Create the databases shared between the pub and the sub. pubdb = PublisherDatabase('publisher.db') secdb = SecurityDatabase('security.db') subdb = SubscriberDatabase('subscriber.db') # Used for logging into the portal. Strictly part of the security model? authDb = AuthorizationDatabase('authorization/passwords.txt', ':') # Use 'thisIsTheVariableNameOfTheRealmThatIsInUseDuringThisRun' just for Tom! ;-) thisIsTheVariableNameOfTheRealmThatIsInUseDuringThisRun = Realm( pubdb, secdb, subdb, authDb.GetUserList()) # Create a session wrapper for authentication wrapper = SessionWrapper( authDb.GetFile(), thisIsTheVariableNameOfTheRealmThatIsInUseDuringThisRun) pubFactory = server.Site(resource=wrapper.GetWrapper()) reactor.listenTCP(8025, pubFactory) # Start the main loop. reactor.run()
def __init__(self, parent, klass): """ @param parent: SOConnection reprezentující spojení s databází @param klass: Třída odovozená SQLObject reprezentující tabulku v SQLObject databázi """ assert isinstance(parent, SOConnection) self._klass = klass SessionWrapper.__init__(self, parent, self._connect)
def __init__(self, parent, filename, **dargs): self._url = "sqlite://" + parent._root.absolutePath(filename) self._dargs = dargs SessionWrapper.__init__(self, parent, self._connect)
def _destruct(self): # apache.log_error ("SOConnection closing...") self._obj.close() SessionWrapper._destruct(self)
def __init__(self, parent, url, **dargs): self._url = url self._dargs = dargs # apache.log_error ("SOConnection ctor...") SessionWrapper.__init__(self, parent, self._connect)