import cgitb
import rec10web_dbMySQL
import os
+import os.path
import re
import datetime
import ConfigParser
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):
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:
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:
etime = ""
title = ""
chtxt = ""
-type = "res"
+type = "reserve_flexible"
bt = ""
station_name = ""
mode = ""
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
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
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