OSDN Git Service

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