Exemplo n.º 1
0
    def __init__(self, databases):
        self.databases = databases

        # Maybe we just passed a database, instead of a list of databases
        if not Util.isList( databases ):
            self.databases = [ databases ]

        # TODO: Postpone this until we actually access the database
        for database in self.databases:
            database.connect()
Exemplo n.º 2
0
    def __init__(self, tables, database ):
        log.debug( "Connect( %s )" % database )
        self.cursor = SafeNone( Exception( "Sqlite() - Connect to a database before running a query" ) )
        self.database = database
        self.connection = None
        self.tables = {}

        # Maybe we just passed in 1 table, instead of a list of tables
        if not Util.isList( tables ):
            tables = [ tables ]

        for table in tables:
            self.tables[table.__name__] = table
Exemplo n.º 3
0
 def testIsList(self):
     self.assertTrue( Util.isList( [ 1 ] ) )
     self.assertTrue( Util.isList( ( 1, ) ) )
     self.assertEqual( Util.isList( 1 ), False )