Package install :: Package MoSTBioDat :: Package DataBase :: Package Connect :: Module MoSTBioDatDB :: Class MoSTBioDatDB
[hide private]
[frames] | no frames]

Class MoSTBioDatDB

source code

object --+
         |
        MoSTBioDatDB

Instance Methods [hide private]
 
__init__(self, host='localhost', db='Ligand', user=None, passwd=None, port=3306, **kwargs)
INPUT: host - string, host to connect user - string, user to connect as passwd - string, password to use db - string, database to use port - integer, TCP/IP port to connect to unix_socket - string, location of unix_socket to use conv - conversion dictionary, see MySQLdb.converters connect_timeout - number of seconds to wait before the connection attempt fails.
source code
 
__repr__(self)
repr(x)
source code
 
getClientInfo(self)
database info INPUT: class object OUTPUT: str
source code
 
getConnectPort(self)
Get port INPUT: class object OUTPUT: port
source code
 
displayStatus(self)
display the status of the connection INPUT: class object OUTPUT: status of connection
source code
 
isDB(self)
check whether database server is available on given port INPUT: class object OUTPUT: boolean
source code
 
connectDB(self)
create database connection INPUT: class object OUTPUT: connection
source code
 
executeQuery(self, query, **kwarg)
create cursor and execute SQL query INPUT: query - str - SQL query cache - create cache for query, default=True cachepath - str - path to cache directory, default - current working directory cachefilename - str - cache filenames, default query cachedictfilename - str - dictionary cache filename, default - dictQuery numcachefiles - int - number cache files protocol - int - shelve, cPickle protocol, default -1 (highest) temporary - str - temporary cache directory, default /tmp/Query refresh - boolean - refresh cache memory, default=False OUTPUT: array, dictionary
source code
 
executeFileQuery(self, path, **kwarg)
execute SQL query from file INPUT: path - str - path to file with query kwarg - like for executeQuery OUTPUT array, dictionary
source code
 
commit(self)
commit changes to database INPUT: class object OUTPUT: connection committed
source code
 
rollback(self)
rollback uncommitted changes INPUT: class object OUTPUT: connection rollbacked
source code
 
autocommit(self, value)
set autocommit INPUT: class object value - int, 0 disable, 1 enable autocommit OUTPUT: autocommit connection
source code
 
starTransaction(self)
start transaction INPUT: class object OUTPUT: array - output array descr - output column description
source code
 
lockTable(self, tabname)
lock table INPUT: class object tabname - str, table name OUTPUT: array - output array descr - output column description
source code
 
unlockTables(self)
unlock tables INPUT: class object OUTPUT: array - output array descr - output column description
source code
 
closeDB(self)
close the connection to the database INPUT: class object OUTPUT: connection close
source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __str__

Static Methods [hide private]
 
getNumberConnect(self)
get number of connection INPUT: class object OUTPUT: number of connection
source code
Class Variables [hide private]
  numberConn = 0
  host = DescMoSTBioDat_host(name= 'host')
  db = DescMoSTBioDat_db(name= 'db')
  port = DescMoSTBioDat_port(name= 'port')
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, host='localhost', db='Ligand', user=None, passwd=None, port=3306, **kwargs)
(Constructor)

source code 

INPUT:
host - string, host to connect
user - string, user to connect as
passwd - string, password to use
db - string, database to use
port - integer, TCP/IP port to connect to
unix_socket - string, location of unix_socket to use
conv - conversion dictionary, see MySQLdb.converters
connect_timeout - number of seconds to wait before the connection attempt fails.
compress - if set, compression is enabled
named_pipe - if set, a named pipe is used to connect (Windows only)
init_command - command which is run once the connection is created
read_default_file - file from which default client values are read
read_default_group -  configuration group to use from the default file
cursorclass - class object, used to create cursors (keyword only)
use_unicode - if True, text-like columns are returned as unicode objects
              using the connection's character set.  Otherwise, text-like
              columns are returned as strings.  columns are returned as
              normal strings. Unicode objects will always be encoded to
              the connection's character set regardless of this setting.
charset - if supplied, the connection character set will be changed
              to this character set (MySQL-4.1 and newer). This implies
              use_unicode=True.
sql_mode - if supplied, the session SQL mode will be changed to this
           setting (MySQL-4.1 and newer). For more details and legal
           values, see the MySQL documentation.  
client_flag -  integer, flags to use or 0
               (see MySQL docs or constants/CLIENTS.py)
ssl - dictionary or mapping, contains SSL connection parameters;
      see the MySQL documentation for more details
      (mysql_ssl_set()).  If this is set, and the client does not
      support SSL, NotSupportedError will be raised.
local_infile - integer, non-zero enables LOAD LOCAL INFILE; zero disables
format - string format for log handler
filter - filter object from logger object
datefmt - data/time format
path - directory path to log file
filename - log filename, default log
filemode - mode to open log file, default='a'
level - set root logger level to specified level
logfilelevel- set level to log file
OUTPUT:
class object 

Overrides: object.__init__

__repr__(self)
(Representation operator)

source code 

repr(x)

Overrides: object.__repr__
(inherited documentation)