OSDN Git Service

fix not using setdefaultencoding.
authorgn64_jp <gn64_jp@4e526526-5e11-4fc0-8910-f8fd03428081>
Thu, 3 Dec 2009 01:07:47 +0000 (01:07 +0000)
committergn64_jp <gn64_jp@4e526526-5e11-4fc0-8910-f8fd03428081>
Thu, 3 Dec 2009 01:07:47 +0000 (01:07 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/rec10@292 4e526526-5e11-4fc0-8910-f8fd03428081

Rec10WEB/trunk/src/rec10web.py
Rec10WEB/trunk/src/rec10web_dbMySQL.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 = ""
index a59fed9..38a7325 100644 (file)
@@ -39,7 +39,7 @@ class DB_MySQL:
             ret['id'] = id
             ret['type'] = typet
             ret['chtxt'] = chtxt
-            ret['title'] = title.encode('utf-8')
+            ret['title'] = title
             btime = btime.strftime("%Y-%m-%d %H:%M:%S")
             etime = etime.strftime("%Y-%m-%d %H:%M:%S")
             ret['btime'] = btime
@@ -68,7 +68,7 @@ class DB_MySQL:
             ret = {}
             ret['type'] = typet
             ret['chtxt'] = chtxt
-            ret['title'] = title.encode('utf-8')
+            ret['title'] = title
             btime = btime.strftime("%Y-%m-%d %H:%M:%S")
             etime = etime.strftime("%Y-%m-%d %H:%M:%S")
             ret['btime'] = btime
@@ -95,7 +95,7 @@ class DB_MySQL:
             ret = {}
             ret['type'] = typet
             ret['chtxt'] = chtxt
-            ret['title'] = title.encode('utf-8')
+            ret['title'] = title
             btime = btime.strftime("%Y-%m-%d %H:%M:%S")
             etime = etime.strftime("%Y-%m-%d %H:%M:%S")
             ret['btime'] = btime