예제 #1
0
파일: __init__.py 프로젝트: thrawn01/humble
    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()
예제 #2
0
파일: sqlite.py 프로젝트: thrawn01/humble
    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
예제 #3
0
 def testIsList(self):
     self.assertTrue( Util.isList( [ 1 ] ) )
     self.assertTrue( Util.isList( ( 1, ) ) )
     self.assertEqual( Util.isList( 1 ), False )