X-Git-Url: http://git.osdn.net/view?p=rec10%2Frec10-git.git;a=blobdiff_plain;f=rec10%2Ftrunk%2Fsrc%2Frec10d.py;h=b0ce3af7153b7ad09a05246812db5fcf57de37a1;hp=2e33b23d8caedf904010352b493d3127d9b55ee9;hb=12414a3ba81d93316e351ab51aa49bb71cf42f60;hpb=ce8e4ba1276be627390fd57f480cb2b28af1deaa diff --git a/rec10/trunk/src/rec10d.py b/rec10/trunk/src/rec10d.py index 2e33b23..b0ce3af 100644 --- a/rec10/trunk/src/rec10d.py +++ b/rec10/trunk/src/rec10d.py @@ -1,29 +1,34 @@ -#!/usr/bin/python -# coding: UTF-8 -# Rec10 TS Recording Tools -# Copyright (C) 2009-2010 Yukikaze -import os - -import warnings -warnings.filterwarnings('ignore', "the sets module is deprecated") -import configreader -import dbMySQL -import timerec -path = str(os.path.dirname(os.path.abspath(__file__))) + "/" -global rec10db -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() - +#!/usr/bin/python +# coding: UTF-8 +# Rec10 TS Recording Tools +# Copyright (C) 2009-2011 Yukikaze +import os +import os.path +import warnings +warnings.filterwarnings('ignore', "the sets module is deprecated") +import configreader +import dbMySQL +import timerec +path = str(os.path.dirname(os.path.abspath(__file__))) + "/" +tmppath = configreader.getConfPath("tmp")+"/" +if tmppath=="/": + tmppath=path +if not os.path.exists(tmppath): + os.makedirs(tmppath) +global rec10db +def main(): + timerec.task() +db = configreader.getConfDB("db") +if db == "MySQL": + dbn = configreader.getConfDB("mysql_dbname") + dbh = configreader.getConfDB("mysql_host") + dbu = configreader.getConfDB("mysql_user") + dbpwd = configreader.getConfDB("mysql_passwd") + dbport = int(configreader.getConfDB("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() +