コード例 #1
0
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()
コード例 #2
0
ファイル: db.py プロジェクト: fregaham/DISP
    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)
コード例 #3
0
ファイル: db.py プロジェクト: fregaham/DISP
 def __init__(self, parent, filename, **dargs):
     self._url = "sqlite://" + parent._root.absolutePath(filename)
     self._dargs = dargs
     SessionWrapper.__init__(self, parent, self._connect)
コード例 #4
0
ファイル: db.py プロジェクト: fregaham/DISP
 def _destruct(self):
     # apache.log_error ("SOConnection closing...")
     self._obj.close()
     SessionWrapper._destruct(self)
コード例 #5
0
ファイル: db.py プロジェクト: fregaham/DISP
 def __init__(self, parent, url, **dargs):
     self._url = url
     self._dargs = dargs
     # apache.log_error ("SOConnection ctor...")
     SessionWrapper.__init__(self, parent, self._connect)