OSDN Git Service

fix not using setdefaultencoding.
[rec10/rec10-git.git] / Rec10WEB / trunk / src / rec10web.py
index 2d71b24..1fae4a7 100644 (file)
@@ -6,6 +6,7 @@ import cgi
 import cgitb
 import rec10web_dbMySQL
 import os
+import os.path
 import re
 import datetime
 import ConfigParser
@@ -13,8 +14,15 @@ import time
 cgitb.enable()
 path = str(os.path.dirname(os.path.abspath(__file__))) + "/"
 confp = ConfigParser.SafeConfigParser()
-Conf = 'config.ini'
-confp.read(path + Conf)
+Conf = 'rec10.conf'
+cpath=""
+if (os.path.exists(os.path.join(path,Conf))):
+    cpath=os.path.join(path,Conf)
+elif (os.path.exists(os.path.join("/etc/rec10",Conf))):
+    cpath=os.path.join("/etc/rec10",Conf)
+elif (os.path.exists(os.path.join("/etc",Conf))):
+    cpath=os.path.join("/etc",Conf)
+confp.read(cpath)
 global f
 f = cgi.FieldStorage()
 def getpath(string):
@@ -127,7 +135,7 @@ def reserv(type, keyword, chtxt, btime, etime, deltatime, opt, deltaday):
     bctypegetdb = database.select_by_chtxt_epg_ch(chtxt)
     for bctypet, ontvt, chtxtt, cht, cscht, updatetimet in bctypegetdb:
         bctype = bctypet
-    if (type == "rec") or (type == "res") or (type == "key") or (type == "keyevery"):
+    if (type == "reserve_fixed") or (type == "reserve_flexible") or (type == "search_today") or (type == "search_everyday"):
         if bctype.find("cs") > -1:
             MaxS = MaxS-1
         elif bctype.find("bs") > -1:
@@ -196,7 +204,7 @@ def change_reserv(id, type, keyword, chtxt, btime, etime, deltatime, opt, deltad
     rett = ""
     for dl in database.select_by_chtxt_epg_ch(chtxt):
         bctype = dl[0]
-    if (type == "rec") or (type == "res") or (type == "key") or (type == "keyevery"):
+    if (type == "reserve_fixed") or (type == "reserve_flexible") or (type == "search_today") or (type == "search_everyday"):
         if bctype.find("cs") > -1:
             MaxS = MaxS-1
         elif bctype.find("bs") > -1:
@@ -327,7 +335,7 @@ btime = ""
 etime = ""
 title = ""
 chtxt = ""
-type = "res"
+type = "reserve_flexible"
 bt = ""
 station_name = ""
 mode = ""