X-Git-Url: http://git.osdn.net/view?p=rec10%2Frec10-git.git;a=blobdiff_plain;f=iRec10EPG%2Ftrunk%2Fsrc%2FiRec10EPG.py;fp=iRec10EPG%2Ftrunk%2Fsrc%2FiRec10EPG.py;h=0000000000000000000000000000000000000000;hp=7c4783cc65fe029b8251f50ac08c0ed15de92e3b;hb=ba2e1c2dfffe2d12bba9915837170029b28164b2;hpb=3534e118918876b64882f2912c8e6c1b37158b84 diff --git a/iRec10EPG/trunk/src/iRec10EPG.py b/iRec10EPG/trunk/src/iRec10EPG.py deleted file mode 100644 index 7c4783c..0000000 --- a/iRec10EPG/trunk/src/iRec10EPG.py +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/python -# coding: UTF-8 -# iRec10EPG Rec10 iEPG supporting tool -#Copyright 2009 Yukikaze -import os -import ConfigParser -import codecs -import webbrowser -import sys -import re -import urllib -mypath=os.path.dirname(sys.argv[0]) -def rec10web(webpath,title,station,btime,etime): - browserpath="title="+title+"&btime="+btime+"&etime="+etime+"&station="+station - browserpath=urllib.quote_plus(browserpath,"=&") - browserpath=webpath+"?"+browserpath - print browserpath - - webbrowser.open(browserpath,new=2) -def iepg2rec10webopts(path): - station="" - year="" - month="" - date="" - start="" - end="" - title="" - - for line in codecs.open(path,'r','shift_jis'): - if re.search('station:',line): - station=line.replace("station:","") - station=station.replace(" ","") - station=station.replace("\r\n","") - elif re.search('year:',line): - year=line.replace("year:","") - year=year.replace(" ","") - year=year.replace("\r\n","") - elif re.search('month:',line): - month=line.replace("month:","") - month=month.replace(" ","") - month=month.replace("\r\n","") - elif re.search('date:',line): - date=line.replace("date:","") - date=date.replace(" ","") - date=date.replace("\r\n","") - elif re.search('start:',line): - start=line.replace("start:","") - start=start.replace(" ","") - start=start.replace("\r\n","") - elif re.search('end:',line): - end=line.replace("end:","") - end=end.replace(" ","") - end=end.replace("\r\n","") - elif re.search('program-title:',line): - title=line.replace("program-title:","") - title=title.replace(" ","") - title=title.replace("\r\n","") - ret={} - ret['title']=title.encode('UTF-8') - ret['btime']=year+"-"+month+"-"+date+" "+start+":00" - ret['btime']=ret['btime'].encode('UTF-8') - ret['etime']=year+"-"+month+"-"+date+" "+end+":00" - ret['etime']=ret['etime'].encode('UTF-8') - ret['station']=station.encode('UTF-8') - return ret - - -confp=ConfigParser.SafeConfigParser() -Conf=os.path.join(mypath, 'setting.ini') -confp.read(Conf) -rec10path=confp.get('path','rec10web') -print rec10path -argvs=sys.argv -webopt=iepg2rec10webopts(argvs[1]) -print webopt - -rec10web(rec10path,webopt['title'],webopt['station'],webopt['btime'],webopt['etime'])