OSDN Git Service

change function name.
[rec10/rec10-git.git] / rec10 / trunk / src / rec10d.py
1 #!/usr/bin/python
2 # coding: UTF-8
3 # Rec10 TS Recording Tools
4 # Copyright (C) 2009-2010 Yukikaze
5 import os
6
7 import warnings
8 warnings.filterwarnings('ignore', "the sets module is deprecated")
9 import configreader
10 import dbMySQL
11 import timerec
12 path = str(os.path.dirname(os.path.abspath(__file__))) + "/"
13 global rec10db
14 def main():
15     timerec.task()
16 db = configreader.getDBPathSetting("db")
17 if db == "MySQL":
18     dbn = configreader.getDBPathSetting("mysql_dbname")
19     dbh = configreader.getDBPathSetting("mysql_host")
20     dbu = configreader.getDBPathSetting("mysql_user")
21     dbpwd = configreader.getDBPathSetting("mysql_passwd")
22     dbport = int(configreader.getDBPathSetting("mysql_port"))
23     rec10db = dbMySQL.DB_MySQL(dbname=dbn, host=dbh, user=dbu, passwd=dbpwd, port=dbport)
24     rec10db.new_in_status()
25 else:
26     rec10db = dbSQLite.DB_SQLite(path + "ch.db")
27 if __name__ == "__main__":
28     main()
29