database_access_string.py
Go to the documentation of this file.00001
00002
00003 from database_updater import DatabaseInterface
00004 import sys
00005
00006 class HasDebug():
00007 """A dummy class to enable construction of a DatabaseInterface"""
00008 def __init__(self):
00009 self.debug =0
00010
00011 def usage():
00012 print """Returns the account string used by database_updater.py.
00013 Example: mysql `database_access_string.py`
00014 This is convenient to connect interactively to the same DB with the same permissions."""
00015
00016
00017 def main():
00018 """A simple script for evaluating the string database_updater.py will use for connecting to MySQL database"""
00019
00020 if len(sys.argv) > 1 :
00021 usage()
00022 exit()
00023 hd = HasDebug()
00024 dbi = DatabaseInterface(hd,0)
00025 print dbi.access_string
00026
00027
00028
00029 if __name__ == "__main__":
00030 main()
00031
00032