コード例 #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
ファイル: test_util.py プロジェクト: thrawn01/humble
 def testIsList(self):
     self.assertTrue( Util.isList( [ 1 ] ) )
     self.assertTrue( Util.isList( ( 1, ) ) )
     self.assertEqual( Util.isList( 1 ), False )