OSDN Git Service

make in enable to move on python2.4.
authorgn64_jp <gn64_jp@4e526526-5e11-4fc0-8910-f8fd03428081>
Tue, 18 Aug 2009 05:27:35 +0000 (05:27 +0000)
committergn64_jp <gn64_jp@4e526526-5e11-4fc0-8910-f8fd03428081>
Tue, 18 Aug 2009 05:27:35 +0000 (05:27 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/rec10@114 4e526526-5e11-4fc0-8910-f8fd03428081

Rec10WEB/trunk/src/readme.txt
Rec10WEB/trunk/src/rec10web.py
Rec10WEB/trunk/src/rec10web_dbMySQL.py
Rec10WEB/trunk/src/rec10web_dbSQLite.py

index c5e5479..452e4e8 100644 (file)
@@ -9,6 +9,8 @@ rec10web.pyと同じフォルダ内にrec10が作ったch.dbへのリンクを
 LicenseはLGPL v3に準拠します
 yukikaze
 
+dbMySQLパッケージおよびpython2.4以上が必要です。
+
 history
 
 0.6.0
index 16ea252..8789afd 100644 (file)
@@ -11,6 +11,7 @@ import re
 import datetime
 import rec10web_dbSQLite
 import ConfigParser
+import time
 #cgitb.enable()
 path=str(os.path.dirname(os.path.abspath(__file__)))+"/"
 confp=ConfigParser.SafeConfigParser()
@@ -100,8 +101,10 @@ def reserv_recday(keyword,chtxt,btime,etime,deltatime,opt,deltaday,day):
     """
     dayは月曜日を1日曜日を7とした数字
     """
-    bt=datetime.datetime.strptime(btime,"%Y-%m-%d %H:%M:%S")
-    et=datetime.datetime.strptime(etime,"%Y-%m-%d %H:%M:%S")
+    #bt=datetime.datetime.strptime(btime,"%Y-%m-%d %H:%M:%S")
+    #et=datetime.datetime.strptime(etime,"%Y-%m-%d %H:%M:%S")
+    bt=datetime.datetime(*time.strptime(btime,"%Y-%m-%d %H:%M:%S")[:-3])
+    et=datetime.datetime(*time.strptime(etime,"%Y-%m-%d %H:%M:%S")[:-3])
     dt=int(day)-bt.isoweekday()
     if dt<0:
         dt=dt+7
@@ -225,10 +228,12 @@ if f.getfirst('chtxt'):
     chtxt=f.getfirst('chtxt')
 if f.getfirst('btime'):
     btime=f.getfirst('btime')
-    bt=datetime.datetime.strptime(btime,"%Y-%m-%d %H:%M:%S")
+    #bt=datetime.datetime.strptime(btime,"%Y-%m-%d %H:%M:%S")
+    bt=datetime.datetime(*time.strptime(btime,"%Y-%m-%d %H:%M:%S")[:-3])
 if f.getfirst('etime'):
     etime=f.getfirst('etime')
-    et=datetime.datetime.strptime(etime,"%Y-%m-%d %H:%M:%S")
+    #et=datetime.datetime.strptime(etime,"%Y-%m-%d %H:%M:%S")
+    et=datetime.datetime(*time.strptime(etime,"%Y-%m-%d %H:%M:%S")[:-3])
     if bt !="":
         delt=et-bt
         dt=delt.days*24*60*60+delt.seconds
index f6d0fa2..c843ed4 100644 (file)
@@ -6,7 +6,7 @@ import MySQLdb
 import os
 path = str(os.path.dirname(os.path.abspath(__file__))) + "/"
 dbpath = path + "ch.db"
-class DB_MySQL():
+class DB_MySQL:
     dbname=""
     dbhost=""
     dbusr=""
index 601dc6b..52d0e50 100644 (file)
@@ -2,11 +2,12 @@
 # coding: UTF-8
 # Rec10 TS Recording Tools
 # Copyright (C) 2009 Yukikaze
-import sqlite3
+import sqlite
+#import sqlite3
 import os
 path = str(os.path.dirname(os.path.abspath(__file__))) + "/"
 dbpath = path + "ch.db"
-class DB_SQLite():
+class DB_SQLite:
     dbpath=""
     def __init__(self,dbpath):
         self.dbpath = dbpath