OSDN Git Service

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