Exemplo n.º 1
0
Arquivo: db.py Projeto: shuqin/pystudy
    def __init__(self, read_only = True, auto_commit = False,
                 timeout = 5, auto_connect = False, max_idle_time = 28800):
        '''Initialize the Mydb object.'''
        # Get the database parameters
        args = {'host':'127.0.0.1', 'user':'******','passwd':'xxxx','db':'goodcode','port':3306,'charset':'utf8'}

        # Set extra connection parameters
        args['connect_timeout'] = timeout
        args['auto_commit'] = auto_commit
        args['max_idle_time'] = max_idle_time
        args['auto_connect'] = auto_connect

        DB.__init__(self, **args)
Exemplo n.º 2
0
 def __init__(self, pos, DBPath=None):
     DB.__init__(self, DBPath)
     self.pos = pos
Exemplo n.º 3
0
 def __init__(self):
     DB.__init__(self)