OSDN Git Service

implement caption/audio 0 byte error auto skip system.
[rec10/rec10-git.git] / rec10 / trunk / src / rec10d.py
index 0d3d225..2e33b23 100644 (file)
@@ -1,15 +1,29 @@
 #!/usr/bin/python
 # coding: UTF-8
 # Rec10 TS Recording Tools
-# Copyright (C) 2009 Yukikaze
+# Copyright (C) 2009-2010 Yukikaze
 import os
+
+import warnings
+warnings.filterwarnings('ignore', "the sets module is deprecated")
+import configreader
+import dbMySQL
 import timerec
-import dbSQLite
-path=str(os.path.dirname(os.path.abspath(__file__)))+"/"
+path = str(os.path.dirname(os.path.abspath(__file__))) + "/"
 global rec10db
-rec10db=dbSQLite.DB_SQLite(path+"ch.db")
-if __name__ == "__main__":
+def main():
     timerec.task()
-
-
+db = configreader.getdbpath("db")
+if db == "MySQL":
+    dbn = configreader.getdbpath("mysql_dbname")
+    dbh = configreader.getdbpath("mysql_host")
+    dbu = configreader.getdbpath("mysql_user")
+    dbpwd = configreader.getdbpath("mysql_passwd")
+    dbport = int(configreader.getdbpath("mysql_port"))
+    rec10db = dbMySQL.DB_MySQL(dbname=dbn, host=dbh, user=dbu, passwd=dbpwd, port=dbport)
+    rec10db.new_in_status()
+else:
+    rec10db = dbSQLite.DB_SQLite(path + "ch.db")
+if __name__ == "__main__":
+    main()