OSDN Git Service

simplify many codes.
[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 Yukikaze
5 import os
6
7 import configreader
8 import dbMySQL
9 import dbSQLite
10 import timerec
11 path = str(os.path.dirname(os.path.abspath(__file__))) + "/"
12 global rec10db
13 db = configreader.getdbpath("db")
14 if db == "MySQL":
15     dbn = configreader.getdbpath("mysql_dbname")
16     dbh = configreader.getdbpath("mysql_host")
17     dbu = configreader.getdbpath("mysql_user")
18     dbpwd = configreader.getdbpath("mysql_passwd")
19     dbport = int(configreader.getdbpath("mysql_port"))
20     rec10db = dbMySQL.DB_MySQL(dbname=dbn, host=dbh, user=dbu, passwd=dbpwd, port=dbport)
21 else:
22     rec10db = dbSQLite.DB_SQLite(path + "ch.db")
23 if __name__ == "__main__":
24     timerec.task()