OSDN Git Service

stop using trunk or dist directory in rec10 project.
authorgn64_jp <gn64@rec10.org>
Fri, 12 Apr 2013 00:49:18 +0000 (09:49 +0900)
committergn64_jp <gn64@rec10.org>
Fri, 12 Apr 2013 00:49:18 +0000 (09:49 +0900)
407 files changed:
dist/trunk/Makefile.base [deleted file]
dist/trunk/b25-remote/BCasCard.cpp [deleted file]
dist/trunk/b25-remote/BCasCard.h [deleted file]
dist/trunk/b25-remote/CasClient.cpp [deleted file]
dist/trunk/b25-remote/CasClient.h [deleted file]
dist/trunk/b25-remote/CasProxy.cpp [deleted file]
dist/trunk/b25-remote/CasProxy.h [deleted file]
dist/trunk/b25-remote/CasServer.cpp [deleted file]
dist/trunk/b25-remote/CasServer.h [deleted file]
dist/trunk/b25-remote/Makefile [deleted file]
dist/trunk/b25-remote/Readme.txt [deleted file]
dist/trunk/b25-remote/SmartSock.cpp [deleted file]
dist/trunk/b25-remote/SmartSock.h [deleted file]
dist/trunk/b25-remote/TsUtilClass.cpp [deleted file]
dist/trunk/b25-remote/TsUtilClass.h [deleted file]
dist/trunk/b25-remote/W2L.h [deleted file]
dist/trunk/b25-remote/b25-client.cpp [deleted file]
dist/trunk/b25-remote/b25-server.cpp [deleted file]
dist/trunk/diff [deleted file]
dist/trunk/install.sh [deleted file]
dist/trunk/readme.txt [deleted file]
dist/trunk/rec10/Makefile.base [deleted file]
dist/trunk/rec10/auto_move.py [deleted file]
dist/trunk/rec10/auto_process.py [deleted file]
dist/trunk/rec10/auto_rec.py [deleted file]
dist/trunk/rec10/auto_test.py [deleted file]
dist/trunk/rec10/chdata.py [deleted file]
dist/trunk/rec10/chdb.py [deleted file]
dist/trunk/rec10/checker.py [deleted file]
dist/trunk/rec10/classify.py [deleted file]
dist/trunk/rec10/configreader.py [deleted file]
dist/trunk/rec10/configwriter.py [deleted file]
dist/trunk/rec10/dbMySQL.py [deleted file]
dist/trunk/rec10/epgdb.py [deleted file]
dist/trunk/rec10/epgrefresh.py [deleted file]
dist/trunk/rec10/guess.py [deleted file]
dist/trunk/rec10/install.py [deleted file]
dist/trunk/rec10/install.sh [deleted file]
dist/trunk/rec10/license-ja.txt [deleted file]
dist/trunk/rec10/license.txt [deleted file]
dist/trunk/rec10/n_gram.py [deleted file]
dist/trunk/rec10/readme.txt [deleted file]
dist/trunk/rec10/rec10.conf [deleted file]
dist/trunk/rec10/rec10d.py [deleted file]
dist/trunk/rec10/recdb.py [deleted file]
dist/trunk/rec10/recdblist.py [deleted file]
dist/trunk/rec10/recque.py [deleted file]
dist/trunk/rec10/scan_ch.py [deleted file]
dist/trunk/rec10/status.py [deleted file]
dist/trunk/rec10/tester.py [deleted file]
dist/trunk/rec10/timerec.py [deleted file]
dist/trunk/rec10/ts2epg.py [deleted file]
dist/trunk/rec10/ts2x264.py [deleted file]
dist/trunk/rec10/tv2audio.py [deleted file]
dist/trunk/rec10/tv2avi.py [deleted file]
dist/trunk/rec10/tv2mkv.py [deleted file]
dist/trunk/rec10/tv2mp4.py [deleted file]
dist/trunk/rec10/tv2ts.py [deleted file]
dist/trunk/rec10/xml2db_dom.py [deleted file]
dist/trunk/rec10/zenhan.py [deleted file]
dist/trunk/rec10/zip.py [deleted file]
dist/trunk/rec10Manual0.9.9.pdf [deleted file]
dist/trunk/tstools/BonTsDemux/BonTsDemux.exe [deleted file]
dist/trunk/tstools/BonTsDemux/BonTsDemux.txt [deleted file]
dist/trunk/tstools/BonTsDemux/BonTsDemuxLib.dll [deleted file]
dist/trunk/tstools/BonTsDemux/src.zip [deleted file]
dist/trunk/tstools/Makefile [deleted file]
dist/trunk/tstools/epgdump/Makefile [deleted file]
dist/trunk/tstools/epgdump/aribstr.c [deleted file]
dist/trunk/tstools/epgdump/aribstr.h [deleted file]
dist/trunk/tstools/epgdump/eit.c [deleted file]
dist/trunk/tstools/epgdump/eit.h [deleted file]
dist/trunk/tstools/epgdump/epgdump.c [deleted file]
dist/trunk/tstools/epgdump/epgdump_segfault_fix_patch(last).txt [deleted file]
dist/trunk/tstools/epgdump/patch2ch [deleted file]
dist/trunk/tstools/epgdump/patch_r2 [deleted file]
dist/trunk/tstools/epgdump/readme.txt [deleted file]
dist/trunk/tstools/epgdump/sdt.c [deleted file]
dist/trunk/tstools/epgdump/sdt.h [deleted file]
dist/trunk/tstools/epgdump/ts.c [deleted file]
dist/trunk/tstools/epgdump/ts.h [deleted file]
dist/trunk/tstools/epgdump/ts_ctl.h [deleted file]
dist/trunk/tstools/epgdump/util.c [deleted file]
dist/trunk/tstools/epgdump/util.h [deleted file]
dist/trunk/tstools/epgdump/xmldata.c [deleted file]
dist/trunk/tstools/jTsSplitter/jTsSplitter.jar [deleted file]
dist/trunk/tstools/tunerec/Makefile [deleted file]
dist/trunk/tstools/tunerec/README.ja [deleted file]
dist/trunk/tstools/tunerec/tunerec.c [deleted file]
dist/trunk/www/Makefile.PL [deleted file]
dist/trunk/www/rectool.pl [deleted file]
epgdump/Makefile [deleted file]
epgdump/aribstr.c [deleted file]
epgdump/aribstr.h [deleted file]
epgdump/bit.c [deleted file]
epgdump/bit.h [deleted file]
epgdump/cdt.c [deleted file]
epgdump/cdt.h [deleted file]
epgdump/clt2png.c [deleted file]
epgdump/clt2png.h [deleted file]
epgdump/dsmcc.c [deleted file]
epgdump/dsmcc.h [deleted file]
epgdump/eit.c [deleted file]
epgdump/eit.h [deleted file]
epgdump/epgdump.c [deleted file]
epgdump/epgdump_segfault_fix_patch(last).txt [deleted file]
epgdump/patch2ch [deleted file]
epgdump/patch_r2 [deleted file]
epgdump/psi.c [deleted file]
epgdump/psi.h [deleted file]
epgdump/readme.txt [deleted file]
epgdump/sdt.c [deleted file]
epgdump/sdt.h [deleted file]
epgdump/sdtt.c [deleted file]
epgdump/sdtt.h [deleted file]
epgdump/tags [deleted file]
epgdump/tot.c [deleted file]
epgdump/tot.h [deleted file]
epgdump/ts.c [deleted file]
epgdump/ts.h [deleted file]
epgdump/ts_ctl.h [deleted file]
epgdump/util.c [deleted file]
epgdump/util.h [deleted file]
epgdump/xmldata.c [deleted file]
jTsSplitter/trunk/src/jtssplitter/Chlist.java [deleted file]
jTsSplitter/trunk/src/jtssplitter/Main.java [deleted file]
jTsSplitter/trunk/src/jtssplitter/Mpeg2TSPacket.java [deleted file]
jTsSplitter/trunk/src/jtssplitter/Tsfile.java [deleted file]
jTsSplitter/trunk/src/jtssplitter/calc.java [deleted file]
jTsSplitter/trunk/src/jtssplitter/data/Audio_stream_descriptor.java [deleted file]
jTsSplitter/trunk/src/jtssplitter/data/Descriptor.java [deleted file]
jTsSplitter/trunk/src/jtssplitter/data/DescriptorData.java [deleted file]
jTsSplitter/trunk/src/jtssplitter/data/EITData.java [deleted file]
jTsSplitter/trunk/src/jtssplitter/data/PATData.java [deleted file]
jTsSplitter/trunk/src/jtssplitter/data/PIDs.java [deleted file]
jTsSplitter/trunk/src/jtssplitter/data/PMTData.java [deleted file]
jTsSplitter/trunk/src/jtssplitter/data/Video_stream_descriptor.java [deleted file]
jTsSplitter/trunk/src/jtssplitter/data/descriptor/ARIB_Audio_Component_Descriptor.java [deleted file]
jTsSplitter/trunk/src/jtssplitter/data/descriptor/ARIB_Video_Compornent_Descriptor.java [deleted file]
jTsSplitter/trunk/src/jtssplitter/data/descriptor/abstract_Descriptor.java [deleted file]
jTsSplitter/trunk/src/license-ja.txt [deleted file]
jTsSplitter/trunk/src/license.txt [deleted file]
manual/trunk/eps/rectool_bravia.eps [deleted file]
manual/trunk/eps/rectool_expert.eps [deleted file]
manual/trunk/eps/rectool_expert_2.eps [deleted file]
manual/trunk/eps/rectool_jbk.eps [deleted file]
manual/trunk/eps/rectool_proposal.eps [deleted file]
manual/trunk/eps/rectool_reclist.eps [deleted file]
manual/trunk/eps/rectool_recordedList.eps [deleted file]
manual/trunk/eps/rectool_top.eps [deleted file]
manual/trunk/eps/rectool_top_chlist.eps [deleted file]
manual/trunk/eps/rectool_top_datelist.eps [deleted file]
manual/trunk/eps/rectool_top_genreList.eps [deleted file]
manual/trunk/eps/rectool_top_reserve.eps [deleted file]
manual/trunk/eps/rectool_top_searchCh.eps [deleted file]
manual/trunk/eps/rectool_top_searchKeyword.eps [deleted file]
manual/trunk/rec10Manual.pdf [deleted file]
manual/trunk/rec10Manual.tex [deleted file]
manual/trunk/tex2pdf.sh [deleted file]
rec10/branches/0.4/src/chdata.py [deleted file]
rec10/branches/0.4/src/chdb.py [deleted file]
rec10/branches/0.4/src/config.ini [deleted file]
rec10/branches/0.4/src/configreader.py [deleted file]
rec10/branches/0.4/src/dbviewer.py [deleted file]
rec10/branches/0.4/src/epgdb.py [deleted file]
rec10/branches/0.4/src/install.py [deleted file]
rec10/branches/0.4/src/license-ja.txt [deleted file]
rec10/branches/0.4/src/license.txt [deleted file]
rec10/branches/0.4/src/missed.py [deleted file]
rec10/branches/0.4/src/readme.txt [deleted file]
rec10/branches/0.4/src/rec10d.py [deleted file]
rec10/branches/0.4/src/rec10gridserver.py [deleted file]
rec10/branches/0.4/src/recdb.py [deleted file]
rec10/branches/0.4/src/recdblist.py [deleted file]
rec10/branches/0.4/src/status.py [deleted file]
rec10/branches/0.4/src/tester.py [deleted file]
rec10/branches/0.4/src/timerec.py [deleted file]
rec10/branches/0.4/src/ts2epg.py [deleted file]
rec10/branches/0.4/src/ts2x264.py [deleted file]
rec10/branches/0.4/src/ts2xvid.py [deleted file]
rec10/branches/0.4/src/tv2avi.py [deleted file]
rec10/branches/0.4/src/tv2ts.py [deleted file]
rec10/branches/0.4/src/xml2db.py [deleted file]
rec10/branches/0.5/src/chdata.py [deleted file]
rec10/branches/0.5/src/chdb.py [deleted file]
rec10/branches/0.5/src/config.ini [deleted file]
rec10/branches/0.5/src/configreader.py [deleted file]
rec10/branches/0.5/src/dbviewer.py [deleted file]
rec10/branches/0.5/src/epgdb.py [deleted file]
rec10/branches/0.5/src/epgrefresh.py [deleted file]
rec10/branches/0.5/src/install.py [deleted file]
rec10/branches/0.5/src/license-ja.txt [deleted file]
rec10/branches/0.5/src/license.txt [deleted file]
rec10/branches/0.5/src/missed.py [deleted file]
rec10/branches/0.5/src/n_gram.py [deleted file]
rec10/branches/0.5/src/readme.txt [deleted file]
rec10/branches/0.5/src/rec10d.py [deleted file]
rec10/branches/0.5/src/rec10gridserver.py [deleted file]
rec10/branches/0.5/src/recdb.py [deleted file]
rec10/branches/0.5/src/recdblist.py [deleted file]
rec10/branches/0.5/src/status [deleted file]
rec10/branches/0.5/src/status.py [deleted file]
rec10/branches/0.5/src/timerec.py [deleted file]
rec10/branches/0.5/src/ts2epg.py [deleted file]
rec10/branches/0.5/src/ts2x264.py [deleted file]
rec10/branches/0.5/src/ts2xvid.py [deleted file]
rec10/branches/0.5/src/tv2avi.py [deleted file]
rec10/branches/0.5/src/tv2ts.py [deleted file]
rec10/branches/0.5/src/xml2db.py [deleted file]
rec10/branches/0.5/src/zenhan.py [deleted file]
rec10/branches/0.9.0/src/auto_process.py [deleted file]
rec10/branches/0.9.0/src/auto_rec.py [deleted file]
rec10/branches/0.9.0/src/chdata.py [deleted file]
rec10/branches/0.9.0/src/chdb.py [deleted file]
rec10/branches/0.9.0/src/checker.py [deleted file]
rec10/branches/0.9.0/src/classify.py [deleted file]
rec10/branches/0.9.0/src/config.ini [deleted file]
rec10/branches/0.9.0/src/configreader.py [deleted file]
rec10/branches/0.9.0/src/dbMySQL.py [deleted file]
rec10/branches/0.9.0/src/epgdb.py [deleted file]
rec10/branches/0.9.0/src/epgrefresh.py [deleted file]
rec10/branches/0.9.0/src/gridserver.py [deleted file]
rec10/branches/0.9.0/src/guess.py [deleted file]
rec10/branches/0.9.0/src/install.py [deleted file]
rec10/branches/0.9.0/src/license-ja.txt [deleted file]
rec10/branches/0.9.0/src/license.txt [deleted file]
rec10/branches/0.9.0/src/missed.py [deleted file]
rec10/branches/0.9.0/src/n_gram.py [deleted file]
rec10/branches/0.9.0/src/readme.txt [deleted file]
rec10/branches/0.9.0/src/rec10d.py [deleted file]
rec10/branches/0.9.0/src/recdb.py [deleted file]
rec10/branches/0.9.0/src/recdblist.py [deleted file]
rec10/branches/0.9.0/src/status.py [deleted file]
rec10/branches/0.9.0/src/tester.py [deleted file]
rec10/branches/0.9.0/src/timerec.py [deleted file]
rec10/branches/0.9.0/src/ts2epg.py [deleted file]
rec10/branches/0.9.0/src/ts2x264.py [deleted file]
rec10/branches/0.9.0/src/ts2xvid.py [deleted file]
rec10/branches/0.9.0/src/tv2avi.py [deleted file]
rec10/branches/0.9.0/src/tv2mkv.py [deleted file]
rec10/branches/0.9.0/src/tv2mp4.py [deleted file]
rec10/branches/0.9.0/src/tv2ts.py [deleted file]
rec10/branches/0.9.0/src/xml2db.py [deleted file]
rec10/branches/0.9.0/src/zenhan.py [deleted file]
rec10/trunk/src/Makefile.base [deleted file]
rec10/trunk/src/auto_move.py [deleted file]
rec10/trunk/src/auto_process.py [deleted file]
rec10/trunk/src/auto_rec.py [deleted file]
rec10/trunk/src/auto_test.py [deleted file]
rec10/trunk/src/chdata.py [deleted file]
rec10/trunk/src/chdb.py [deleted file]
rec10/trunk/src/checker.py [deleted file]
rec10/trunk/src/classify.py [deleted file]
rec10/trunk/src/configreader.py [deleted file]
rec10/trunk/src/configwriter.py [deleted file]
rec10/trunk/src/dbMySQL.py [deleted file]
rec10/trunk/src/epgdb.py [deleted file]
rec10/trunk/src/epgrefresh.py [deleted file]
rec10/trunk/src/guess.py [deleted file]
rec10/trunk/src/install.py [deleted file]
rec10/trunk/src/install.sh [deleted file]
rec10/trunk/src/license-ja.txt [deleted file]
rec10/trunk/src/license.txt [deleted file]
rec10/trunk/src/n_gram.py [deleted file]
rec10/trunk/src/readme.txt [deleted file]
rec10/trunk/src/rec10.conf [deleted file]
rec10/trunk/src/rec10d.py [deleted file]
rec10/trunk/src/recdb.py [deleted file]
rec10/trunk/src/recdblist.py [deleted file]
rec10/trunk/src/recording_earth_pt1.py [deleted file]
rec10/trunk/src/recque.py [deleted file]
rec10/trunk/src/scan_ch.py [deleted file]
rec10/trunk/src/status.py [deleted file]
rec10/trunk/src/tester.py [deleted file]
rec10/trunk/src/timerec.py [deleted file]
rec10/trunk/src/ts2epg.py [deleted file]
rec10/trunk/src/ts2x264.py [deleted file]
rec10/trunk/src/tv2audio.py [deleted file]
rec10/trunk/src/tv2avi.py [deleted file]
rec10/trunk/src/tv2mkv.py [deleted file]
rec10/trunk/src/tv2mp4.py [deleted file]
rec10/trunk/src/tv2ts.py [deleted file]
rec10/trunk/src/xml2db_dom.py [deleted file]
rec10/trunk/src/zenhan.py [deleted file]
rec10/trunk/src/zip.py [deleted file]
tstools/DtsEdit/DtsEdit.exe [deleted file]
tstools/DtsEdit/License.txt [deleted file]
tstools/DtsEdit/gpl.txt [deleted file]
tstools/DtsEdit/readme.txt [deleted file]
tstools/DtsEdit/src/DtsEdit.cpp [deleted file]
tstools/DtsEdit/src/DtsEdit.sln [deleted file]
tstools/DtsEdit/src/DtsEdit.vcproj [deleted file]
tstools/DtsEdit/src/EditMain.cpp [deleted file]
tstools/DtsEdit/src/EditMain.h [deleted file]
tstools/DtsEdit/src/Help.cpp [deleted file]
tstools/DtsEdit/src/Help.h [deleted file]
tstools/DtsEdit/src/common.cpp [deleted file]
tstools/DtsEdit/src/common.h [deleted file]
tstools/DtsEdit/src/debug.h [deleted file]
tstools/DtsEdit/src/gpac/avparse.h [deleted file]
tstools/DtsEdit/src/gpac/base_coding.h [deleted file]
tstools/DtsEdit/src/gpac/bifs.h [deleted file]
tstools/DtsEdit/src/gpac/bifsengine.h [deleted file]
tstools/DtsEdit/src/gpac/bitstream.h [deleted file]
tstools/DtsEdit/src/gpac/color.h [deleted file]
tstools/DtsEdit/src/gpac/compositor.h [deleted file]
tstools/DtsEdit/src/gpac/config_file.h [deleted file]
tstools/DtsEdit/src/gpac/constants.h [deleted file]
tstools/DtsEdit/src/gpac/crypt.h [deleted file]
tstools/DtsEdit/src/gpac/download.h [deleted file]
tstools/DtsEdit/src/gpac/esi.h [deleted file]
tstools/DtsEdit/src/gpac/events.h [deleted file]
tstools/DtsEdit/src/gpac/ietf.h [deleted file]
tstools/DtsEdit/src/gpac/internal/avilib.h [deleted file]
tstools/DtsEdit/src/gpac/internal/bifs_dev.h [deleted file]
tstools/DtsEdit/src/gpac/internal/bifs_tables.h [deleted file]
tstools/DtsEdit/src/gpac/internal/camera.h [deleted file]
tstools/DtsEdit/src/gpac/internal/compositor_dev.h [deleted file]
tstools/DtsEdit/src/gpac/internal/config.h [deleted file]
tstools/DtsEdit/src/gpac/internal/config_static.h [deleted file]
tstools/DtsEdit/src/gpac/internal/crypt_dev.h [deleted file]
tstools/DtsEdit/src/gpac/internal/ietf_dev.h [deleted file]
tstools/DtsEdit/src/gpac/internal/isomedia_dev.h [deleted file]
tstools/DtsEdit/src/gpac/internal/laser_dev.h [deleted file]
tstools/DtsEdit/src/gpac/internal/media_dev.h [deleted file]
tstools/DtsEdit/src/gpac/internal/mesh.h [deleted file]
tstools/DtsEdit/src/gpac/internal/odf_dev.h [deleted file]
tstools/DtsEdit/src/gpac/internal/ogg.h [deleted file]
tstools/DtsEdit/src/gpac/internal/scenegraph_dev.h [deleted file]
tstools/DtsEdit/src/gpac/internal/swf_dev.h [deleted file]
tstools/DtsEdit/src/gpac/internal/terminal_dev.h [deleted file]
tstools/DtsEdit/src/gpac/internal/vobsub.h [deleted file]
tstools/DtsEdit/src/gpac/ismacryp.h [deleted file]
tstools/DtsEdit/src/gpac/iso639.h [deleted file]
tstools/DtsEdit/src/gpac/isomedia.h [deleted file]
tstools/DtsEdit/src/gpac/laser.h [deleted file]
tstools/DtsEdit/src/gpac/libgpac_static.lib [deleted file]
tstools/DtsEdit/src/gpac/libgpac_static_msvcr.lib [deleted file]
tstools/DtsEdit/src/gpac/list.h [deleted file]
tstools/DtsEdit/src/gpac/math.h [deleted file]
tstools/DtsEdit/src/gpac/media_tools.h [deleted file]
tstools/DtsEdit/src/gpac/mediaobject.h [deleted file]
tstools/DtsEdit/src/gpac/module.h [deleted file]
tstools/DtsEdit/src/gpac/modules/audio_out.h [deleted file]
tstools/DtsEdit/src/gpac/modules/codec.h [deleted file]
tstools/DtsEdit/src/gpac/modules/font.h [deleted file]
tstools/DtsEdit/src/gpac/modules/ipmp.h [deleted file]
tstools/DtsEdit/src/gpac/modules/js_usr.h [deleted file]
tstools/DtsEdit/src/gpac/modules/raster2d.h [deleted file]
tstools/DtsEdit/src/gpac/modules/service.h [deleted file]
tstools/DtsEdit/src/gpac/modules/term_ext.h [deleted file]
tstools/DtsEdit/src/gpac/modules/video_out.h [deleted file]
tstools/DtsEdit/src/gpac/mpeg4_odf.h [deleted file]
tstools/DtsEdit/src/gpac/mpegts.h [deleted file]
tstools/DtsEdit/src/gpac/network.h [deleted file]
tstools/DtsEdit/src/gpac/nodes_mpeg4.h [deleted file]
tstools/DtsEdit/src/gpac/nodes_svg.h [deleted file]
tstools/DtsEdit/src/gpac/nodes_x3d.h [deleted file]
tstools/DtsEdit/src/gpac/nodes_xbl.h [deleted file]
tstools/DtsEdit/src/gpac/options.h [deleted file]
tstools/DtsEdit/src/gpac/path2d.h [deleted file]
tstools/DtsEdit/src/gpac/scene_manager.h [deleted file]
tstools/DtsEdit/src/gpac/scenegraph.h [deleted file]
tstools/DtsEdit/src/gpac/scenegraph_svg.h [deleted file]
tstools/DtsEdit/src/gpac/scenegraph_vrml.h [deleted file]
tstools/DtsEdit/src/gpac/setup.h [deleted file]
tstools/DtsEdit/src/gpac/svg_types.h [deleted file]
tstools/DtsEdit/src/gpac/sync_layer.h [deleted file]
tstools/DtsEdit/src/gpac/term_info.h [deleted file]
tstools/DtsEdit/src/gpac/terminal.h [deleted file]
tstools/DtsEdit/src/gpac/thread.h [deleted file]
tstools/DtsEdit/src/gpac/token.h [deleted file]
tstools/DtsEdit/src/gpac/tools.h [deleted file]
tstools/DtsEdit/src/gpac/user.h [deleted file]
tstools/DtsEdit/src/gpac/utf.h [deleted file]
tstools/DtsEdit/src/gpac/xml.h [deleted file]
tstools/DtsEdit/src/stdafx.cpp [deleted file]
tstools/DtsEdit/src/stdafx.h [deleted file]
tstools/DtsEdit/src/stdint.h [deleted file]
tstools/DtsEdit/ディレイカット.bat [deleted file]
tstools/Makefile
tstools/arib_std_b25/arib_std_b25-0.2.5-w2l.patch [deleted file]
tstools/cfr2tc/cfr2tc-README.txt [deleted file]
tstools/cfr2tc/cfr2tc.exe [deleted file]
tstools/cfr2tc/cfr2tc/cfr2tc.cpp [deleted file]
tstools/cfr2tc/cfr2tc/cfr2tc.rc [deleted file]
tstools/cfr2tc/cfr2tc/cfr2tc.sln [deleted file]
tstools/cfr2tc/cfr2tc/cfr2tc.vcproj [deleted file]
tstools/cfr2tc/cfr2tc/resource.h [deleted file]
tstools/cfr2tc/gpl.txt [deleted file]
tstools/epgdump/Makefile [changed mode: 0755->0644]
tstools/epgdump/aribstr.c
tstools/epgdump/eit.c
tstools/epgdump/eit.h
tstools/epgdump/epgdump.c
tstools/epgdump/patch2ch [changed mode: 0755->0644]
tstools/epgdump/patch_r2 [changed mode: 0755->0644]
tstools/epgdump/readme.txt
tstools/epgdump/sdt.c
tstools/epgdump/sdt.h
tstools/epgdump/ts.c
tstools/epgdump/ts_ctl.h
tstools/epgdump/util.c
tstools/epgdump/util.h
tstools/epgdump/xmldata.c
tstools/jTsSplitter/jTsSplitter.jar [changed mode: 0644->0755]
tstools/xvfb-run/xvfb-run [deleted file]

diff --git a/dist/trunk/Makefile.base b/dist/trunk/Makefile.base
deleted file mode 100755 (executable)
index de63667..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-MAJOR = 0
-MINOR = 9
-REVISION = 10
-VER = $(MAJOR).$(MINOR).$(REVISION)
-
-
-all: 
-       cd tstools;make all
-clean:
-       cd tstools;make clean
-install: 
-       cd rec10;make install
-       cd tstools;make install
-uninstall:
-       cd tstools;make uninstall
-       cd rec10;make uninstall
-       
diff --git a/dist/trunk/b25-remote/BCasCard.cpp b/dist/trunk/b25-remote/BCasCard.cpp
deleted file mode 100755 (executable)
index 7d8387f..0000000
+++ /dev/null
@@ -1,361 +0,0 @@
-// BcasCard.cpp: CBcasCard \83N\83\89\83X\82Ì\83C\83\93\83v\83\8a\83\81\83\93\83e\81[\83V\83\87\83\93\r
-//\r
-//////////////////////////////////////////////////////////////////////\r
-\r
-#include "W2L.h"\r
-#include "BCasCard.h"\r
-\r
-#ifdef _DEBUG\r
-#undef THIS_FILE\r
-static char THIS_FILE[]=__FILE__;\r
-#define new DEBUG_NEW\r
-#endif\r
-\r
-\r
-//#pragma comment(lib, "WinScard.lib")\r
-\r
-\r
-using std::auto_ptr;\r
-\r
-\r
-CBcasCard::CBcasCard()\r
-       : m_hBcasCard(NULL)\r
-       , m_bIsEstablish(false)\r
-       , m_dwLastError(BCEC_NOERROR)\r
-{\r
-       // \93à\95\94\8fó\91Ô\8f\89\8aú\89»\r
-       memset(&m_BcasCardInfo, 0, sizeof(m_BcasCardInfo));\r
-       memset(&m_EcmStatus,    0, sizeof(m_EcmStatus));\r
-\r
-       // \83\8a\83\\81[\83X\83}\83l\81[\83W\83\83\83R\83\93\83e\83L\83X\83g\8am\97§\r
-       if(::SCardEstablishContext(SCARD_SCOPE_USER, NULL, NULL, &m_ScardContext) != SCARD_S_SUCCESS){\r
-               m_dwLastError = BCEC_NOTESTABLISHED;\r
-               }\r
-       else{\r
-               m_bIsEstablish = true;\r
-               \r
-               // \83J\81[\83h\83\8a\81[\83_\97ñ\8b\93\r
-               EnumCardReader();\r
-               }\r
-}\r
-\r
-CBcasCard::~CBcasCard()\r
-{\r
-       CloseCard();\r
-\r
-       // \83\8a\83\\81[\83X\83}\83l\81[\83W\83\83\83R\83\93\83e\83L\83X\83g\82Ì\8aJ\95ú\r
-       if(m_bIsEstablish)::SCardReleaseContext(m_ScardContext);\r
-}\r
-\r
-const DWORD CBcasCard::GetCardReaderNum(void) const\r
-{\r
-       // \83J\81[\83h\83\8a\81[\83_\81[\90\94\82ð\95Ô\82·\r
-       return m_CardReaderArray.size();\r
-}\r
-\r
-LPCTSTR CBcasCard::GetCardReaderName(const DWORD dwIndex) const\r
-{\r
-       // \83J\81[\83h\83\8a\81[\83_\81[\96¼\82ð\95Ô\82·\r
-       return (dwIndex < GetCardReaderNum())? m_CardReaderArray[dwIndex].c_str() : NULL;\r
-}\r
-\r
-const bool CBcasCard::OpenCard(LPCTSTR lpszReader)\r
-{\r
-       // \83\8a\83\\81[\83X\83}\83l\81[\83W\83\83\83R\83\93\83e\83L\83X\83g\82Ì\8am\97§\r
-       if(!m_bIsEstablish){\r
-               m_dwLastError = BCEC_NOTESTABLISHED;\r
-               return false;\r
-               }\r
-       \r
-       // \88ê\92U\83N\83\8d\81[\83Y\82·\82é\r
-       CloseCard();\r
-\r
-\r
-       if(lpszReader){\r
-               // \8ew\92è\82³\82ê\82½\83J\81[\83h\83\8a\81[\83_\82É\91Î\82µ\82Ä\83I\81[\83v\83\93\82ð\8e\8e\82Ý\82é\r
-               DWORD dwActiveProtocol = SCARD_PROTOCOL_UNDEFINED;\r
-               \r
-               if(::SCardConnect(m_ScardContext, lpszReader, SCARD_SHARE_SHARED, SCARD_PROTOCOL_T1, &m_hBcasCard, &dwActiveProtocol) != SCARD_S_SUCCESS){\r
-                       m_dwLastError = BCEC_CARDOPENERROR;\r
-                       return false;\r
-                       }\r
-\r
-               if(dwActiveProtocol != SCARD_PROTOCOL_T1){\r
-                       CloseCard();\r
-                       m_dwLastError = BCEC_CARDOPENERROR;\r
-                       return false;\r
-                       }\r
-               }\r
-       else{\r
-               // \91S\82Ä\82Ì\83J\81[\83h\83\8a\81[\83_\82É\91Î\82µ\82Ä\83I\81[\83v\83\93\82ð\8e\8e\82Ý\82é\r
-               DWORD dwIndex = 0UL;\r
-       \r
-               while(GetCardReaderName(dwIndex)){\r
-                       if(OpenCard(GetCardReaderName(dwIndex++)))return true;                  \r
-                       }\r
-               \r
-               return false;\r
-               }\r
-\r
-       // \83J\81[\83h\8f\89\8aú\89»\r
-       if(!InitialSetting())return false;\r
-\r
-       m_dwLastError = BCEC_NOERROR;\r
-\r
-       return true;\r
-}\r
-\r
-void CBcasCard::CloseCard(void)\r
-{\r
-       // \83J\81[\83h\82ð\83N\83\8d\81[\83Y\82·\82é\r
-       if(m_hBcasCard){\r
-               ::SCardDisconnect(m_hBcasCard, SCARD_LEAVE_CARD);\r
-               m_hBcasCard = NULL;\r
-               }\r
-}\r
-\r
-const DWORD CBcasCard::GetLastError(void) const\r
-{\r
-       // \8dÅ\8cã\82É\94­\90\82µ\82½\83G\83\89\81[\82ð\95Ô\82·\r
-       return m_dwLastError;\r
-}\r
-\r
-const bool CBcasCard::EnumCardReader(void)\r
-{\r
-       // \83J\81[\83h\83\8a\81[\83_\82ð\97ñ\8b\93\82·\82é\r
-       DWORD dwBuffSize = 0UL;\r
-       \r
-       switch(::SCardListReaders(m_ScardContext, NULL, NULL, &dwBuffSize)){\r
-               case SCARD_E_NO_READERS_AVAILABLE :\r
-                       // \83J\81[\83h\83\8a\81[\83_\82ª\8c©\82Â\82©\82ç\82È\82¢\r
-                       m_dwLastError = BCEC_NOCARDREADERS;\r
-                       return false;\r
-\r
-               case SCARD_S_SUCCESS :\r
-                       // \83o\83b\83t\83@\83T\83C\83Y\8eæ\93¾\90¬\8c÷\r
-                       break;\r
-               \r
-               default:\r
-                       // \83G\83\89\81[\r
-                       m_dwLastError = BCEC_INTERNALERROR;             \r
-                       return false;\r
-               }\r
-\r
-       // \83o\83b\83t\83@\8am\95Û\r
-       auto_ptr<TCHAR> szReaders(new TCHAR[dwBuffSize]);\r
-\r
-       switch(::SCardListReaders(m_ScardContext, NULL, szReaders.get(), &dwBuffSize)){\r
-               case SCARD_E_NO_READERS_AVAILABLE :\r
-                       // \83J\81[\83h\83\8a\81[\83_\82ª\8c©\82Â\82©\82ç\82È\82¢\r
-                       m_dwLastError = BCEC_NOCARDREADERS;\r
-                       return false;\r
-\r
-               case SCARD_S_SUCCESS : {\r
-                       // \83J\81[\83h\83\8a\81[\83_\96¼\95Û\91\r
-                       LPTSTR lpszCurReader = szReaders.get();\r
-                       m_CardReaderArray.clear();\r
-                       \r
-                       while(*lpszCurReader){\r
-                               m_CardReaderArray.push_back(lpszCurReader);\r
-                               lpszCurReader += m_CardReaderArray.back().length() + 1UL;\r
-                               }\r
-                       \r
-                       break;\r
-                       }\r
-               \r
-               default:\r
-                       // \83G\83\89\81[\r
-                       m_dwLastError = BCEC_INTERNALERROR;             \r
-                       return false;\r
-               }\r
-\r
-       m_dwLastError = BCEC_NOERROR;\r
-\r
-       return true;\r
-}\r
-\r
-const bool CBcasCard::TransmitCommand(const BYTE *pSendData, const DWORD dwSendSize, BYTE *pRecvData, const DWORD dwMaxRecv, DWORD *pdwRecvSize)\r
-{\r
-       DWORD dwRecvSize = dwMaxRecv;\r
-\r
-       // \83f\81[\83^\91\97\8eó\90M\r
-       DWORD dwReturn = ::SCardTransmit(m_hBcasCard, SCARD_PCI_T1, pSendData, dwSendSize, NULL, pRecvData, &dwRecvSize);\r
-       \r
-       // \8eó\90M\83T\83C\83Y\8ai\94[\r
-       if(pdwRecvSize)*pdwRecvSize = dwRecvSize;\r
-\r
-       return (dwReturn == SCARD_S_SUCCESS)? true : false;\r
-}\r
-\r
-const bool CBcasCard::InitialSetting(void)\r
-{\r
-       static const BYTE InitSettingCmd[] = {0x90U, 0x30U, 0x00U, 0x00U, 0x00U};\r
-\r
-       // \81uInitial Setting Conditions Command\81v\82ð\8f\88\97\9d\82·\82é\r
-       if(!m_hBcasCard){\r
-               m_dwLastError = BCEC_CARDNOTOPEN;\r
-               return false;\r
-               }\r
-\r
-       // \83o\83b\83t\83@\8f\80\94õ\r
-       DWORD dwRecvSize = 0UL;\r
-       BYTE RecvData[1024];\r
-       memset(RecvData, 0, sizeof(RecvData));\r
-       \r
-       // \83R\83}\83\93\83h\91\97\90M\r
-       if(!TransmitCommand(InitSettingCmd, sizeof(InitSettingCmd), RecvData, sizeof(RecvData), &dwRecvSize)){\r
-               m_dwLastError = BCEC_TRANSMITERROR;\r
-               return false;\r
-               }\r
-\r
-       if(dwRecvSize < 57UL){\r
-               m_dwLastError = BCEC_TRANSMITERROR;\r
-               return false;           \r
-               }\r
-\r
-       // \83\8c\83X\83|\83\93\83X\89ð\90Í\r
-       memcpy(m_BcasCardInfo.BcasCardID, &RecvData[8], 6UL);           // +8   Card ID\r
-       memcpy(m_BcasCardInfo.SystemKey, &RecvData[16], 32UL);  // +16  Descrambling system key\r
-       memcpy(m_BcasCardInfo.InitialCbc, &RecvData[48], 8UL);  // +48  Descrambler CBC initial value\r
-\r
-       // ECM\83X\83e\81[\83^\83X\8f\89\8aú\89»\r
-       memset(&m_EcmStatus, 0, sizeof(m_EcmStatus));\r
-\r
-       return true;\r
-}\r
-\r
-const BYTE * CBcasCard::GetBcasCardID(void)\r
-{\r
-       // Card ID \82ð\95Ô\82·\r
-       if(!m_hBcasCard){\r
-               m_dwLastError = BCEC_CARDNOTOPEN;\r
-               return NULL;\r
-               }\r
-       \r
-       m_dwLastError = BCEC_NOERROR;\r
-       \r
-       return m_BcasCardInfo.BcasCardID;\r
-}\r
-\r
-const BYTE * CBcasCard::GetInitialCbc(void)\r
-{\r
-       // Descrambler CBC Initial Value \82ð\95Ô\82·\r
-       if(!m_hBcasCard){\r
-               m_dwLastError = BCEC_CARDNOTOPEN;\r
-               return NULL;\r
-               }\r
-       \r
-       m_dwLastError = BCEC_NOERROR;\r
-       \r
-       return m_BcasCardInfo.InitialCbc;\r
-}\r
-\r
-const BYTE * CBcasCard::GetSystemKey(void)\r
-{\r
-       // Descrambling System Key \82ð\95Ô\82·\r
-       if(!m_hBcasCard){\r
-               m_dwLastError = BCEC_CARDNOTOPEN;\r
-               return NULL;\r
-               }\r
-       \r
-       m_dwLastError = BCEC_NOERROR;\r
-       \r
-       return m_BcasCardInfo.SystemKey;\r
-}\r
-\r
-const BYTE * CBcasCard::GetKsFromEcm(const BYTE *pEcmData, const DWORD dwEcmSize)\r
-{\r
-       static const BYTE EcmReceiveCmd[] = {0x90U, 0x34U, 0x00U, 0x00U};\r
-\r
-       // \81uECM Receive Command\81v\82ð\8f\88\97\9d\82·\82é\r
-       if(!m_hBcasCard){\r
-               m_dwLastError = BCEC_CARDNOTOPEN;\r
-               return NULL;\r
-               }\r
-\r
-       // ECM\83T\83C\83Y\82ð\83`\83F\83b\83N\r
-       if(!pEcmData || (dwEcmSize < 30UL) || (dwEcmSize > 256UL)){\r
-               m_dwLastError = BCEC_BADARGUMENT;\r
-               return NULL;\r
-               }\r
-\r
-       // \83L\83\83\83b\83V\83\85\82ð\83`\83F\83b\83N\82·\82é\r
-       if(!StoreEcmData(pEcmData, dwEcmSize)){\r
-               // ECM\82ª\93¯\88ê\82Ì\8fê\8d\87\82Í\83L\83\83\83b\83V\83\85\8dÏ\82ÝKs\82ð\95Ô\82·\r
-               m_dwLastError = BCEC_NOERROR;\r
-               return m_EcmStatus.KsData;\r
-               }\r
-\r
-       // \83o\83b\83t\83@\8f\80\94õ\r
-       DWORD dwRecvSize = 0UL;\r
-       BYTE SendData[1024];\r
-       BYTE RecvData[1024];\r
-       memset(RecvData, 0, sizeof(RecvData));\r
-\r
-       // \83R\83}\83\93\83h\8d\\92z\r
-       memcpy(SendData, EcmReceiveCmd, sizeof(EcmReceiveCmd));                         // CLA, INS, P1, P2\r
-       SendData[sizeof(EcmReceiveCmd)] = (BYTE)dwEcmSize;                                                      // COMMAND DATA LENGTH\r
-       memcpy(&SendData[sizeof(EcmReceiveCmd) + 1], pEcmData, dwEcmSize);      // ECM\r
-       SendData[sizeof(EcmReceiveCmd) + dwEcmSize + 1] = 0x00U;                                        // RESPONSE DATA LENGTH\r
-\r
-       // \83R\83}\83\93\83h\91\97\90M\r
-       if(!TransmitCommand(SendData, sizeof(EcmReceiveCmd) + dwEcmSize + 2UL, RecvData, sizeof(RecvData), &dwRecvSize)){\r
-               memset(&m_EcmStatus, 0, sizeof(m_EcmStatus));\r
-               m_dwLastError = BCEC_TRANSMITERROR;\r
-               return NULL;\r
-               }\r
-\r
-       // \83T\83C\83Y\83`\83F\83b\83N\r
-       if(dwRecvSize != 25UL){\r
-               memset(&m_EcmStatus, 0, sizeof(m_EcmStatus));\r
-               m_dwLastError = BCEC_TRANSMITERROR;\r
-               return NULL;\r
-               }       \r
-       \r
-       // \83\8c\83X\83|\83\93\83X\89ð\90Í\r
-       memcpy(m_EcmStatus.KsData, &RecvData[6], sizeof(m_EcmStatus.KsData));\r
-\r
-       // \83\8a\83^\81[\83\93\83R\81[\83h\89ð\90Í\r
-       switch(((WORD)RecvData[4] << 8) | (WORD)RecvData[5]){\r
-               // Purchased: Viewing\r
-               case 0x0200U :  // Payment-deferred PPV\r
-               case 0x0400U :  // Prepaid PPV\r
-               case 0x0800U :  // Tier\r
-                       m_dwLastError = BCEC_NOERROR;\r
-                       return m_EcmStatus.KsData;\r
-               \r
-               // \8fã\8bL\88È\8aO(\8e\8b\92®\95s\89Â)\r
-               default :\r
-                       m_dwLastError = BCEC_ECMREFUSED;\r
-                       return NULL;\r
-               }\r
-}\r
-\r
-const bool CBcasCard::StoreEcmData(const BYTE *pEcmData, const DWORD dwEcmSize)\r
-{\r
-       bool bUpdate = false;\r
-       \r
-       // ECM\83f\81[\83^\94ä\8ar\r
-       if(m_EcmStatus.dwLastEcmSize != dwEcmSize){\r
-               // \83T\83C\83Y\82ª\95Ï\89»\82µ\82½\r
-               bUpdate = true;\r
-               }\r
-       else{\r
-               // \83T\83C\83Y\82ª\93¯\82\8fê\8d\87\82Í\83f\81[\83^\82ð\83`\83F\83b\83N\82·\82é\r
-               for(DWORD dwPos = 0UL ; dwPos < dwEcmSize ; dwPos++){\r
-                       if(pEcmData[dwPos] != m_EcmStatus.LastEcmData[dwPos]){\r
-                               // \83f\81[\83^\82ª\95s\88ê\92v\r
-                               bUpdate = true;\r
-                               break;\r
-                               }                       \r
-                       }\r
-               }\r
-\r
-       // ECM\83f\81[\83^\82ð\95Û\91\82·\82é\r
-       if(bUpdate){\r
-               m_EcmStatus.dwLastEcmSize = dwEcmSize;\r
-               memcpy(m_EcmStatus.LastEcmData, pEcmData, dwEcmSize);\r
-               }\r
-\r
-       return bUpdate;\r
-}\r
diff --git a/dist/trunk/b25-remote/BCasCard.h b/dist/trunk/b25-remote/BCasCard.h
deleted file mode 100755 (executable)
index e793203..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-// BcasCard.h: CBcasCard \83N\83\89\83X\82Ì\83C\83\93\83^\81[\83t\83F\83C\83X\r
-//\r
-//////////////////////////////////////////////////////////////////////\r
-\r
-#pragma once\r
-\r
-
-#include <memory>\r
-#include <vector>\r
-#include <string>\r
-#include <winscard.h>\r
-\r
-\r
-using std::vector;\r
-using std::wstring;\r
-using std::string;\r
-\r
-\r
-// \83G\83\89\81[\83R\81[\83h\r
-#define BCEC_NOERROR                   0x00000000UL    // \83G\83\89\81[\82È\82µ\r
-#define BCEC_INTERNALERROR             0x00000001UL    // \93à\95\94\83G\83\89\81[\r
-#define BCEC_NOTESTABLISHED            0x00000002UL    // \83R\83\93\83e\83L\83X\83g\8am\97§\8e¸\94s\r
-#define BCEC_NOCARDREADERS             0x00000003UL    // \83J\81[\83h\83\8a\81[\83_\82ª\82È\82¢\r
-#define BCEC_ALREADYOPEN               0x00000004UL    // \8aù\82É\83I\81[\83v\83\93\8dÏ\82Ý\r
-#define BCEC_CARDOPENERROR             0x00000005UL    // \83J\81[\83h\83I\81[\83v\83\93\8e¸\94s\r
-#define BCEC_CARDNOTOPEN               0x00000006UL    // \83J\81[\83h\96¢\83I\81[\83v\83\93\r
-#define BCEC_TRANSMITERROR             0x00000007UL    // \92Ê\90M\83G\83\89\81[\r
-#define BCEC_BADARGUMENT               0x00000008UL    // \88ø\90\94\82ª\95s\90³\r
-#define BCEC_ECMREFUSED                        0x00000009UL    // ECM\8eó\95t\8b\91\94Û\r
-\r
-\r
-class CBcasCard\r
-{\r
-public:\r
-       CBcasCard();\r
-       ~CBcasCard();\r
-\r
-       const DWORD GetCardReaderNum(void) const;\r
-       LPCTSTR GetCardReaderName(const DWORD dwIndex = 0UL) const;\r
-\r
-       const bool OpenCard(LPCTSTR lpszReader = NULL);\r
-       void CloseCard(void);\r
-\r
-       const BYTE * GetBcasCardID(void);\r
-       const BYTE * GetInitialCbc(void);\r
-       const BYTE * GetSystemKey(void);\r
-       const BYTE * GetKsFromEcm(const BYTE *pEcmData, const DWORD dwEcmSize);\r
-\r
-       const DWORD GetLastError(void) const;\r
-\r
-protected:\r
-       const bool EnumCardReader(void);\r
-       const bool TransmitCommand(const BYTE *pSendData, const DWORD dwSendSize, BYTE *pRecvData, const DWORD dwMaxRecv, DWORD *pdwRecvSize = NULL);\r
-       const bool InitialSetting(void);\r
-\r
-       SCARDCONTEXT m_ScardContext;\r
-       SCARDHANDLE m_hBcasCard;\r
-\r
-       bool m_bIsEstablish;\r
-\r
-#ifdef _UNICODE        \r
-       vector<wstring> m_CardReaderArray;\r
-#else\r
-       vector<string> m_CardReaderArray;\r
-#endif\r
-\r
-       struct TAG_BCASCARDINFO\r
-       {\r
-               BYTE BcasCardID[6];             // Card ID\r
-               BYTE SystemKey[32];             // Descrambling system key\r
-               BYTE InitialCbc[8];             // Descrambler CBC initial value\r
-       } m_BcasCardInfo;\r
-       \r
-       struct TAG_ECMSTATUS\r
-       {\r
-               DWORD dwLastEcmSize;    // \8dÅ\8cã\82É\96â\82¢\8d\87\82í\82¹\82Ì\82 \82Á\82½ECM\83T\83C\83Y\r
-               BYTE LastEcmData[256];  // \8dÅ\8cã\82É\96â\82¢\8d\87\82í\82¹\82Ì\82 \82Á\82½ECM\83f\81[\83^\r
-               BYTE KsData[16];                // Ks Odd + Even        \r
-       } m_EcmStatus;\r
-       \r
-       DWORD m_dwLastError;\r
-\r
-private:\r
-       const bool StoreEcmData(const BYTE *pEcmData, const DWORD dwEcmSize);\r
-};\r
diff --git a/dist/trunk/b25-remote/CasClient.cpp b/dist/trunk/b25-remote/CasClient.cpp
deleted file mode 100755 (executable)
index 4b6c6fb..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-// CasClient.cpp: CCasClient \83N\83\89\83X\82Ì\83C\83\93\83v\83\8a\83\81\83\93\83e\81[\83V\83\87\83\93\r
-//\r
-//////////////////////////////////////////////////////////////////////\r
-\r
-#include <stdio.h>\r
-#include "W2L.h"\r
-#include "CasClient.h"
-\r
-\r
-#define TCP_TIMEOUT            1000UL          // 1\95b\r
-\r
-\r
-CCasClient::CCasClient(ICasClientHandler *pEventHandler, CSmartSock *pSocket)\r
-       : CBcasCard()\r
-       , m_pSocket(pSocket)\r
-       , m_pEventHandler(pEventHandler)\r
-       , m_hClientThread(NULL)\r
-{\r
-       // \83N\83\89\83C\83A\83\93\83g\83X\83\8c\83b\83h\8bN\93®\r
-       pthread_create(&m_hClientThread, NULL, CCasClient::ClientThreadRaw, (LPVOID)this);\r
-       if(!m_hClientThread){\r
-               printf("ClientThread failed\n");
-               delete this;\r
-       }\r
-       printf("ClientThread started\n");
-}\r
-\r
-CCasClient::~CCasClient(void)\r
-{\r
-       delete m_pSocket;\r
-       if (m_hClientThread) pthread_join(m_hClientThread, NULL);\r
-}\r
-\r
-void CCasClient::CloseClient(void)\r
-{\r
-       // \83N\83\89\83C\83A\83\93\83g\82ð\90Ø\92f\82·\82é\r
-       m_pSocket->Close();\r
-}\r
-\r
-void CCasClient::ClientThread(void)\r
-{\r
-       // \83J\81[\83h\83\8a\81[\83_\82ð\8aJ\82­\r
-       if(!OpenCard())return;\r
-       \r
-       // \8eó\90M\83o\83b\83t\83@\r
-       BYTE byDataLen;\r
-       BYTE RecvBuf[256];\r
-       DWORD dwRecvSize;\r
-       \r
-       // \83\81\83b\83Z\81[\83W\8eó\90M\83\8b\81[\83v\r
-       while(1){\r
-               // \83w\83b\83_\82ð\8eó\90M\r
-               if(!m_pSocket->Recv(&byDataLen, 1UL, TCP_TIMEOUT)){\r
-                       if(m_pSocket->GetLastError() == CSmartSock::EC_TIMEOUT)continue;\r
-                       else break;\r
-               }
-\r
-               // \83f\81[\83^\82ð\8eó\90M\r
-               if(!m_pSocket->Recv(RecvBuf, byDataLen, TCP_TIMEOUT))break;
-       \r
-               // \83J\81[\83h\91\97\8eó\90M\r
-               if(!TransmitCommand(RecvBuf, byDataLen, &RecvBuf[1], sizeof(RecvBuf) - 1UL, &dwRecvSize))dwRecvSize = 0UL;
-\r
-               // \83f\81[\83^\82ð\91\97\90M\r
-               RecvBuf[0] = (BYTE)dwRecvSize;\r
-               if(!m_pSocket->Send(RecvBuf, dwRecvSize + 1UL, TCP_TIMEOUT))break;
-       }\r
-\r
-       printf("ClientThread exited\n");
-       // \83J\81[\83h\83\8a\81[\83_\82ð\95Â\82\82é\r
-       CloseCard();\r
-}\r
-\r
-void* CCasClient::ClientThreadRaw(LPVOID pParam)\r
-{\r
-       // \83N\83\89\83C\83A\83\93\83g\83X\83\8c\83b\83h\r
-       CCasClient *pThis = static_cast<CCasClient *>(pParam);\r
-\r
-       // \90Ú\91±\83C\83x\83\93\83g\92Ê\92m\r
-       pThis->SendEvent(EID_CONNECTED);
-\r
-       // \83\81\83\93\83o\8aÖ\90\94\82É\83\8a\83_\83C\83\8c\83N\83g\82·\82é\r
-       pThis->ClientThread();
-\r
-       // \90Ø\92f\83C\83x\83\93\83g\92Ê\92m\r
-       pThis->SendEvent(EID_DISCONNECTED);
-\r
-       delete pThis;
-\r
-       return 0UL;\r
-}\r
-\r
-void CCasClient::SendEvent(const DWORD dwEventID, PVOID pParam)\r
-{\r
-       // \83n\83\93\83h\83\89\82É\83C\83x\83\93\83g\82ð\92Ê\92m\82·\82é\r
-       if(m_pEventHandler)m_pEventHandler->OnCasClientEvent(this, dwEventID, pParam);\r
-}\r
diff --git a/dist/trunk/b25-remote/CasClient.h b/dist/trunk/b25-remote/CasClient.h
deleted file mode 100755 (executable)
index ecd1c56..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-// CasClient.h: CCasClient \83N\83\89\83X\82Ì\83C\83\93\83^\81[\83t\83F\83C\83X\r
-//\r
-//////////////////////////////////////////////////////////////////////\r
-\r
-#pragma once\r
-\r
-#include "W2L.h"\r
-#include "BCasCard.h"\r
-#include "SmartSock.h"\r
-\r
-\r
-class CCasClient : private CBcasCard\r
-{\r
-public:\r
-       class ICasClientHandler\r
-       {\r
-       public:\r
-               virtual void OnCasClientEvent(CCasClient *pClient, const DWORD dwEventID, PVOID pParam) = 0;\r
-       };\r
-\r
-       enum\r
-       {\r
-               EID_CONNECTED,          // \83N\83\89\83C\83A\83\93\83g\90Ú\91±\r
-               EID_DISCONNECTED        // \83N\83\89\83C\83A\83\93\83g\90Ø\92f\r
-       };\r
-\r
-       CCasClient(ICasClientHandler *pEventHandler, CSmartSock *pSocket);\r
-       ~CCasClient(void);\r
-\r
-       void CloseClient(void);\r
-\r
-protected:\r
-       void ClientThread(void);\r
-       static void* ClientThreadRaw(LPVOID pParam);\r
-\r
-       void SendEvent(const DWORD dwEventID, PVOID pParam = NULL);\r
-\r
-       CSmartSock *m_pSocket;\r
-       ICasClientHandler *m_pEventHandler;\r
-       pthread_t m_hClientThread;\r
-};\r
diff --git a/dist/trunk/b25-remote/CasProxy.cpp b/dist/trunk/b25-remote/CasProxy.cpp
deleted file mode 100755 (executable)
index dbf0330..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-// CasProxy.cpp: CCasProxy \83N\83\89\83X\82Ì\83C\83\93\83v\83\8a\83\81\83\93\83e\81[\83V\83\87\83\93\r
-//\r
-//////////////////////////////////////////////////////////////////////\r
-\r
-\r
-#include "CasProxy.h"\r
-#include <stdio.h>\r
-\r
-#define TCP_TIMEOUT    1000UL  // 1\95b\r
-\r
-\r
-DWORD CCasProxy::dwErrorDelayTime = 0UL;\r
-\r
-\r
-CCasProxy::CCasProxy(void)\r
-{\r
-\r
-}\r
-\r
-CCasProxy::~CCasProxy(void)\r
-{\r
-       // \83T\81[\83o\82©\82ç\90Ø\92f\r
-       m_Socket.Close();\r
-}\r
-\r
-const BOOL CCasProxy::Connect(void)\r
-{\r
-/*
-       // \83G\83\89\81[\94­\90\8e\9e\82Ì\83K\81[\83h\83C\83\93\83^\81[\83o\83\8b\r
-       if(dwErrorDelayTime){\r
-               if((::GetTickCount() - dwErrorDelayTime) < TCP_TIMEOUT)return FALSE;\r
-               else dwErrorDelayTime = 0UL;\r
-               }\r
-*/\r
-       // \83T\81[\83o\82É\90Ú\91±
-       char* env = getenv("B25_SERVER_IP");
-       LPCTSTR lpszHost;
-       WORD wPort;
-       if (env) {
-               lpszHost = env;
-       }
-       else {
-               lpszHost = "127.0.0.1";
-       }
-       env = getenv("B25_SERVER_PORT");
-       if (env) {
-               wPort = atoi(env);
-       }
-       else {
-               wPort = 6900;
-       }
-
-       if(m_Socket.Connect(lpszHost, wPort, TCP_TIMEOUT)){\r
-               return TRUE;\r
-       }\r
-       else{
-               //dwErrorDelayTime = ::GetTickCount();\r
-               return FALSE;\r
-       }\r
-}\r
-\r
-const DWORD CCasProxy::TransmitCommand(const BYTE *pSendData, const DWORD dwSendSize, BYTE *pRecvData)\r
-{\r
-       // \91\97\90M\83f\81[\83^\8f\80\94õ\r
-       BYTE SendBuf[256];\r
-       SendBuf[0] = (BYTE)dwSendSize;\r
-       memcpy(&SendBuf[1], pSendData, dwSendSize);\r
-\r
-       try{\r
-               // \83\8a\83N\83G\83X\83g\91\97\90M\r
-               if(!m_Socket.Send(SendBuf, dwSendSize + 1UL, TCP_TIMEOUT))throw (const DWORD)__LINE__;\r
-       \r
-               // \83\8c\83X\83|\83\93\83X\83w\83b\83_\8eó\90M\r
-               if(!m_Socket.Recv(SendBuf, 1UL, TCP_TIMEOUT))throw (const DWORD)__LINE__;\r
-\r
-               // \83\8c\83X\83|\83\93\83X\83f\81[\83^\8eó\90M\r
-               if(!m_Socket.Recv(pRecvData, SendBuf[0], TCP_TIMEOUT))throw (const DWORD)__LINE__;\r
-               }\r
-       catch(const DWORD dwLine){\r
-               // \92Ê\90M\83G\83\89\81[\94­\90\r
-               m_Socket.Close();\r
-               return 0UL;\r
-               }\r
-               \r
-       return SendBuf[0];\r
-}
-
diff --git a/dist/trunk/b25-remote/CasProxy.h b/dist/trunk/b25-remote/CasProxy.h
deleted file mode 100755 (executable)
index 2b0d6e4..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-// CasProxy.h: CCasProxy \83N\83\89\83X\82Ì\83C\83\93\83^\81[\83t\83F\83C\83X\r
-//\r
-//////////////////////////////////////////////////////////////////////\r
-\r
-\r
-#pragma once\r
-\r
-\r
-#include "SmartSock.h"\r
-#include <stdlib.h>\r
-\r
-class CCasProxy\r
-{\r
-public:\r
-       enum\r
-       {\r
-               CPEI_ENTERPROCESS,              // \83v\83\8d\83Z\83X\8aJ\8en\92Ê\92m\r
-               CPEI_EXITPROCESS,               // \83v\83\8d\83Z\83X\8fI\97¹\92Ê\92m\r
-               CPEI_GETSERVERIP,               // \83T\81[\83oIP\8eæ\93¾\r
-               CPEI_GETSERVERPORT,             // \83T\81[\83o\83|\81[\83g\8eæ\93¾\r
-               CPEI_CONNECTSUCCESS,    // \90Ú\91±\8a®\97¹\r
-               CPEI_CONNECTFAILED,             // \90Ú\91±\8e¸\94s\r
-               CPEI_DISCONNECTED               // \90Ú\91±\90Ø\92f\r
-       };\r
-       \r
-       CCasProxy(void);\r
-       ~CCasProxy(void);\r
-\r
-       const BOOL Connect(void);\r
-       const DWORD TransmitCommand(const BYTE *pSendData, const DWORD dwSendSize, BYTE *pRecvData);\r
-\r
-protected:\r
-       CSmartSock m_Socket;\r
-       \r
-       static DWORD dwErrorDelayTime;\r
-};\r
diff --git a/dist/trunk/b25-remote/CasServer.cpp b/dist/trunk/b25-remote/CasServer.cpp
deleted file mode 100755 (executable)
index 4c733b8..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-// CasServer.cpp: CCasServer \83N\83\89\83X\82Ì\83C\83\93\83v\83\8a\83\81\83\93\83e\81[\83V\83\87\83\93\r
-//\r
-//////////////////////////////////////////////////////////////////////\r
-\r
-\r
-#include "CasServer.h"\r
-#include "BCasCard.h"\r
-\r
-#define FALSE 0
-#define TRUE 1\r
-\r
-CCasServer::CCasServer(ICasServerHandler *pEventHandler)\r
-       : m_pEventHandler(pEventHandler)\r
-       , m_hServerThread(NULL)\r
-{\r
-\r
-}\r
-\r
-CCasServer::~CCasServer(void)\r
-{\r
-       CloseServer();\r
-}\r
-\r
-const BOOL CCasServer::OpenServer(const WORD wServerPort)\r
-{\r
-       // \83J\81[\83h\83\8a\81[\83_\91\8dÝ\83`\83F\83b\83N\r
-       CBcasCard BCasCard;\r
-       if(!BCasCard.OpenCard())return FALSE;\r
-\r
-       // \83T\81[\83o\83\\83P\83b\83g\83I\81[\83v\83\93\r
-       if(!m_pSocket.Listen(wServerPort))return FALSE;\r
-\r
-       // \83T\81[\83o\83X\83\8c\83b\83h\8bN\93®\r
-       pthread_create(&m_hServerThread, NULL, CCasServer::ServerThreadRaw, (LPVOID)this);\r
-       if(!m_hServerThread){\r
-               m_pSocket.Close();\r
-               return FALSE;\r
-       }\r
-\r
-       return TRUE;\r
-}\r
-\r
-void CCasServer::CloseServer(void)\r
-{\r
-       // \83T\81[\83o\83\\83P\83b\83g\83N\83\8d\81[\83Y\r
-       m_pSocket.Close();\r
-\r
-       // \83X\83\8c\83b\83h\83n\83\93\83h\83\8b\8aJ\95ú\r
-       if(m_hServerThread){\r
-               pthread_join(m_hServerThread, NULL);\r
-               m_hServerThread = NULL;\r
-       }\r
-\r
-       // \91S\83N\83\89\83C\83A\83\93\83g\90Ø\92f\r
-       m_Lock.Lock();\r
-       \r
-       for(ClientList::iterator It = m_ClientList.begin() ; It != m_ClientList.end() ; It++){\r
-               It->first->CloseClient();\r
-               }\r
-\r
-       m_Lock.Unlock();\r
-       \r
-       // \91S\83N\83\89\83C\83A\83\93\83g\82Ì\8fI\97¹\82ð\91Ò\82Â\r
-       while(m_ClientList.size()) sleep(1UL);\r
-}\r
-\r
-const DWORD CCasServer::GetClientNum(void) const\r
-{\r
-       // \90Ú\91±\92\86\82Ì\83N\83\89\83C\83A\83\93\83g\90\94\82ð\95Ô\82·\r
-       return m_ClientList.size();\r
-}\r
-\r
-void CCasServer::OnCasClientEvent(CCasClient *pClient, const DWORD dwEventID, PVOID pParam)\r
-{\r
-       CBlockLock AutoLock(&m_Lock);\r
-\r
-       // \83N\83\89\83C\83A\83\93\83g\83C\83x\83\93\83g\r
-       switch(dwEventID){\r
-               case CCasClient::EID_CONNECTED :\r
-                       // \83\8a\83X\83g\82É\92Ç\89Á\r
-                       m_ClientList[pClient] = pClient;\r
-                       if (m_pEventHandler) m_pEventHandler->OnCasServerEvent(this, CSEI_CONNECTED);\r
-                       break;\r
-                       \r
-               case CCasClient::EID_DISCONNECTED :\r
-                       // \83\8a\83X\83g\82©\82ç\8dí\8f\9c\r
-                       m_ClientList.erase(pClient);\r
-                       if (m_pEventHandler) m_pEventHandler->OnCasServerEvent(this, CSEI_DISCONNECTED);\r
-                       break;\r
-               }\r
-}\r
-\r
-void CCasServer::ServerThread(void)\r
-{\r
-       // \83A\83N\83Z\83v\83g\83\8b\81[\83v\r
-       CSmartSock *pNewSocket;\r
-       \r
-       while(pNewSocket = m_pSocket.Accept()){\r
-               // \83N\83\89\83C\83A\83\93\83g\83C\83\93\83X\83^\83\93\83X\90\90¬\r
-               new CCasClient(this, pNewSocket);\r
-               }\r
-}\r
-\r
-void* CCasServer::ServerThreadRaw(LPVOID pParam)\r
-{\r
-       // \83T\81[\83o\83X\83\8c\83b\83h\r
-       static_cast<CCasServer *>(pParam)->ServerThread();\r
-\r
-       return 0UL;\r
-}\r
diff --git a/dist/trunk/b25-remote/CasServer.h b/dist/trunk/b25-remote/CasServer.h
deleted file mode 100755 (executable)
index 35d7732..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-// CasServer.h: CCasServer \83N\83\89\83X\82Ì\83C\83\93\83^\81[\83t\83F\83C\83X\r
-//\r
-//////////////////////////////////////////////////////////////////////\r
-\r
-#pragma once\r
-\r
-\r
-#include <map>\r
-#include "CasClient.h"\r
-#include "TsUtilClass.h"\r
-#include "SmartSock.h"\r
-\r
-\r
-using std::map;\r
-\r
-\r
-class CCasServer : protected CCasClient::ICasClientHandler\r
-{\r
-public:\r
-       class ICasServerHandler\r
-       {\r
-       public:\r
-               virtual void OnCasServerEvent(CCasServer *pCasServer, const WORD wEventID) = 0;\r
-       };\r
-\r
-       enum\r
-       {\r
-               CSEI_CONNECTED,         // \83N\83\89\83C\83A\83\93\83g\90Ú\91±\r
-               CSEI_DISCONNECTED,      // \83N\83\89\83C\83A\83\93\83g\90Ø\92f\r
-       };\r
-\r
-       CCasServer(void);\r
-       CCasServer(ICasServerHandler *pEventHandler);\r
-       ~CCasServer(void);\r
-\r
-       const BOOL OpenServer(const WORD wServerPort);\r
-       void CloseServer(void);\r
-       \r
-       const DWORD GetClientNum(void) const;\r
-\r
-protected:\r
-       virtual void OnCasClientEvent(CCasClient *pClient, const DWORD dwEventID, PVOID pParam);\r
-\r
-       void ServerThread(void);\r
-       static void* ServerThreadRaw(LPVOID pParam);\r
-\r
-       ICasServerHandler *m_pEventHandler;\r
-\r
-       CSmartSock m_pSocket;\r
-       pthread_t m_hServerThread;
-\r
-       typedef map<CCasClient *, CCasClient *> ClientList;\r
-       ClientList m_ClientList;\r
-       \r
-       CCriticalLock m_Lock;\r
-};\r
diff --git a/dist/trunk/b25-remote/Makefile b/dist/trunk/b25-remote/Makefile
deleted file mode 100755 (executable)
index ed4d823..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-PREFIX                 = /usr/local
-TARGET_SERVER          = b25-server
-TARGET_CLIENT          = b25-client.so
-OBJ_SERVER             = BCasCard.o CasClient.o CasServer.o SmartSock.o TsUtilClass.o b25-server.o
-HEADER_SERVER          = BCasCard.h CasClient.h CasServer.h SmartSock.h TsUtilClass.h
-OBJ_CLIENT             = CasProxy.o SmartSock.o b25-client.o
-HEADER_CLIENT          = CasProxy.h SmartSock.h
-PCSC_CFLAGS            = `pkg-config libpcsclite --cflags`
-PCSC_LDLIBS            = `pkg-config libpcsclite --libs`
-
-CC                     = g++
-CFLAGS                 = -fPIC -O2 -Wall -g ${PCSC_CFLAGS}
-CFLAGS_FOR_LIB = -fPIC -shared
-LDFLAGS                = -pthread ${PCSC_LDLIBS}
-LIBS                   = 
-
-.cpp.o:
-                       ${CC} $(CFLAGS) -c $<
-
-.c.o:
-                       ${CC} $(CFLAGS) -c $<
-
-all:                   ${TARGET_SERVER} ${TARGET_CLIENT}
-
-${TARGET_SERVER}:      ${OBJ_SERVER}
-                       ${CC} ${CFLAGS} ${OBJ_SERVER} -o $@ ${LDFLAGS} ${LIBS}
-
-${TARGET_CLIENT}:      ${OBJ_CLIENT}
-                       ${CC} ${CFLAGS_FOR_LIB} ${OBJ_CLIENT} -o $@ ${LDFLAGS} ${LIBS}
-
-${OBJ_SERVER}: ${HEADER_SERVER}
-
-${OBJ_CLIENT}: ${HEADER_CLIENT}
-
-install:               ${TARGET_SERVER} ${TARGET_CLIENT}
-                       install -m755 ${TARGET_SERVER} ${PREFIX}/bin
-                       install -m755 ${TARGET_CLIENT} ${PREFIX}/lib
-
-uninstall:
-                       rm ${PREFIX}/bin/${TARGET_SERVER}
-                       rm ${PREFIX}/lib/${TARGET_CLIENT}
-
-clean:
-                       rm -f core ${TARGET_SERVER} *.o *.so
-
diff --git a/dist/trunk/b25-remote/Readme.txt b/dist/trunk/b25-remote/Readme.txt
deleted file mode 100755 (executable)
index 0f591d0..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-
-- b25-remote Ver.0.0.1 -
-
-
-1.概要
-  ・スマートカードリーダをLANを経由で共有するためのシステムです。
-  ・BonCasLink互換プロトコルを使用します。
-
- 
-2.注意事項
-  ・一般的にスマートカードには個人を特定可能な情報が含まれている可能性があります。
-  ・本ソフトウェアは通信の暗号化を行わないためこのリスクを十分に考えた上でご使用ください。
-  ・本ソフトウェアの警告を無視しLAN以外のネットワークにおいて使用した結果発生したいかなる
-   損害も作者に責任を求めないこととします。
-
-
-3.ライセンスについて
-  ・本パッケージに含まれる全てのソースコード、バイナリについて著作権は一切主張しません。
-  ・オリジナルのまま又は改変し、各自のソフトウェアに自由に添付、組み込むことができます。
-  ・但しGPLに従うことを要求しますのでこれらを行う場合はソースコードの開示が必須となります。
-  ・このとき本ソフトウェアの著作権表示を行うかどうかは任意です。
-
-  ・通信プロトコルの変更及び追加を含むソースコードの改変は一切許可できません。
-  ・上記を禁止するいかなる根拠または拘束力も作者にはありませんがこれに反して、
-   作成した改変物を配布する場合は下記を要求します。
-  ・ソフトウェアの名称を「b25-remote」以外に変更すること。
-  ・「Rec10」の著作権表示を一切行わないこと。
-  ・ソースコードの流用元の表示を一切行わないこと。
-  ・このソースコードは拡張ツール中の人(nakanohito@2sen.dip.jp)が作成されたBonCasLink(公式サイト:http://2sen.dip.jp/friio/)のソースコードを流用しています。
-
-  ・ビルドに必要な環境
-   - pcsc-lite-devel ※Fedora系
-   - libpcsclite-dev ※Debian系
-
-
-4.使用方法
-  ①スマートカードリーダが接続されたPCで「b25-server」を起動します。
-
-  ②LANに参加している他のPCでPCSCを利用するアプリケーションを起動します。
-
-  ③このとき環境変数を以下のように設定します。
-   LD_PRELOAD      = {b25-client.soの絶対パス}
-   B25_REMOTE_IP   = {サーバーのアドレス(DNS可)}
-   B25_REMOTE_PORT = {サーバーの使用ポート(デフォルト:6900)}
-
-   ※ファイヤウォールやフィルタリングを使用している場合は共有に使用するポートを開放してください。
-
-
-6.サポート、連絡先
-   連絡先  : Rec10
-   公式サイト: http://sourceforge.jp/projects/rec10/
-
-
-8.更新履歴
- Ver.0.0.1 ・初回リリース
-
diff --git a/dist/trunk/b25-remote/SmartSock.cpp b/dist/trunk/b25-remote/SmartSock.cpp
deleted file mode 100755 (executable)
index cbf802c..0000000
+++ /dev/null
@@ -1,572 +0,0 @@
-// SmartSock.cpp: CSmartSock \83N\83\89\83X\82Ì\83C\83\93\83v\83\8a\83\81\83\93\83e\81[\83V\83\87\83\93\r
-//\r
-//////////////////////////////////////////////////////////////////////\r
-\r
-#include "SmartSock.h"\r
-#include <stdio.h>
-#include <sys/time.h>\r
-\r
-#ifdef _DEBUG\r
-#define new DEBUG_NEW\r
-#endif\r
-
-//#pragma warning(disable: 4101) // warning C4101: "\83\8d\81[\83J\83\8b\95Ï\90\94\82Í 1 \93x\82à\8eg\82í\82ê\82Ä\82¢\82Ü\82¹\82ñ\81B"\r
-//#pragma warning(disable: 4996) // warning C4996: "This function or variable may be unsafe. Consider using _wsplitpath_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details"\r
-\r
-\r
-//#pragma comment(lib, "WS2_32")\r
-\r
-\r
-//////////////////////////////////////////////////////////////////////\r
-// \83}\83N\83\8d\92è\8b`\r
-//////////////////////////////////////////////////////////////////////\r
-\r
-#define CHECK_FREESOCK(R)      if(m_Socket != INVALID_SOCKET){m_dwLastError = EC_SOCKINVALID; return (R);}\r
-#define CHECK_TCPSOCK(R)       if((m_Socket == INVALID_SOCKET) || (m_bSockType != SOCKTYPE_TCP)){m_dwLastError = EC_SOCKINVALID; return (R);}\r
-#define CHECK_UDPSOCK(R)       if((m_Socket == INVALID_SOCKET) || (m_bSockType != SOCKTYPE_UDP)){m_dwLastError = EC_SOCKINVALID; return (R);}\r
-\r
-\r
-//////////////////////////////////////////////////////////////////////\r
-// \8d\\92z/\8fÁ\96Å\r
-//////////////////////////////////////////////////////////////////////\r
-\r
-DWORD CSmartSock::dwInstanceNum = 0UL;\r
-\r
-CSmartSock::CSmartSock()\r
-       : m_Socket(INVALID_SOCKET)\r
-       , m_bSockType(SOCKTYPE_NON)\r
-       , m_dwLastError(EC_NOERROR)\r
-{\r
-       // WinSock2\8f\89\8aú\89»\r
-       if(!(dwInstanceNum++))InitWinSock2();\r
-}\r
-\r
-CSmartSock::~CSmartSock()\r
-{\r
-       Close();\r
-\r
-       // WinSock2\8aJ\95ú\r
-       if(!(--dwInstanceNum))FreeWinSock2();\r
-}\r
-\r
-const BOOL CSmartSock::Connect(LPCTSTR lpszHost, const WORD wPort, const DWORD dwTimeOut)\r
-{\r
-       CHECK_FREESOCK(FALSE);\r
-\r
-       if(!lpszHost){\r
-               m_dwLastError = EC_PARAMINVALID;\r
-               return FALSE;\r
-               }\r
-               \r
-       // \83A\83h\83\8c\83X\96¼\82©\82çIP\83A\83h\83\8c\83X\8eæ\93¾\r
-       const DWORD dwIP = HostToIP(lpszHost);\r
-\r
-       if(dwIP == INADDR_NONE){\r
-               m_dwLastError = EC_SOCKERROR;\r
-               return FALSE;           \r
-               }\r
-       \r
-       return Connect(dwIP, wPort, dwTimeOut);\r
-}\r
-\r
-const BOOL CSmartSock::Connect(const DWORD dwIP, const WORD wPort, const DWORD dwTimeOut)\r
-{\r
-       CHECK_FREESOCK(FALSE);\r
-\r
-       // \83\\83P\83b\83g\8dì\90¬\r
-       if((m_Socket = ::socket(PF_INET, SOCK_STREAM, 0)) == INVALID_SOCKET){\r
-               m_dwLastError = EC_SOCKERROR;\r
-               return FALSE;           \r
-               }\r
-\r
-       // \83A\83h\83\8c\83X\90Ý\92è\r
-       SOCKADDR_IN SockAddr;\r
-       SockAddr.sin_family = AF_INET;\r
-       SockAddr.sin_port = htons(wPort);\r
-       SockAddr.sin_addr.s_addr = htonl(dwIP);\r
-\r
-       // \93¯\8aú\83R\83l\83N\83g\r
-       if(!dwTimeOut){\r
-               if(::connect(m_Socket, (PSOCKADDR)&SockAddr, sizeof(sockaddr))){\r
-                       Close();\r
-                       m_dwLastError = EC_SOCKERROR;\r
-                       return FALSE;           \r
-                       }\r
-       \r
-               m_dwLastError = EC_NOERROR;\r
-               return TRUE;\r
-       }\r
-\r
-       // \94ñ\93¯\8aú\83R\83l\83N\83g\r
-       u_long nArg;\r
-       fd_set FdSet;\r
-       struct timeval TimeVal;\r
-       TimeVal.tv_sec = 10UL;\r
-       TimeVal.tv_usec = 0UL;
-       nArg = fcntl(m_Socket, F_GETFL, 0);\r
-       FD_ZERO(&FdSet);\r
-       FD_SET(m_Socket, &FdSet);\r
-\r
-       try{\r
-               // \94ñ\93¯\8aú\82É\90Ø\82è\91Ö\82¦\r
-               if(::fcntl(m_Socket, F_SETFL, nArg | O_NONBLOCK) == SOCKET_ERROR)throw (const DWORD)__LINE__;\r
-\r
-               // \83R\83l\83N\83g\r
-               if(::connect(m_Socket, (PSOCKADDR)&SockAddr, sizeof(sockaddr)) != SOCKET_ERROR)throw (const DWORD)__LINE__;\r
-\r
-               if(errno != EAGAIN && errno != EWOULDBLOCK && errno != EINPROGRESS)throw (const DWORD)__LINE__;\r
-\r
-               // \90Ú\91±\8a®\97¹\91Ò\82¿\r
-               if(!::select(32, NULL, &FdSet, NULL, &TimeVal))throw (const DWORD)__LINE__;\r
-\r
-               // \83^\83C\83\80\83A\83E\83g\94»\92è\r
-               if(!FD_ISSET(m_Socket, &FdSet)){\r
-                       Close();\r
-                       m_dwLastError = EC_TIMEOUT;\r
-                       return FALSE;\r
-                       }\r
-\r
-               // \93¯\8aú\82É\90Ø\82è\91Ö\82¦\r
-               if(::fcntl(m_Socket, F_SETFL, nArg) == SOCKET_ERROR)throw (const DWORD)__LINE__;\r
-               }\r
-       catch(const DWORD dwLine){\r
-               // \83G\83\89\81[\94­\90\r
-               Close();\r
-               m_dwLastError = EC_SOCKERROR;\r
-               return FALSE;\r
-               }\r
-\r
-       m_bSockType = SOCKTYPE_TCP;\r
-       m_dwLastError = EC_NOERROR;\r
-\r
-       return TRUE;\r
-}\r
-\r
-const BOOL CSmartSock::Listen(const WORD wPort)\r
-{\r
-       CHECK_FREESOCK(FALSE);\r
-\r
-       // \83\\83P\83b\83g\8dì\90¬\r
-       if((m_Socket = ::socket(PF_INET, SOCK_STREAM, 0)) == INVALID_SOCKET){\r
-               m_dwLastError = EC_SOCKERROR;\r
-               return FALSE;           \r
-               }\r
-\r
-       // \83A\83h\83\8c\83X\90Ý\92è\r
-       SOCKADDR_IN SockAddr;\r
-       SockAddr.sin_family = AF_INET;\r
-       SockAddr.sin_port = htons(wPort);\r
-       SockAddr.sin_addr.s_addr = INADDR_ANY;\r
-\r
-       try{\r
-               // \81u\83A\83h\83\8c\83X\8eg\97p\92\86\81v\83G\83\89\81[\82ð\89ñ\94ð
-               int on = 1;
-               setsockopt(m_Socket, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));
-
-               // \83o\83C\83\93\83h\r
-               if(::bind(m_Socket, (PSOCKADDR)&SockAddr, sizeof(SockAddr)) == SOCKET_ERROR)throw (const DWORD)__LINE__;\r
-\r
-               // \90Ú\91±\8eó\82¯\93ü\82ê\r
-               if(::listen(m_Socket, 5) == SOCKET_ERROR)throw (const DWORD)__LINE__;\r
-               }\r
-       catch(const DWORD dwLine){\r
-               // \83G\83\89\81[\94­\90\r
-               Close();\r
-               m_dwLastError = EC_SOCKERROR;\r
-               return FALSE;\r
-               }\r
-\r
-       m_bSockType = SOCKTYPE_TCP;\r
-       m_dwLastError = EC_NOERROR;\r
-\r
-       return TRUE;\r
-}\r
-\r
-CSmartSock * CSmartSock::Accept(void)\r
-{\r
-       CHECK_TCPSOCK(FALSE);\r
-       \r
-       SOCKADDR_IN AddrIn;\r
-       memset(&AddrIn, 0, sizeof(AddrIn));\r
-       socklen_t iAddrLen = sizeof(AddrIn);\r
-\r
-       // \83R\83l\83N\83g\8eó\82¯\93ü\82ê\r
-       SOCKET SockIn = ::accept(m_Socket, (sockaddr *)&AddrIn, &iAddrLen);\r
-\r
-       if(SockIn == INVALID_SOCKET){\r
-               Close();\r
-               m_dwLastError = EC_SOCKERROR;\r
-               return NULL;\r
-               }\r
-\r
-       CSmartSock *pNewSock = new CSmartSock;\r
-       pNewSock->m_Socket = SockIn;\r
-       pNewSock->m_bSockType = SOCKTYPE_TCP;\r
-\r
-       m_dwLastError = EC_NOERROR;\r
-\r
-       return pNewSock;\r
-}\r
-\r
-const BOOL CSmartSock::Send(const BYTE *pBuff, const DWORD dwLen, const DWORD dwTimeOut)\r
-{\r
-       CHECK_TCPSOCK(FALSE);\r
-\r
-       if(!pBuff || !dwLen){\r
-               m_dwLastError = EC_PARAMINVALID;\r
-               return FALSE;\r
-               }\r
-\r
-       // \8ew\92è\83T\83C\83Y\91\97\90M\r
-       DWORD dwRef = 0UL, dwSend = 0UL;\r
-\r
-       do{
-               dwRef = SendOnce(pBuff + dwSend, dwLen - dwSend, dwTimeOut);
-               if(!dwRef) return FALSE;\r
-       }\r
-       while((dwSend += dwRef) < dwLen);\r
-\r
-       return TRUE;\r
-}\r
-\r
-const BOOL CSmartSock::Recv(BYTE *pBuff, const DWORD dwLen, const DWORD dwTimeOut)\r
-{\r
-       CHECK_TCPSOCK(FALSE);\r
-\r
-       if(!pBuff || !dwLen){\r
-               m_dwLastError = EC_PARAMINVALID;\r
-               return FALSE;\r
-       }\r
-\r
-       // \8ew\92è\83T\83C\83Y\8eó\90M\r
-       DWORD dwRef = 0UL, dwRecv = 0UL;\r
-
-       do{\r
-               if(!(dwRef = RecvOnce(pBuff + dwRecv, dwLen - dwRecv, dwTimeOut)))return FALSE;\r
-       }\r
-       while((dwRecv += dwRef) < dwLen);
-\r
-       return TRUE;\r
-}\r
-\r
-const DWORD CSmartSock::SendOnce(const BYTE *pBuff, const DWORD dwMaxLen, const DWORD dwTimeOut)\r
-{\r
-       CHECK_TCPSOCK(0UL);\r
-\r
-       if(!pBuff || !dwMaxLen){\r
-               m_dwLastError = EC_PARAMINVALID;\r
-               return FALSE;\r
-               }\r
-       \r
-       // \83^\83C\83\80\83A\83E\83g\90Ý\92è\r
-       struct timeval stTimeOut;\r
-\r
-       stTimeOut.tv_sec = 10UL;
-       stTimeOut.tv_usec = 0UL;\r
-       if(::setsockopt(m_Socket, SOL_SOCKET, SO_RCVTIMEO, (char *)&stTimeOut, sizeof(struct timeval))){\r
-               Close();\r
-               m_dwLastError = EC_SOCKERROR;
-               return 0UL;\r
-       }\r
-
-       // \91\97\90M\r
-       const int iRef = ::send(m_Socket, (const char *)pBuff, dwMaxLen, 0);\r
-\r
-       if((iRef == SOCKET_ERROR) || !iRef){\r
-               if(errno == EAGAIN || errno == EWOULDBLOCK || errno == EINPROGRESS){\r
-                       m_dwLastError = EC_TIMEOUT;\r
-                       return 0UL;\r
-                       }\r
-               else{\r
-                       Close();\r
-                       m_dwLastError = EC_SOCKERROR;\r
-                       return 0UL;\r
-                       }\r
-               }\r
-               \r
-       m_dwLastError = EC_NOERROR;\r
-               \r
-       return (DWORD)iRef;\r
-}\r
-\r
-const DWORD CSmartSock::RecvOnce(BYTE *pBuff, const DWORD dwMaxLen, const DWORD dwTimeOut)\r
-{\r
-       CHECK_TCPSOCK(0UL);\r
-       \r
-       if(!pBuff || !dwMaxLen){\r
-               m_dwLastError = EC_PARAMINVALID;\r
-               return FALSE;\r
-               }\r
-\r
-       // \83^\83C\83\80\83A\83E\83g\92l\90Ý\92è\r
-       struct timeval stTimeOut;\r
-
-       stTimeOut.tv_sec = 10UL;
-       stTimeOut.tv_usec = 0UL;\r
-       if(::setsockopt(m_Socket, SOL_SOCKET, SO_RCVTIMEO, (char *)&stTimeOut, sizeof(struct timeval))){\r
-               Close();\r
-               m_dwLastError = EC_SOCKERROR;
-               return 0UL;\r
-       }\r
-       
-       // \8eó\90M\r
-       int iRef = ::recv(m_Socket, (char *)pBuff, dwMaxLen, 0);\r
-\r
-       if((iRef == SOCKET_ERROR) || !iRef){
-               if(errno == EAGAIN || errno == EWOULDBLOCK || errno == EINPROGRESS){
-                       m_dwLastError = EC_TIMEOUT;\r
-                       return 0UL;\r
-                       }\r
-               else{\r
-                       Close();\r
-                       m_dwLastError = EC_SOCKERROR;\r
-                       return 0UL;\r
-                       }\r
-               }\r
-
-       m_dwLastError = EC_NOERROR;\r
-               \r
-       return (DWORD)iRef;\r
-}\r
-\r
-const BOOL CSmartSock::GetLocalAddr(DWORD *pdwIP, WORD *pwPort)\r
-{\r
-       CHECK_TCPSOCK(FALSE);\r
-\r
-       struct sockaddr_in LocalAddr;\r
-       socklen_t AddrLen = sizeof(LocalAddr);\r
-       \r
-       // \83\8d\81[\83J\83\8b\83A\83h\83\8c\83X\8eæ\93¾\r
-       if(::getsockname(m_Socket, (struct sockaddr *)&LocalAddr, &AddrLen) == SOCKET_ERROR){\r
-               m_dwLastError = EC_SOCKERROR;\r
-               return FALSE;\r
-               }\r
-\r
-       if(pdwIP)*pdwIP = htonl(LocalAddr.sin_addr.s_addr);\r
-       if(pwPort)*pwPort = ntohs(LocalAddr.sin_port);\r
-\r
-       m_dwLastError = EC_NOERROR;\r
-\r
-       return TRUE;\r
-}\r
-\r
-const BOOL CSmartSock::GetPeerAddr(DWORD *pIP, WORD *pPort)\r
-{\r
-       CHECK_TCPSOCK(FALSE);\r
-\r
-       struct sockaddr_in PeerAddr;\r
-       socklen_t AddrLen = sizeof(PeerAddr);\r
-       \r
-       // \83s\83A\83A\83h\83\8c\83X\8eæ\93¾\r
-       if(::getpeername(m_Socket, (struct sockaddr *)&PeerAddr, &AddrLen) == SOCKET_ERROR){\r
-               m_dwLastError = EC_SOCKERROR;\r
-               return FALSE;\r
-               }\r
-\r
-       if(pIP)*pIP = htonl(PeerAddr.sin_addr.s_addr);\r
-       if(pPort)*pPort = ntohs(PeerAddr.sin_port);\r
-\r
-       m_dwLastError = EC_NOERROR;\r
-\r
-       return TRUE;\r
-}\r
-\r
-const BOOL CSmartSock::Bind()\r
-{\r
-       CHECK_FREESOCK(FALSE);\r
-\r
-       // UDP\83\\83P\83b\83g\8dì\90¬\r
-       if((m_Socket = ::socket(PF_INET, SOCK_DGRAM, 0)) == INVALID_SOCKET){\r
-               m_dwLastError = EC_SOCKERROR;\r
-               return FALSE;\r
-               }\r
-\r
-       // \83A\83h\83\8c\83X\90Ý\92è\r
-       SOCKADDR_IN SockAddr;\r
-       SockAddr.sin_family = AF_INET;\r
-       SockAddr.sin_port = 0U;\r
-       SockAddr.sin_addr.s_addr = INADDR_ANY;\r
-\r
-       // \83o\83C\83\93\83h\r
-       if(::bind(m_Socket, (struct sockaddr *)&SockAddr, sizeof(SockAddr)) == SOCKET_ERROR){\r
-               Close();\r
-               m_dwLastError = EC_SOCKERROR;\r
-               return FALSE;\r
-               }\r
-\r
-       m_dwLastError = EC_NOERROR;\r
-       m_bSockType = SOCKTYPE_UDP;\r
-       \r
-       return TRUE;\r
-}\r
-\r
-const DWORD CSmartSock::SendTo(const DWORD dwIP, const WORD wPort, const BYTE *pBuff, const DWORD dwLen)\r
-{\r
-       CHECK_UDPSOCK(0UL);\r
-\r
-       if(!pBuff || !dwLen){\r
-               m_dwLastError = EC_PARAMINVALID;\r
-               return 0UL;\r
-               }\r
-\r
-       // \83A\83h\83\8c\83X\90Ý\92è\r
-       SOCKADDR_IN SockAddr;\r
-       SockAddr.sin_family = AF_INET;\r
-       SockAddr.sin_port = htons(wPort);\r
-       SockAddr.sin_addr.s_addr = htonl(dwIP);\r
-\r
-       // \91\97\90M\r
-       int iSend = sendto(m_Socket, (const char *)pBuff, dwLen, 0, (struct sockaddr *)&SockAddr, sizeof(SockAddr));\r
-       \r
-       if(iSend == SOCKET_ERROR){\r
-               m_dwLastError = EC_SOCKERROR;\r
-               return 0UL;\r
-               }\r
-\r
-       m_dwLastError = EC_NOERROR;\r
-\r
-       return (DWORD)iSend;\r
-}\r
-\r
-const DWORD CSmartSock::SendTo(LPCTSTR lpszHost, const WORD wPort, const BYTE *pBuff, const DWORD dwLen)\r
-{\r
-       CHECK_UDPSOCK(0UL);\r
-\r
-       if(!lpszHost || !pBuff || !dwLen){\r
-               m_dwLastError = EC_PARAMINVALID;\r
-               return 0UL;\r
-               }\r
-               \r
-       // \83A\83h\83\8c\83X\96¼\82©\82çIP\83A\83h\83\8c\83X\8eæ\93¾\r
-       const DWORD dwIP = HostToIP(lpszHost);\r
-\r
-       if(dwIP == INADDR_NONE){\r
-               m_dwLastError = EC_SOCKERROR;\r
-               return 0UL;             \r
-               }\r
-       \r
-       return SendTo(dwIP, wPort, pBuff, dwLen);\r
-}\r
-\r
-const DWORD CSmartSock::RecvFrom(BYTE *pBuff, const DWORD dwLen, DWORD *pdwIP, WORD *pwPort)\r
-{\r
-       CHECK_UDPSOCK(0UL);\r
-\r
-       if(!pBuff || !dwLen){\r
-               m_dwLastError = EC_PARAMINVALID;\r
-               return 0UL;\r
-               }\r
-\r
-       // \83A\83h\83\8c\83X\90Ý\92è\r
-       socklen_t iSockSize = sizeof(SOCKADDR_IN);\r
-       SOCKADDR_IN SockAddr;\r
-       SockAddr.sin_family = AF_INET;\r
-       SockAddr.sin_port = 0U;\r
-       SockAddr.sin_addr.s_addr = 0UL;\r
-\r
-       // \8eó\90M\r
-       const int iRecv = ::recvfrom(m_Socket, (char *)pBuff, dwLen, 0, (struct sockaddr *)&SockAddr, &iSockSize);\r
-\r
-       if(iRecv == SOCKET_ERROR){\r
-               m_dwLastError = EC_SOCKERROR;\r
-               return 0UL;\r
-               }\r
-\r
-       if(pdwIP)*pdwIP = SockAddr.sin_addr.s_addr;\r
-       if(pwPort)*pwPort = ntohs(SockAddr.sin_port);\r
-\r
-       m_dwLastError = EC_NOERROR;\r
-\r
-       return (DWORD)iRecv;\r
-}\r
-\r
-const BOOL CSmartSock::Close()\r
-{\r
-       // \83\\83P\83b\83g\83N\83\8d\81[\83Y\r
-       if(m_Socket != INVALID_SOCKET){\r
-               if(m_bSockType == SOCKTYPE_TCP){\r
-                       char byData;\r
-                       ::shutdown(m_Socket, SD_BOTH);\r
-                       while(::recv(m_Socket, &byData, 1, 0) == 1);\r
-                       }\r
-\r
-               ::close(m_Socket);\r
-               m_Socket = INVALID_SOCKET;\r
-               }\r
-       \r
-       m_bSockType = SOCKTYPE_NON;\r
-       m_dwLastError = EC_NOERROR;\r
-       \r
-       return TRUE;\r
-}\r
-\r
-const DWORD CSmartSock::HostToIP(LPCTSTR lpszHost)\r
-{\r
-#ifdef _UNICODE\r
-       char szHost[1024] = {"\0"};\r
-       ::wcstombs(szHost, lpszHost, sizeof(szHost) - 1);\r
-#else\r
-       LPCSTR szHost = lpszHost;\r
-#endif\r
-\r
-       // \83z\83X\83g\96¼\82©\82çIP\83A\83h\83\8c\83X\8eæ\93¾\r
-       const DWORD dwIP = ::inet_addr(szHost);\r
-\r
-       if(dwIP == INADDR_NONE){\r
-               struct hostent *pHost = ::gethostbyname(szHost);\r
-               if(!pHost){             \r
-                       return INADDR_NONE;\r
-                       }\r
-               else return *((DWORD *)pHost->h_addr_list[0]);\r
-               }\r
-       else return htonl(dwIP);\r
-}\r
-\r
-const DWORD CSmartSock::IPToHost(LPTSTR lpszHost, const DWORD dwIP)\r
-{\r
-       if(!lpszHost)return FALSE;\r
-\r
-       // IP\83A\83h\83\8c\83X\82©\82ç\83z\83X\83g\96¼\8eæ\93¾\r
-       const DWORD dwNetIP = htonl(dwIP);\r
-       struct hostent *pHost = ::gethostbyaddr((const char *)&dwNetIP, sizeof(dwNetIP), AF_INET);\r
-       if(!pHost)return FALSE;\r
-\r
-#ifdef _UNICODE\r
-       ::mbstowcs(lpszHost, pHost->h_name, ::lstrlenA(pHost->h_name));\r
-#else\r
-       ::strcpy(lpszHost, pHost->h_name);\r
-#endif\r
-\r
-       return ::strlen(lpszHost);\r
-}\r
-\r
-const DWORD CSmartSock::GetLastError() const\r
-{\r
-       // \8dÅ\8cã\82É\94­\90\82µ\82½\83G\83\89\81[\82ð\95Ô\82·\r
-       return m_dwLastError;\r
-}\r
-\r
-const BOOL CSmartSock::InitWinSock2(void)\r
-{\r
-#ifdef _UNICODE\r
-       ::setlocale(LC_ALL, "japanese");\r
-#endif\r
-/*\r
-       WSADATA WsaData;\r
-\r
-       // WinSock2\8f\89\8aú\89»\r
-       if(::WSAStartup(MAKEWORD(2, 2), &WsaData))return FALSE;\r
-\r
-       if((LOBYTE(WsaData.wVersion) != 2U) || (HIBYTE(WsaData.wVersion) != 2U))return FALSE;\r
-*/\r
-       return TRUE;\r
-}\r
-\r
-const BOOL CSmartSock::FreeWinSock2(void)\r
-{\r
-/*
-       // WinSock2\8aJ\95ú\r
-       return (::WSACleanup())? TRUE : FALSE;\r
-*/
-       return TRUE;
-}\r
diff --git a/dist/trunk/b25-remote/SmartSock.h b/dist/trunk/b25-remote/SmartSock.h
deleted file mode 100755 (executable)
index d735339..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-// SmartSock.h: CSmartSock \83N\83\89\83X\82Ì\83C\83\93\83^\81[\83t\83F\83C\83X\r
-//\r
-//////////////////////////////////////////////////////////////////////\r
-\r
-#pragma once\r
-\r
-#include "W2L.h"\r
-#include <sys/socket.h>
-#include <fcntl.h>
-#include <arpa/inet.h>
-#include <netdb.h>
-#include <unistd.h>
-#include <errno.h>
-\r
-#define BOOL bool
-#define LPTSTR char*
-#define LPCTSTR const char*
-#define LPCSTR const char*
-#define BYTE  unsigned char
-#define WORD  unsigned short
-#define DWORD unsigned long
-#define SOCKET int
-\r
-// WinSock2\83^\83C\83\80\83A\83E\83g\91Î\89\9e\83\89\83b\83p\81[\83N\83\89\83X      http://2sen.dip.jp/friio/\r
-class CSmartSock\r
-{\r
-public:\r
-       enum                                    // LastError\83R\81[\83h\r
-       {\r
-               EC_NOERROR,                     // \90³\8fí\8fI\97¹\r
-               EC_SOCKERROR,           // \83\\83P\83b\83g\83G\83\89\81[\r
-               EC_TIMEOUT,                     // \83^\83C\83\80\83A\83E\83g\r
-               EC_SOCKINVALID,         // \83\\83P\83b\83g\82ª\96³\8cø\r
-               EC_PARAMINVALID         // \83p\83\89\83\81\81[\83^\82ª\96³\8cø\r
-       };\r
-\r
-       CSmartSock();\r
-       virtual ~CSmartSock();\r
-\r
-// TCP\83\\83P\83b\83g\r
-       const BOOL Connect(LPCTSTR lpszHost, const WORD wPort, const DWORD dwTimeOut = 0UL);\r
-       const BOOL Connect(const DWORD dwIP, const WORD wPort, const DWORD dwTimeOut = 0UL);\r
-\r
-       const BOOL Listen(const WORD wPort);\r
-       CSmartSock * Accept(void);\r
-\r
-       const BOOL Send(const BYTE *pBuff, const DWORD dwLen, const DWORD dwTimeOut = 0UL);\r
-       const BOOL Recv(BYTE *pBuff, const DWORD dwLen, const DWORD dwTimeOut = 0UL);\r
-       const DWORD SendOnce(const BYTE *pBuff, const DWORD dwMaxLen, const DWORD dwTimeOut = 0UL);\r
-       const DWORD RecvOnce(BYTE *pBuff, const DWORD dwMaxLen, const DWORD dwTimeOut = 0UL);\r
-\r
-       const BOOL GetLocalAddr(DWORD *pdwIP, WORD *pwPort = NULL);\r
-       const BOOL GetPeerAddr(DWORD *pdwIP, WORD *pwPort = NULL);\r
-\r
-// UDP\83\\83P\83b\83g\r
-       const BOOL Bind(void);\r
-\r
-       const DWORD SendTo(const DWORD dwIP, const WORD wPort, const BYTE *pBuff, const DWORD dwLen);\r
-       const DWORD SendTo(LPCTSTR lpszHost, const WORD wPort, const BYTE *pBuff, const DWORD dwLen);\r
-       const DWORD RecvFrom(BYTE *pBuff, const DWORD dwLen, DWORD *pdwIP = NULL, WORD *pwPort = NULL);\r
-\r
-       const BOOL Close(void);\r
-\r
-       static const DWORD HostToIP(LPCTSTR lpszHost);\r
-       static const DWORD IPToHost(LPTSTR lpszHost, const DWORD dwIP);\r
-\r
-       const DWORD GetLastError(void) const;\r
-\r
-protected:\r
-       static const BOOL InitWinSock2(void);\r
-       static const BOOL FreeWinSock2(void);\r
-\r
-       enum {SOCKTYPE_NON, SOCKTYPE_TCP, SOCKTYPE_UDP};\r
-\r
-       int m_Socket;                           // \83\\83P\83b\83g\83n\83\93\83h\83\8b\r
-       BYTE m_bSockType;                               // \83\\83P\83b\83g\83^\83C\83v\r
-       DWORD m_dwLastError;                    // \8dÅ\8fI\83G\83\89\81[\83R\81[\83h\r
-       static DWORD dwInstanceNum;             // \83C\83\93\83X\83^\83\93\83X\82Ì\90\94\r
-};\r
diff --git a/dist/trunk/b25-remote/TsUtilClass.cpp b/dist/trunk/b25-remote/TsUtilClass.cpp
deleted file mode 100755 (executable)
index ec4c298..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-// TsUtilClass.cpp: TS\83\86\81[\83e\83B\83\8a\83e\83B\81[\83N\83\89\83X\82Ì\83C\83\93\83v\83\8a\83\81\83\93\83e\81[\83V\83\87\83\93\r
-//\r
-//////////////////////////////////////////////////////////////////////\r
-\r
-#include "TsUtilClass.h"\r
-\r
-\r
-//////////////////////////////////////////////////////////////////////\r
-// CDynamicReferenceable \83N\83\89\83X\82Ì\8d\\92z/\8fÁ\96Å\r
-//////////////////////////////////////////////////////////////////////\r
-\r
-CDynamicReferenceable::CDynamicReferenceable()\r
-       : m_dwRefCount(0UL)\r
-{\r
-\r
-}\r
-\r
-CDynamicReferenceable::~CDynamicReferenceable()\r
-{\r
-\r
-}\r
-\r
-void CDynamicReferenceable::AddRef(void)\r
-{\r
-       // \8eQ\8fÆ\83J\83E\83\93\83g\83C\83\93\83N\83\8a\83\81\83\93\83g\r
-       m_dwRefCount++;\r
-}\r
-\r
-void CDynamicReferenceable::ReleaseRef(void)\r
-{\r
-       // \8eQ\8fÆ\83J\83E\83\93\83g\83f\83N\83\8a\83\81\83\93\83g\r
-       if(m_dwRefCount){\r
-               // \83C\83\93\83X\83^\83\93\83X\8aJ\95ú\r
-               if(!(--m_dwRefCount))delete this;\r
-               }\r
-#ifdef _DEBUG\r
-       else{\r
-               ::DebugBreak();\r
-               }\r
-#endif\r
-}\r
-\r
-\r
-//////////////////////////////////////////////////////////////////////\r
-// CCriticalLock \83N\83\89\83X\82Ì\8d\\92z/\8fÁ\96Å\r
-//////////////////////////////////////////////////////////////////////\r
-\r
-CCriticalLock::CCriticalLock()\r
-{\r
-       // \83N\83\8a\83e\83B\83J\83\8b\83Z\83N\83V\83\87\83\93\8f\89\8aú\89»\r
-       pthread_mutex_init(&m_CriticalSection, NULL);\r
-}\r
-\r
-CCriticalLock::~CCriticalLock()\r
-{\r
-       // \83N\83\8a\83e\83B\83J\83\8b\83Z\83N\83V\83\87\83\93\8dí\8f\9c\r
-       pthread_mutex_destroy(&m_CriticalSection);\r
-}\r
-\r
-void CCriticalLock::Lock(void)\r
-{\r
-       // \83N\83\8a\83e\83B\83J\83\8b\83Z\83N\83V\83\87\83\93\8eæ\93¾\r
-       pthread_mutex_lock(&m_CriticalSection);\r
-}\r
-\r
-void CCriticalLock::Unlock(void)\r
-{\r
-       // \83N\83\8a\83e\83B\83J\83\8b\83Z\83N\83V\83\87\83\93\8aJ\95ú\r
-       pthread_mutex_unlock(&m_CriticalSection);\r
-}\r
-       \r
-       \r
-//////////////////////////////////////////////////////////////////////\r
-// CBlockLock \83N\83\89\83X\82Ì\8d\\92z/\8fÁ\96Å\r
-//////////////////////////////////////////////////////////////////////\r
-       \r
-CBlockLock::CBlockLock(CCriticalLock *pCriticalLock)\r
-       : m_pCriticalLock(pCriticalLock)\r
-{\r
-       // \83\8d\83b\83N\8eæ\93¾\r
-       m_pCriticalLock->Lock();\r
-}\r
-\r
-CBlockLock::~CBlockLock()\r
-{\r
-       // \83\8d\83b\83N\8aJ\95ú\r
-       m_pCriticalLock->Unlock();\r
-}\r
diff --git a/dist/trunk/b25-remote/TsUtilClass.h b/dist/trunk/b25-remote/TsUtilClass.h
deleted file mode 100755 (executable)
index ebae86b..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-// TsUtilClass.h: TS\83\86\81[\83e\83B\83\8a\83e\83B\81[\83N\83\89\83X\82Ì\83C\83\93\83^\81[\83t\83F\83C\83X\r
-//\r
-//////////////////////////////////////////////////////////////////////\r
-\r
-#pragma once\r
-#include "W2L.h"\r
-#include <pthread.h>
-\r
-#define DWORD unsigned long
-
-/////////////////////////////////////////////////////////////////////////////\r
-// \83_\83C\83i\83~\83b\83N\83\8a\83t\83@\83\8c\83\93\83X\8aÇ\97\9d\83x\81[\83X\83N\83\89\83X\r
-/////////////////////////////////////////////////////////////////////////////\r
-\r
-class CDynamicReferenceable\r
-{\r
-public:\r
-       CDynamicReferenceable();\r
-       virtual ~CDynamicReferenceable();\r
-\r
-       void AddRef(void);\r
-       void ReleaseRef(void);\r
-\r
-private:\r
-       DWORD m_dwRefCount;\r
-};\r
-\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-// \83N\83\8a\83e\83B\83J\83\8b\83Z\83N\83V\83\87\83\93\83\89\83b\83p\81[\83N\83\89\83X\r
-/////////////////////////////////////////////////////////////////////////////\r
-\r
-class CCriticalLock\r
-{\r
-public:\r
-       CCriticalLock();\r
-       virtual ~CCriticalLock();\r
-       \r
-       void Lock(void);\r
-       void Unlock(void);\r
-       \r
-private:\r
-       pthread_mutex_t m_CriticalSection;\r
-};\r
-\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-// \83u\83\8d\83b\83N\83X\83R\81[\83v\83\8d\83b\83N\83N\83\89\83X\r
-/////////////////////////////////////////////////////////////////////////////\r
-\r
-class CBlockLock\r
-{\r
-public:\r
-       CBlockLock(CCriticalLock *pCriticalLock);\r
-       virtual ~CBlockLock();\r
-               \r
-private:\r
-       CCriticalLock *m_pCriticalLock;\r
-};\r
-\r
-\r
diff --git a/dist/trunk/b25-remote/W2L.h b/dist/trunk/b25-remote/W2L.h
deleted file mode 100755 (executable)
index 678823d..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-#include <string.h>
-
-#define TCHAR char
-#define PVOID void*
-#define HANDLE void*
-#define TRUE 1
-#define FALSE 0
-#define INVALID_SOCKET (-1)
-#define SOCKET_ERROR (-1)
-#define SOCKADDR_IN struct sockaddr_in
-#define SOCKADDR struct sockaddr
-#define PSOCKADDR SOCKADDR*
-#define SD_BOTH SHUT_RDWR
-
diff --git a/dist/trunk/b25-remote/b25-client.cpp b/dist/trunk/b25-remote/b25-client.cpp
deleted file mode 100755 (executable)
index f108e00..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-// MllMain.cpp : DLL \83A\83v\83\8a\83P\81[\83V\83\87\83\93\82Ì\83G\83\93\83g\83\8a \83|\83C\83\93\83g\82ð\92è\8b`\82µ\82Ü\82·\81B\r
-//\r
-#include <winscard.h>
-#include <stdio.h>\r
-#include "CasProxy.h"\r
-#include "W2L.h"\r
-#ifndef SCARD_AUTOALLOCATE
-  #define SCARD_AUTOALLOCATE (DWORD)(-1)  /**< see SCardFreeMemory() */
-#endif\r
-
-//////////////////////////////////////////////////////////////////////\r
-// WinSCard\83t\83b\83N\r
-//////////////////////////////////////////////////////////////////////\r
-LONG SCardConnect(SCARDCONTEXT hContext, LPCSTR szReader, DWORD dwShareMode, DWORD dwPreferredProtocols, LPSCARDHANDLE phCard, LPDWORD pdwActiveProtocol)\r
-{\r
-       // \83v\83\8d\83L\83V\83C\83\93\83X\83^\83\93\83X\90\90¬\r
-       CCasProxy *pCasProxy = new CCasProxy();\r
-
-       // \83T\81[\83o\82É\90Ú\91±\r
-       if(!pCasProxy->Connect()){\r
-               delete pCasProxy;\r
-               *phCard = NULL;\r
-               return SCARD_E_READER_UNAVAILABLE;\r
-               }
-\r
-       // \83n\83\93\83h\83\8b\82É\96\84\82ß\8d\9e\82Þ\r
-       *phCard = reinterpret_cast<SCARDHANDLE>(pCasProxy);\r
-       if(pdwActiveProtocol)*pdwActiveProtocol = SCARD_PROTOCOL_T1;\r
-\r
-       return SCARD_S_SUCCESS;\r
-}\r
-\r
-LONG SCardDisconnect(SCARDHANDLE hCard, DWORD dwDisposition)\r
-{\r
-       // \83T\81[\83o\82©\82ç\90Ø\92f\r
-       CCasProxy *pCasProxy = reinterpret_cast<CCasProxy *>(hCard);\r
-       if(pCasProxy)delete pCasProxy;\r
-\r
-       return SCARD_S_SUCCESS;\r
-}\r
-\r
-LONG SCardEstablishContext(DWORD dwScope, LPCVOID pvReserved1, LPCVOID pvReserved2, LPSCARDCONTEXT phContext)\r
-{
-       return SCARD_S_SUCCESS;\r
-}\r
-\r
-LONG SCardFreeMemory(SCARDCONTEXT hContext, LPCVOID pvMem)\r
-{\r
-       return SCARD_S_SUCCESS;\r
-}\r
-\r
-LONG SCardListReaders(SCARDCONTEXT hContext, LPCSTR mszGroups, LPSTR mszReaders, LPDWORD pcchReaders)\r
-{\r
-       const char szReaderName[] = "BonCasLink Proxy Card Reader\0";\r
-\r
-       if(pcchReaders){\r
-               if((*pcchReaders == SCARD_AUTOALLOCATE) && mszReaders){\r
-                       *((LPCSTR *)mszReaders) = szReaderName;         \r
-                       return SCARD_S_SUCCESS;\r
-                       }\r
-               else{\r
-                       *pcchReaders = sizeof(szReaderName);\r
-                       }\r
-               }\r
-\r
-       if(mszReaders) memcpy(mszReaders, szReaderName, sizeof(szReaderName));\r
-\r
-       return SCARD_S_SUCCESS;\r
-}\r
-\r
-LONG SCardTransmit(SCARDHANDLE hCard, LPCSCARD_IO_REQUEST pioSendPci, LPCBYTE pbSendBuffer, DWORD cbSendLength, LPSCARD_IO_REQUEST pioRecvPci, LPBYTE pbRecvBuffer, LPDWORD pcbRecvLength)\r
-{\r
-       // \83T\81[\83o\82É\83\8a\83N\83G\83X\83g\91\97\8eó\90M\r
-       CCasProxy *pCasProxy = reinterpret_cast<CCasProxy *>(hCard);\r
-       if(!pCasProxy)return SCARD_E_READER_UNAVAILABLE;\r
-\r
-       DWORD dwRecvLen = pCasProxy->TransmitCommand(pbSendBuffer, cbSendLength, pbRecvBuffer);\r
-       if(pcbRecvLength)*pcbRecvLength = dwRecvLen;\r
-\r
-       return (dwRecvLen)? SCARD_S_SUCCESS : SCARD_E_TIMEOUT;\r
-}\r
-\r
-LONG SCardReleaseContext(SCARDCONTEXT hContext)\r
-{\r
-       return SCARD_S_SUCCESS;\r
-}\r
-
diff --git a/dist/trunk/b25-remote/b25-server.cpp b/dist/trunk/b25-remote/b25-server.cpp
deleted file mode 100755 (executable)
index 674af68..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-#include <stdio.h>
-#include "CasServer.h"
-
-CCasServer m_CasServer(NULL);
-int m_dwServerPort = 6900UL;
-
-int main() {
-       if(!m_CasServer.OpenServer(m_dwServerPort)){\r
-               printf("サーバの起動に失敗しました。\nTCPポートまたはカードリーダをオープンできません。\n");\r
-               return TRUE;\r
-       }
-       getchar();
-}
-
diff --git a/dist/trunk/diff b/dist/trunk/diff
deleted file mode 100755 (executable)
index e69de29..0000000
diff --git a/dist/trunk/install.sh b/dist/trunk/install.sh
deleted file mode 100755 (executable)
index 028100b..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-SELF_DIR=`dirname $0`
-cd ${SELF_DIR}
-cd rec10
-bash install.sh
-cd ../
-mv Makefile.base Makefile
diff --git a/dist/trunk/readme.txt b/dist/trunk/readme.txt
deleted file mode 100755 (executable)
index 8087507..0000000
+++ /dev/null
@@ -1,210 +0,0 @@
-###########################################
-#     Rec10 -Ts Recording system-         #
-#                          Ver.0.9.9.2    #
-# 2011/03/23         Yukikaze & long.inus #
-#  Copyright (C) 2009-2011 Yukikaze      #
-###########################################
-
-本ソフトはpythonおよびperlによって書かれた録画ツールです。
-ライセンスは LGPL v3に準拠します(license.txt参照)
-
-[必要コマンド]
-python(2.6,2.7にて動作確認)
-wine
-mencoder
-ffmpeg
-x264
-mp4box
-MySQL
-MySQLdb(MySQL-pythonなどの名前)
-mkvmerge(mkv使用時)
-java(jre1.6で動作を確認)
-
-[必要環境:Webインターフェース部分]
-perl
-一部のperlモジュール(rectool.pl,rec10webg2)
-
-[必要環境:外部ツール]
-jTsSplitter(included)
-BonTsDemux(included)
-epgdump(included)
-b25(not included)
-recpt1(recfriioでもいいはずです)(not included)
-MySQLdb
-
-事前準備:
-ネットの情報を参考にpt1ドライバーを無効化する
-pt1などのドライバーをインストールした上(chardev版)で、recpt1などのソフトを導入、
-b25をインストールしておいてください。
-*注意
-11年10月01日からのBS新チャンネル対応のためには、10/02現在ではrecpt1にパッチを当てる必要があります。
-rec10同梱版のepgrecはts解析によってチャンネルデータを得るように改変してあるので
-変更は不要です。
-
-1:install.shを実行
-2:表示にしたがって設定の変更(チャンネルなど)
-3:make
-4:su
-5:make install
-6:rec10を実行するユーザーで/usr/local/share/rec10を実行
-7:cronに書き加える
-8:rectool.plをインストール(Makefile.PLの実行 rectool.plの配置)
-
-付け足し
-
-7.cronの設定
-
-最後にrec10d.pyをcronで五分おきに実行するようにしてください
-crontab -e を実行するとcronを編集できるようになるので
-*/5 * * * * python /usr/local/bin/rec10
-のように書いてください(5扮ごとに実行)
-
-ログは/var/log/rec10に移動しました。
-
-8.rectoolのインストール
-Makefile.PLを実行します。
-実行した後にrectool.plをhttpの公開ディレクトリ(wwwフォルダなど)に置いてください。
-
-ちなみに
-エンコードの設定を変えたい場合はts2x264を参照してください
-
-
-チャンネルの設定を変えた場合はを編集した後に
-chdata.pyを実行してください(python chdata.py)
-その後番組表が更新されます
-
-バグだらけのコードですが、改善点などを指摘していただけるとうれしいです。
-yukikaze.jp@gmail.com
-
-
-動作確認のとれたディストリ
-
-11/03/10 SVN Centos 5.5 (yukikaze)
-11/03/10 0.9.9.1+a ArchLinux (yukikaze)
-11/02/20 0.9.9.1+a Debian 6.0
-11/02/XX 0.9.9 Ubuntu 10.10
-10/12/XX 0.9.8 Centos 5.5 (yukikaze)
-10/XX/XX 0.9.8 Fedora13 (long.inus)
-
-
-[History]
-11/XX/XX 0.9.10
-add Bluray compatible option("B")
-ステレオ音声時のBonTsDemux仕様オプション追加("b")
-lameの実行パスチェックを実装
-mencoderのコマンドラインを最新版対応へ
-ffmpegのオプション追加
-epggenreを追加
-keywordの重複チェックをより賢く
-logoのインポートに対応
-ArchLinuxサポートのための細かな変更
-新BSチャンネル対応
-
-11/02/02 0.9.9
-BonTsDemuxを最新版へ(nogui化によりXvfbが不要)
-一部CSチャンネルの追加
-epg_chを変更(ontvの削除)
-チャンネルスキャン機能を実装
-キーワード予約の自動実行オプション追加(in_auto_jbkにauto,optの追加)
-番組初頭の解像度変更に対応
-キーワード予約自動実行オプションの重複チェック実装
-延長対応機能の修正
-移動後のオプション引き継ぎに対応
-
-10/10/09 0.9.8 release
-インターレース保持エンコードに対応
-色空間を修正
-放送大学のマルチチャンネルに仮対応
-verboseモードの実装
-ログレベルの実装
-画面サイズが取得できなかったときの処理を追加
-python2.5/2.7に対応
-音声の自動復帰を修正
-
-10/07/10 0.9.7 release
-ヒストリーチャンネルのタイトルを修正
-ffmpeg使用時にscale拡大をするように修正
-一時ファイル削除機能の修正
-sarの変更を実装
-最新版のCaption2Assに対応
-
-10/05/29 0.9.6 release
-バグ修正
-ログシステムの修正
-
-0.9.5(内部リリース)
-b25自動削除機能の改善
-自動仕分け機能のアップデート
-Caption2Assやaac取り出しがうまくいかないときの自動復帰処理の実装
-バグ修正
-
-10/04/02 0.9.4 release
-バグ修正
-インストーラーの大幅な改善
-ログシステムの変更
-エンコードの変更
-チャンネル変更に対応(CS)
-
-10/03/20 0.9.3 release(internal)
-lots of bug fixes.
-change DB.
-implement updating function(from 0.9.1 or 0.9.2)
-10/03/06 0.9.2 release(internal)
-few bug fix.(!!! amazing i think)
-implement new encoding system.
-use x264cli and mencoder throwgh fifo.
-implement final production changing system(you can choose mkv and mp4 now.)
-
-10/02/21 0.9.1 release
-Lots of bug fixes.
-change video filter.
-change encode option.
-implement installer.
-
-09/12/07 0.9.0 release
-change config path.(config.ini to rec10.conf)
-add Makefile
-change large number of var name.
-support b25_remote(thanks long.inus)
-support auto copy function.
-change video filter.
-change encode option.
-fix a lot of bugs.
-finish to support iEPG(iRec10EPG).
-
-09/10/27 0.8.0 relaase
-Lots of bug fixes.
-Use mkvmerge to mux avi to mkv.
-Many changes.
-
-09/08/22 0.6.0 release
-Lots of bug fixes.
-Implement db using MySQL.
-Change Ts splitting soft from Tssplitter to tssplitter_lite(included.)
-
-09/08/01 0.5.0 release
-バグフィックス
-検索録画のパターンマッチングアルゴリズムの変更(推測的な検索ができるようになった)
-rectool.plを同梱するようにした。
-周辺ソフトのうちライセンスの問題がないものを同梱するようにした。
-
-09/07/01 0.4.1 release
-lots of bug fixes
-add some cs-ch.
-release pl src.
-09/05/24 0.3.1 release
-fix
-チャンネルの増加
-エンコードオプションを実際に使えるようにした。
-1passモード実装
-niceコマンドをより広範囲に適用するようにした。
-09/05/08 0.1.1 release
-fix
-2passエンコードのログファイルがかぶるのを訂正
-一部チャンネル指定が間違っていたのを訂正
-その他多くのバグの訂正
-09/05/05 0.0.1b release
-fix
-replace tab to 4 spaces(it caused errors)
-add some cs-e2 channels
-09/05/04 0.0.1a release
diff --git a/dist/trunk/rec10/Makefile.base b/dist/trunk/rec10/Makefile.base
deleted file mode 100755 (executable)
index 0da6338..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-PREFIX = /usr/local/share
-MAJOR = 0
-MINOR = 9
-REVISION = 10
-VER = $(MAJOR).$(MINOR).$(REVISION)
-
-DEST = $(PREFIX)/rec10
-
-install:
-       if ! [ -d $(PREFIX)/rec10 ]; then mkdir -p $(PREFIX)/rec10 ;fi
-       cp ./*.py $(DEST)/
-       /bin/echo -e "#!/bin/bash" > ./rec10
-       /bin/echo -e "if type -P python2.6 > /dev/null\nthen\nexport LANG=\"ja_JP.UTF-8\" && python2.6 ${DEST}/rec10d.py" >> ./rec10
-       /bin/echo -e "elif type -P python26 > /dev/null\nthen\nexport LANG=\"ja_JP.UTF-8\" && python26 ${DEST}/rec10d.py\n" >> ./rec10
-       /bin/echo -e "elif type -P python2.5 > /dev/null\nthen\nexport LANG=\"ja_JP.UTF-8\" && python2.5 ${DEST}/rec10d.py\n" >> ./rec10
-       /bin/echo -e "elif type -P python25 > /dev/null\nthen\nexport LANG=\"ja_JP.UTF-8\" && python25 ${DEST}/rec10d.py" >> ./rec10
-       /bin/echo -e "elif type -P python2.7 > /dev/null\nthen\nexport LANG=\"ja_JP.UTF-8\" && python2.7 ${DEST}/rec10d.py" >> ./rec10
-       /bin/echo -e "elif type -P python27 > /dev/null\nthen\nexport LANG=\"ja_JP.UTF-8\" && python27 ${DEST}/rec10d.py" >> ./rec10
-       /bin/echo -e "else export LANG=\"ja_JP.UTF-8\" && python ${DEST}/rec10d.py" >> ./rec10
-       /bin/echo -e "fi\n" >> ./rec10
-       install -m755 ./rec10 $(DEST)/
-       if ! [ -f /usr/local/bin/rec10 ]; then ln $(DEST)/rec10 /usr/local/bin;fi
-       chmod 755 /usr/local/bin/rec10
-       if [ -f /etc/rec10.conf ]; then rm /etc/rec10.conf;fi
-       cp ./rec10.conf /etc/rec10.conf
-       if ! [ -d /tmp/rec10 ]; then mkdir -p /tmp/rec10 ;fi
-       chmod 777 /tmp/rec10
-       if ! [ -d /var/log/rec10 ]; then echo "" > /var/log/rec10 ;fi
-       chmod 777 /var/log/rec10
-uninstall:
-       rm -rf $(DEST)
-       rm -rf /tmp/rec10
-       rm -f /usr/local/bin/rec10
diff --git a/dist/trunk/rec10/auto_move.py b/dist/trunk/rec10/auto_move.py
deleted file mode 100755 (executable)
index 288e49d..0000000
+++ /dev/null
@@ -1,150 +0,0 @@
-#!/usr/bin/python\r
-# coding: UTF-8\r
-# Rec10 TS Recording Tools\r
-# Copyright (C) 2009-2011 Yukikaze\r
-\r
-import glob\r
-import os\r
-import os.path\r
-import re\r
-import time\r
-import shutil\r
-import traceback\r
-import sys\r
-\r
-import recdblist\r
-import guess\r
-def getTitle(title):\r
-    rT=re.compile("(.+)_(\d+)\Z")\r
-    tT=rT.match(title)\r
-    rT2=re.compile("(.+)_(.+)_(\d*)\Z")#_(aichi)_2010-02-06T01:59:00.mkv\r
-    tT2=rT2.match(title)\r
-    rT3=re.compile("(.+)_(.+)_\d+-\d+-\d+T\d+:\d+:\d+\Z")#_(aichi)_2010-02-06T01:59:00.mkv\r
-    tT3=rT3.match(title)\r
-    rT4=re.compile("(.+)_(.+)_\d+-\d+-\d+T\d+-\d+-\d+\Z")#_(aichi)_2010-02-06T01-59-00.mkv\r
-    tT4=rT4.match(title)\r
-    rT5=re.compile("(.+)_(.+)_(.+)\Z")#_(aichi)_2010-02-06T01-59-00.mkv\r
-    tT5=rT5.match(title)\r
-    ntitle=title\r
-    if tT :\r
-        ntitle=tT.group(1)\r
-    elif tT2:\r
-        ntitle=tT2.group(1)\r
-    elif tT3:\r
-        ntitle=tT3.group(1)\r
-    elif tT4:\r
-        ntitle=tT4.group(1)\r
-    elif tT5:\r
-        ntitle=tT5.group(1)\r
-    return ntitle\r
-def searchFile(temppath,recpath,ext):\r
-    """\r
-    録画一時フォルダ内ファイルを検索\r
-    """\r
-    avilist = glob.glob(temppath + "/*"+ext)\r
-    ret=[]\r
-    for avif in avilist:\r
-        ##b25f is title.ts.b25  avi is title.avi\r
-        dir = os.path.split(avif)[0]\r
-        title = os.path.split(avif)[1]\r
-        title = title.replace(ext, "")\r
-        avipath = os.path.join(dir, title + ext)\r
-        if os.path.exists(avipath):\r
-            dtime = time.time()-os.path.getmtime(avipath)\r
-            dtime = int(dtime)\r
-            if dtime > 300:\r
-                if veryfySize(avipath):\r
-                    ret.append(title)\r
-    return ret\r
-def getMoveDestpath(title,temppath,recpath,ext):\r
-    dstpath=os.path.join(recpath,title+ext)\r
-    srcpath=os.path.join(temppath,title+ext)\r
-    if os.path.exists(dstpath):\r
-        if not os.path.getsize(dstpath) == os.path.getsize(srcpath):\r
-            gmtime=time.gmtime(os.path.getmtime(srcpath))\r
-            iff=""\r
-            try:\r
-                iff=u"("+configreader.getConfEnv("iff")+u")_"\r
-                if iff==u"()_":\r
-                    iff = u""\r
-            except:\r
-                iff=""\r
-            title=title+u"_"+iff+time.strftime("%Y-%m-%dT%H-%M-%S",gmtime)\r
-        else:\r
-            recdblist.printutf8(u"同サイズのファイルが存在します")\r
-\r
-    return title\r
-def getDelpath(temppath,title,addfp=1):\r
-    delpath=[os.path.join(temppath,title+".ts")]\r
-    delpath.append(os.path.join(temppath,title+".avi"))\r
-    if addfp==1:\r
-        delpath.append(os.path.join(temppath,title+".mp4"))\r
-        delpath.append(os.path.join(temppath,title+".mkv"))\r
-    delpath.append(os.path.join(temppath,title+".m2v"))\r
-    delpath.append(os.path.join(temppath,title+".120.avi"))\r
-    delpath.append(os.path.join(temppath,title+".timecode.txt"))\r
-    delpath.append(os.path.join(temppath,title+".aac"))\r
-    delpath.append(os.path.join(temppath,title+".ts.b25"))\r
-    delpath.append(os.path.join(temppath,title+".ts.tsmix"))\r
-    delpath.append(os.path.join(temppath,title+".ts.log"))\r
-    delpath.append(os.path.join(temppath,title+".sa.avi"))\r
-    delpath.append(os.path.join(temppath,title+".sa.avi.log"))\r
-    delpath.append(os.path.join(temppath,title+".log"))\r
-    delpath.append(os.path.join(temppath,title+".log.zip"))\r
-    return delpath\r
-def veryfySize(path):\r
-    #vsize=[297,497,596,1196]#SD 30m 1h 1.5h 2h\r
-    vsize=[245,275,295,591,830]\r
-    vsize=vsize+[325,449,560,590,602,690,805,860,1014,1138,1237]\r
-    vsize=vsize+[261,535,540,616,740]#HD 30m 1h\r
-    #vsize=vsize+[381,895,447]\r
-    ret = 0\r
-    for size in vsize:\r
-        if os.path.getsize(path)>(size-10)*1024*1024 and os.path.getsize(path)<(size+10)*1024*1024:\r
-            ret=1\r
-    if os.path.getsize(path)>270*1024*1024:\r
-        ret=1\r
-    return ret\r
-def execMove(title,temppath,recpath,ext,autodel):\r
-    srcpath=os.path.join(temppath,title+ext)\r
-    sf=guess.searchFolder(title, recpath)\r
-    if sf!="":\r
-        destpath=os.path.join(sf,getMoveDestpath(title, temppath, sf, ext)+ext)\r
-        if os.path.exists(destpath):\r
-            if os.path.getsize(destpath) == os.path.getsize(srcpath):\r
-                recdblist.printutf8(u"同名同サイズのファイルが存在します。")\r
-                if autodel==1:\r
-                    recdblist.printutf8(u"関連ファイルを削除します。")\r
-                    delpath=getDelpath(temppath, title)\r
-                    for dp in delpath:\r
-                        try:\r
-                            os.remove(dp)\r
-                            ""\r
-                        except:\r
-                            ""\r
-        else:\r
-            recdblist.printutf8("moving now..")\r
-            recdblist.printutf8(srcpath+" : "+destpath)\r
-            print srcpath\r
-            shutil.copy(srcpath, destpath)\r
-            #shutil.copy(srcpath, destpath)\r
-            if autodel==1:\r
-                delpath=getDelpath(temppath, title)\r
-                for dp in delpath:\r
-                    try:\r
-                        os.remove(dp)\r
-                        ""\r
-                    except:\r
-                        ""\r
-def execDelete(title,temppath):\r
-    delpath=getDelpath(temppath, title,0)\r
-    recdblist.printutf8(title+u" 関連の一時ファイルを削除します")\r
-    for dp in delpath:\r
-        try:\r
-            if os.path.exists(dp):\r
-                recdblist.printutf8(dp)\r
-                os.remove(dp)\r
-        except Exception, inst:\r
-            print type(inst)\r
-            print str(inst)\r
-            print traceback.print_exc(file=sys.stdout)\r
diff --git a/dist/trunk/rec10/auto_process.py b/dist/trunk/rec10/auto_process.py
deleted file mode 100755 (executable)
index 175df6b..0000000
+++ /dev/null
@@ -1,285 +0,0 @@
-#!/usr/bin/python\r
-# coding: UTF-8\r
-# Rec10 TS Recording Tools\r
-# Copyright (C) 2009-2011 Yukikaze\r
-import os\r
-import glob\r
-import time\r
-import datetime\r
-import commands\r
-import re\r
-import os.path\r
-\r
-import chdb\r
-import status\r
-import configreader\r
-import recdblist\r
-import rec10d\r
-import tv2mp4\r
-import epgdb\r
-def updateToMP4(path):\r
-    """\r
-    !現在未使用!\r
-    録画一時フォルダ内mp4ファイルを検索\r
-    """\r
-    avilist = glob.glob(path + "/*.avi")\r
-    mkvlist = glob.glob(path+"/*.mkv")\r
-    avilist=avilist+mkvlist\r
-    for avif in avilist:\r
-        if avif.rfind("sa.avi")==-1:\r
-            dir = os.path.split(avif)[0]\r
-            title = os.path.split(avif)[1]\r
-            title = title.replace(".avi", "")\r
-            title = title.replace(".mkv", "")\r
-            avipath = os.path.join(dir, title + ".avi")\r
-            mkvpath = os.path.join(dir, title + ".mkv")\r
-            mp4path = os.path.join(dir, title + ".mp4")\r
-            if not os.path.exists(mp4path):\r
-                if os.path.exists(avipath):\r
-                    avidtime = int(time.time()-os.path.getmtime(avipath))\r
-                    if avidtime>300:\r
-                        if os.path.exists(mkvpath):\r
-                            mkvdtime = int(time.time()-os.path.getmtime(mkvpath))\r
-                            if mkvdtime>300:\r
-                                recdblist.printutf8(mkvpath+":"+mp4path)\r
-                                tv2mp4.mkv2mp4(mkvpath,mp4path)\r
-                            else:\r
-                                recdblist.printutf8(avipath+":"+mp4path)\r
-                                tv2mp4.avi2mp4(avipath,mp4path)\r
-                        else:\r
-                            recdblist.printutf8(avipath+":"+mp4path)\r
-                            tv2mp4.avi2mp4(avipath,mp4path)\r
-                else:\r
-                    if not os.path.exists(avipath):\r
-                        if os.path.exists(mkvpath):\r
-                            mkvdtime = int(time.time()-os.path.getmtime(mkvpath))\r
-                            if mkvdtime>300:\r
-                                recdblist.printutf8(mkvpath+":"+mp4path)\r
-                                tv2mp4.mkv2mp4(mkvpath,mp4path)\r
-def autoCheck(path):\r
-    avilist = glob.glob(path + "/*.avi")\r
-    mkvlist = glob.glob(path+"/*.mkv")\r
-    mp4list = glob.glob(path+"/*.mp4")\r
-    tslist = glob.glob(path+"/*.ts")\r
-    b25list = glob.glob(path+"/*.ts.b25")\r
-    filelist=avilist+mkvlist+tslist+b25list+mp4list\r
-    add=[]\r
-    tbtime=datetime.datetime.now()+datetime.timedelta(seconds=60)\r
-    tbtime2=datetime.datetime.now()+datetime.timedelta(seconds=1200)\r
-    for fn in filelist:\r
-        if os.path.exists(fn):\r
-            if fn.rfind("sa.avi")==-1 and fn.rfind(".120.avi")==-1 and os.path.getsize(fn)>1*1000*1000:\r
-                dir = os.path.split(fn)[0]\r
-                file = os.path.split(fn)[1]\r
-                title = os.path.splitext(file)[0]\r
-                title = unicode(title,'utf-8')\r
-                ext = os.path.splitext(file)[1]\r
-                if ext == ".b25":\r
-                    title=title.replace(".ts","")\r
-                dbs=rec10d.rec10db.select_by_name_time_timeline(title,tbtime,tbtime2)\r
-                if len(dbs)==0:\r
-                    proc=checkProcess(dir, title)\r
-                    chtxtt=rec10d.rec10db.select_chtxt_by_title_timeline_log(title)\r
-                    nchtxt=""\r
-                    if chtxtt!=None:\r
-                        nchtxt=chtxtt\r
-                    if proc=="b25":\r
-                        add.append([recdblist.REC_AUTO_SUGGEST_DECODE,title,nchtxt])\r
-                    elif proc=="ts":\r
-                        add.append([recdblist.REC_AUTO_SUGGEST_ENCODE,title,nchtxt])\r
-                    elif proc =="264":\r
-                        add.append([recdblist.REC_AUTO_SUGGEST_AVI2FP,title,nchtxt])\r
-                    #elif proc =="mp4":\r
-                    #    add.append([recdblist.REC_AUTO_SUGGEST_AP2FP,title,nchtxt])\r
-        #print add\r
-    if len(add)>0:\r
-        rec10d.rec10db.new_auto_proc()\r
-        for a in add:\r
-            rec10d.rec10db.add_auto_proc(a[0],a[1],a[2])\r
-        time.sleep(1)\r
-"""\r
-    処理がどの段階まで言ったのかを調査し返す。\r
-    return\r
-    recording\r
-    b25\r
-    b25decoding\r
-    tssplitting\r
-    ts\r
-    encoding\r
-    avi\r
-    mp4making\r
-    mp4\r
-"""\r
-def checkProcess(path,title):\r
-    path1 = os.path.join(path,title+".mkv")\r
-    if os.path.exists(path1):\r
-        if int(time.time()-os.path.getmtime(path1))>300:\r
-            return "mkv"\r
-        else:\r
-            return "mkvmaking"\r
-    elif os.path.exists(os.path.join(path,title+".mp4")):\r
-        if int(time.time()-os.path.getmtime(os.path.join(path,title+".mp4")))>300:\r
-            return "mp4"\r
-        else:\r
-            return "mp4making"\r
-    elif os.path.exists(os.path.join(path,title+".264")):\r
-        if int(time.time()-os.path.getmtime(os.path.join(path,title+".264")))>300:\r
-            return "264"\r
-        else:\r
-            return "encoding"\r
-    elif os.path.exists(os.path.join(path,title+".ts.log")):\r
-        if int(time.time()-os.path.getmtime(os.path.join(path,title+".ts")))<300:\r
-            return "encoding"\r
-        else:\r
-            return "ts"\r
-    elif os.path.exists(os.path.join(path,title+".ts")):\r
-        if int(time.time()-os.path.getmtime(os.path.join(path,title+".ts")))>300:\r
-            return "ts"\r
-        else:\r
-            return "tssplitting"\r
-    elif os.path.exists(os.path.join(path,title+".sa.avi")):\r
-        if int(time.time()-os.path.getmtime(os.path.join(path,title+".sa.avi")))>300:\r
-            return "ts"\r
-        else:\r
-            return "tssplitting"\r
-    elif os.path.exists(os.path.join(path,title+".ts.b25")):\r
-        if int(time.time()-os.path.getmtime(os.path.join(path,title+".ts.b25")))>300:\r
-            return "b25"\r
-        else:\r
-            return "recording"\r
-def update_all_timeline_epg():\r
-    now=datetime.datetime.now()\r
-    et=now+datetime.timedelta(days=7)\r
-    update_timeline_epg(now.strftime("%Y-%m-%d %H:%M:%S"), et.strftime("%Y-%m-%d %H:%M:%S"))\r
-def update_timeline_epg(btime,etime):\r
-    update_timeline_epg_schedule(btime,etime)\r
-    update_timeline_dup(btime,etime)\r
-def update_timeline_epg_schedule(btime,etime):\r
-    dbl=rec10d.rec10db.select_bytime_all_timeline(btime, etime)\r
-    #print dbl\r
-    for db in dbl:\r
-        ret=[]\r
-        #[chtxtt, title, btime, etime,exp,longexp,category]\r
-        if db['type']==recdblist.REC_KEYWORD or db['type']==recdblist.REC_KEYWORD_EVERY_SOME_DAYS:\r
-            ret=epgdb.searchTime(db['title'], db['btime'], db['deltatime'], db['chtxt'])\r
-            if len(ret)>4 and len(ret[2])>18:\r
-                rec10d.rec10db.update_epg_timeline(db['type'], db['chtxt'], db['title'], db['btime'], ret[2],ret[3],ret[1],ret[4],ret[6])\r
-                if not (db['btime'] == ret[2] and  db['etime']==ret[3]):\r
-                    rec10d.rec10db.update_status_change_timeline(db['type'], db['chtxt'], db['title'], db['btime'], "1")\r
-                else:\r
-                    rec10d.rec10db.update_status_change_timeline(db['type'], db['chtxt'], db['title'], db['btime'], "0")\r
-            else:\r
-                rec10d.rec10db.update_status_change_timeline(db['type'], db['chtxt'], db['title'], db['btime'], "1")\r
-        elif db['type']==recdblist.REC_RESERVE or db['type']==recdblist.REC_FINAL_RESERVE :\r
-            ret=epgdb.searchTime(db['title'], db['btime'],"5", db['chtxt'])\r
-            if len(ret)>4 and len(ret[2])>18:\r
-                rec10d.rec10db.update_epg_timeline(db['type'], db['chtxt'], db['title'], db['btime'], ret[2],ret[3],ret[1],ret[4],ret[6])\r
-                if not (db['btime'] == ret[2] and  db['etime']==ret[3]):\r
-                    rec10d.rec10db.update_status_change_timeline(db['type'], db['chtxt'], db['title'], db['btime'], "1")\r
-                else:\r
-                    rec10d.rec10db.update_status_change_timeline(db['type'], db['chtxt'], db['title'], db['btime'], "0")\r
-            else:\r
-                rec10d.rec10db.update_status_change_timeline(db['type'], db['chtxt'], db['title'], db['btime'], "1")\r
-def update_timeline_dup(epgbtime,epgetime):\r
-    dbl=rec10d.rec10db.select_byepgtime_all_timeline(epgbtime, epgetime)\r
-    for db in dbl:\r
-        if db['type']==recdblist.REC_KEYWORD or db['type']==recdblist.REC_KEYWORD_EVERY_SOME_DAYS:\r
-            dbn=epgdb.countEpgSchedule(db['epgbtime'], db['epgetime'])\r
-            try:\r
-                bctypet=chdb.searchCHFromChtxt(db['chtxt'])['bctype']\r
-                if bctypet.find("cs") > -1 or bctypet.find("bs") > -1 :\r
-                    if dbn[1]>status.getRecordingMax()[1]:\r
-                        rec10d.rec10db.update_status_dup_timeline(db['type'], db['chtxt'], db['title'], db['btime'], "1")\r
-                    else:\r
-                        rec10d.rec10db.update_status_dup_timeline(db['type'], db['chtxt'], db['title'], db['btime'], "0")\r
-                else:\r
-                    if dbn[0]>status.getRecordingMax()[0]:\r
-                        rec10d.rec10db.update_status_dup_timeline(db['type'], db['chtxt'], db['title'], db['btime'], "1")\r
-                    else:\r
-                        rec10d.rec10db.update_status_dup_timeline(db['type'], db['chtxt'], db['title'], db['btime'], "0")\r
-            except:\r
-                ""\r
-def killDeadEncode(path):\r
-    rawlist = glob.glob(path + "/*.264")\r
-    for fn in rawlist:\r
-        if int(time.time()-os.path.getmtime(fn))>3000:\r
-            m2vpath=unicode(fn.replace(".264",".m2v"),'utf-8')\r
-            x264path=os.path.split(fn)[1]\r
-            folderpath=unicode(os.path.split(fn)[0],'utf-8')\r
-            x264path=re.sub("\\[","[",x264path)\r
-            x264path=re.sub("\[","\\\[",x264path)\r
-            x264path=re.sub("\\]","]",x264path)\r
-            x264path=re.sub("]","\\]",x264path)\r
-            tspath=unicode(x264path.replace(".264",".ts"),'utf-8')\r
-            m2vpath=unicode(x264path.replace(".264",".m2v"),'utf-8')\r
-            x264path=unicode(x264path,'utf-8')\r
-            os.environ['LANG']="ja_JP.UTF-8"\r
-            ktmp=[]\r
-            ktmp.append(u"ps auxww | grep \""+folderpath+"\" | grep \""+x264path+u"\" | egrep -v grep | egrep -v \"sh -c\" | grep x264 | awk '{print $2}'")\r
-            ktmp.append(u"ps auxww | grep \""+folderpath+"\" | grep \""+tspath+u"\" | egrep -v grep | egrep -v \"sh -c\" | grep mencoder | awk '{print $2}'")\r
-            ktmp.append(u"ps auxww | grep \""+folderpath+"\" | grep \""+m2vpath+u"\" | egrep -v grep | egrep -v \"sh -c\" | grep ffmpeg | awk '{print $2}'")\r
-            recdblist.printutf8(u"エンコード処理異常終了タスク終了")\r
-            for istr in ktmp:\r
-                recdblist.printutf8(istr)\r
-                ktmt=commands.getoutput(istr.encode('utf-8'))\r
-                #print ktmt\r
-                #print len(ktmt)\r
-                if len(ktmt)>0:\r
-                    #print ktmt\r
-                    if len(ktmt[0])>0:\r
-                        ktmt=ktmt[0]\r
-                    #print ktmt\r
-                try:\r
-                    if int(ktmt)>0:\r
-                        ktmp=u"kill -9 `"+istr+u"`"\r
-                        recdblist.printutf8(ktmp)\r
-                        #print ktmp\r
-                        os.system(ktmp.encode('utf-8'))\r
-                except:\r
-                    ""\r
-def deleteTmpFile(path,title,ext):\r
-    level= 0##0:b25 1:ts(del tsmix and ts.b25) 5:x264(del 2 and so on) 10:mp4/mkv\r
-    smsize= 0\r
-    if re.search(".ts",ext):\r
-        level= 1\r
-        smsize = 100*1000*1000\r
-    elif re.search(".264",ext):\r
-        level= 5\r
-        smsize = 10*1000*1000\r
-    elif re.search(".mp4",ext):\r
-        level = 10\r
-        smsize = 10*1000*1000\r
-    elif re.search(".mkv",ext):\r
-        level = 15\r
-        smsize = 10*1000*1000\r
-    dp=[]\r
-    if level > 0 :\r
-        if os.path.exists(os.path.join(path,title+".ts")) and os.path.exists(os.path.join(path,title+".ts.b25")):\r
-            if os.path.getsize(os.path.join(path,title+".ts"))*12>os.path.getsize(os.path.join(path,title+".ts.b25")):\r
-                dp.append(os.path.join(path,title+".ts.b25"))\r
-            elif os.path.getsize(os.path.join(path,title+".ts"))>200*1000*1000:\r
-                dp.append(os.path.join(path,title+".ts.b25"))\r
-    if level > 4 :\r
-        if configreader.getConfEnv("remove_ts")=="1":\r
-            dp.append(os.path.join(path,title+".ts"))\r
-    if level > 9 :\r
-        dp.append(os.path.join(path,title+".avi"))\r
-        dp.append(os.path.join(path,title+".264"))\r
-        dp.append(os.path.join(path,title+".120.avi"))\r
-        dp.append(os.path.join(path,title+".noodml.avi"))\r
-        dp.append(os.path.join(path,title+".aac"))\r
-        dp.append(os.path.join(path,title+".m2v"))\r
-        dp.append(os.path.join(path,title+"_1.aac"))\r
-        dp.append(os.path.join(path,title+"_2.aac"))\r
-        dp.append(os.path.join(path,title+"_1.mp3"))\r
-        dp.append(os.path.join(path,title+"_2.mp3"))\r
-        dp.append(os.path.join(path,title+".srt"))\r
-    if level > 14 :\r
-        dp.append(os.path.join(path,title+".mp4"))\r
-    if os.path.exists(os.path.join(path,title+ext)):\r
-        if os.path.getsize(os.path.join(path,title+ext))>smsize:\r
-            for ip in dp:\r
-                try:\r
-                    os.remove(ip)\r
-                except:\r
-                    ""\r
diff --git a/dist/trunk/rec10/auto_rec.py b/dist/trunk/rec10/auto_rec.py
deleted file mode 100755 (executable)
index 5e4b8d5..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-#!/usr/bin/python
-# coding: UTF-8
-# Rec10 TS Recording Tools
-# Copyright (C) 2009-2011 Yukikaze
-import n_gram
-import rec10d
-def getDBKey(key,chtxt):
-    return rec10d.rec10db.select_by_key_in_auto_bayes_key(key, chtxt)
-def changeDBEpg(chtxt,beforenum,newnum):
-    rec10d.rec10db.change_ratio_all_reduce_in_auto_bayes_key(chtxt, beforenum, newnum)
-def changeDBNum(chtxt,recaddnum,alladdnum):
-    """
-    add num.(Not change)
-    """
-    rec10d.rec10db.add_num_in_auto_bayes_key(chtxt, recaddnum,alladdnum)
-def changeDBRatioRec(key,chtxt,beforenum,addnum):
-    rec10d.rec10db.change_ratio_rec_in_auto_bayes_key(key, chtxt, beforenum, addnum)
-def changeDBRatioMultiRec(chtxt,beforenum,list):
-    rec10d.rec10db.change_multi_ratio_rec_in_auto_bayes_key(chtxt, beforenum, list)
-def changeDBReduceRatioRec(chtxt,beforenum,addnum):
-    rec10d.rec10db.change_ratio_rec_reduce_in_auto_bayes_key(chtxt, beforenum, addnum)
-def changeDBRatioAll(key,chtxt,beforenum,addnum):
-    rec10d.rec10db.change_ratio_all_in_auto_bayes_key(key, chtxt, beforenum, addnum)
-def changeDBRatioMultiAll(chtxt,beforenum,list):
-    rec10d.rec10db.change_multi_ratio_all_in_auto_bayes_key(chtxt,beforenum, list)
-def getDBNum(chtxt):
-    ret=getDBKey("NUM", chtxt)
-    if len(ret)<3:
-        rec10d.rec10db.add_in_auto_bayes_key("NUM", chtxt, 1,1)
-        ret=getDBKey("NUM", chtxt)
-    return ret
-def updateRecall(chtxt,titles,descs,newnum):
-    """
-    update recall
-    """
-    titles=" "+titles+" "
-    descs=" "+descs+" "
-    str1=titles*2+descs+titles*2
-    noun=n_gram.getNounQuadGram(str1)
-    bnum=getDBNum(chtxt)[3]
-    if bnum<1:
-        bnum=100
-    changeDBRatioMultiAll(chtxt, bnum,noun)
-    changeDBEpg(chtxt, bnum, newnum)
-    changeDBNum(chtxt, 0, newnum)
-def addKey(chtxt,title,desc):
-    title=u" "+title+u" "
-    desc=u" "+desc+u" "
-    str1=title*2+desc+title*2##タイトルは重視したいので幾度か足す。
-    noun=n_gram.getNounQuadGram(str1)#nounは辞書のキーに文字を、中身に出現回数を書いたもの。
-    bnum=getDBNum(chtxt)[2]
-    if bnum<1:
-        bnum=1
-    changeDBRatioMultiRec(chtxt, bnum, noun)
-    changeDBNum(chtxt,1,0)
-    changeDBReduceRatioRec(chtxt, bnum,1)
-def calcKey(chtxt,title,desc):
-    """
-
-    """
-    title=u" "+title+u" "
-    desc=u" "+desc+u" "
-    str1=title*2+desc+title*2##タイトルは重視したいので幾度か足す。
-    noun=n_gram.getNounQuadGram(str1)#nounは辞書のキーに文字を、中身に出現回数を書いたもの。
-    tnum=1
-    nump=0
-    for key,num in noun.items():
-        pp=getDBKey(key,chtxt)
-        pp2=getDBKey(key,"ALL")
-        if len(pp)>3:
-            tarec=0
-            taall=0
-            if len(pp2)>3:
-                tarec=pp2[2]
-                taall=pp2[3]
-            trec=pp[2]
-            tall=pp[3]
-            
-            tnum=tnum+1
-            p=(1000*trec+5)/(1000*tall+5)
-            p=p*p*100
-            p2=(1000*tarec+5)/(1000*taall+5)
-            p2=p2*100
-            nump=nump+p+p2
-    return int(nump/tnum)
diff --git a/dist/trunk/rec10/auto_test.py b/dist/trunk/rec10/auto_test.py
deleted file mode 100755 (executable)
index 0a81861..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/usr/bin/python\r
-# coding: UTF-8\r
-# Rec10 TS Recording Tools\r
-# Copyright (C) 2009-2011 Yukikaze\r
-import os\r
-import os.path\r
-import time\r
-import optparse\r
-import sys\r
-import datetime\r
-\r
-import configreader\r
-import chdb\r
-import tv2mp4\r
-import tv2ts\r
-def testAllCHEncode(option,stime):\r
-    chl=chdb.getAllCH()\r
-    print chl\r
-    path= configreader.getConfPath("test")\r
-    tpath=os.path.join(path, "encode_test")\r
-    if not os.path.exists(tpath):\r
-        os.mkdir(tpath)\r
-    dnowt=datetime.datetime.now().strftime("%Y-%m-%d_%H-%M-%S")+"_"+option+""\r
-    tpatht=os.path.join(tpath,dnowt)\r
-    if not os.path.exists(tpatht):\r
-        os.mkdir(tpatht)\r
-    if len(chl)>0:\r
-        for t in chl:\r
-            print t\r
-            pathname=os.path.join(tpatht,t['chtxt'])\r
-            print pathname\r
-            tv2ts.tv2ts(pathname+".ts",t['ch'],t['csch'], stime)\r
-            tv2mp4.ts2mp4(pathname+".ts", pathname+".mp4", option)\r
-            time.sleep(2)\r
-if __name__ == "__main__":\r
-    usage="usage: "\r
-    version="%prog 0.9.7"\r
-    parser=optparse.OptionParser(usage=usage,version=version)\r
-    parser.add_option("-e","--Encode",action="store",type="string",dest="encode_option",default="",metavar="TITLE",help="encode test(option)")\r
-    (opts,args)=parser.parse_args(sys.argv)\r
-    if opts.encode_option != "":##-sの場合\r
-        print "test_all_ch_encode"\r
-        testAllCHEncode(opts.encode_option, "10")\r
diff --git a/dist/trunk/rec10/chdata.py b/dist/trunk/rec10/chdata.py
deleted file mode 100755 (executable)
index 861719b..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/usr/bin/python\r
-# coding: UTF-8\r
-# Rec10 TS Recording Tools\r
-# Copyright (C) 2009-2011 Yukikaze\r
-import os.path\r
-import configreader\r
-import xml.dom.minidom\r
-import scan_ch\r
-import datetime\r
-\r
-import rec10d\r
-\r
-path = str(os.path.dirname(os.path.abspath(__file__))) + "/"\r
-\r
-def chAdd(bctype, chtxt, ch, csch):#すべて文字列\r
-    tnow=datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")\r
-    rec10d.rec10db.add_epg_ch(bctype,chtxt, ch, csch, u"2010-01-01 00:00:00",u"2010-01-01 00:00:00",tnow)\r
-def addCHlist(cl):\r
-    if len(cl)>0:\r
-        for c in cl:\r
-            chAdd(c[0],c[1],c[2],c[3])\r
-def getChList(xmlpath):\r
-    dom=xml.dom.minidom.parse(file(xmlpath))\r
-    chlist=[]\r
-    for ch in dom.getElementsByTagName('channel'):\r
-        bctype=ch.getAttribute("bctype")\r
-        chd=ch.getAttribute("ch")\r
-        csch=ch.getAttribute("csch")\r
-        chtxt=ch.getAttribute("chtxt")\r
-        ontv=ch.getAttribute("ontvcode")\r
-        chlist.append([bctype,ontv,chtxt,chd,csch])\r
-    return chlist\r
-def deleteChListALL():\r
-    rec10d.rec10db.new_epg_ch()\r
-if __name__ == "__main__":\r
-    deleteChListALL()\r
-    scan_ch.searchCh()\r
diff --git a/dist/trunk/rec10/chdb.py b/dist/trunk/rec10/chdb.py
deleted file mode 100755 (executable)
index b53c220..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-#!/usr/bin/python\r
-# coding: UTF-8\r
-# Rec10 TS Recording Tools\r
-# Copyright (C) 2009-2011 Yukikaze\r
-    # モジュール属性 argv を取得するため\r
-import rec10d\r
-\r
-def searchCHFromChtxt(chtxtin):\r
-    chtxtt=chtxtin.replace("_0","_%")\r
-    ret = []\r
-    for datum in rec10d.rec10db.select_by_chtxt_epg_ch(chtxtt):\r
-        rett = {'bctype':datum[0], 'chtxt':datum[1], 'ch':datum[2], 'csch':datum[3], 'update':datum[4], 'chname':datum[5], 'visible':datum[7]}\r
-        ret.append(rett)\r
-    if len(ret) == 0:\r
-        ret.append(None)\r
-    return ret[0]\r
-def searchCHFromBctype(bctypein):\r
-    ret = []\r
-    for datum in rec10d.rec10db.select_by_bctype_epg_ch(bctypein):\r
-        rett = {'bctype':datum[0], 'chtxt':datum[1], 'ch':datum[2], 'csch':datum[3], 'update':datum[4], 'chname':datum[5], 'visible':datum[7]}\r
-        ret.append(rett)\r
-    if len(ret) == 0:\r
-        ret.append(None)\r
-    return ret[0]\r
-def searchCHFromCh(chin):\r
-    ret = []\r
-    for datum in rec10d.rec10db.select_by_ch_epg_ch(chin):\r
-        rett = {'bctype':datum[0], 'chtxt':datum[1], 'ch':datum[2], 'csch':datum[3], 'update':datum[4], 'chname':datum[5], 'visible':datum[7]}\r
-        ret.append(rett)\r
-    if len(ret) == 0:\r
-        ret.append(None)\r
-    return ret[0]\r
-def searchCHFromCsch(cschin):\r
-    ret = []\r
-    for datum in rec10d.rec10db.select_by_csch_epg_ch(cschin):\r
-        rett = {'bctype':datum[0], 'chtxt':datum[1], 'ch':datum[2], 'csch':datum[3], 'update':datum[4], 'chname':datum[5], 'visible':datum[7]}\r
-        ret.append(rett)\r
-    if len(ret) == 0:\r
-        ret.append(None)\r
-    return ret[0]\r
-def searchAllCHFromCh(chin):\r
-    ret = []\r
-    for datum in rec10d.rec10db.select_by_ch_epg_ch(chin):\r
-        rett = {'bctype':datum[0], 'chtxt':datum[1], 'ch':datum[2], 'csch':datum[3], 'update':datum[4], 'chname':datum[5], 'visible':datum[7]}\r
-        ret.append(rett)\r
-    if len(ret) == 0:\r
-        ret.append(None)\r
-    return ret\r
-def getAllCH():\r
-    ret = []\r
-    for datum in rec10d.rec10db.select_all_epg_ch():\r
-        rett = {'bctype':datum[0], 'chtxt':datum[1], 'ch':datum[2], 'csch':datum[3], 'update':datum[4], 'chname':datum[5], 'visible':datum[7]}\r
-        ret.append(rett)\r
-    if len(ret) == 0:\r
-        ret.append(None)\r
-    return ret\r
-def update():\r
-    ret = []\r
-    CSupdate = 0\r
-    CS2update = 0\r
-    BSupdate = 0\r
-    rec10d.rec10db.set_new_status("8")\r
-    for datum in rec10d.rec10db.select_get_update_epg_ch("6"):\r
-        bctype = datum[0]\r
-        if bctype == "cs1" or bctype == u"cs1":\r
-            if CSupdate == 0:\r
-                ret.append(u"cs1")\r
-                CSupdate = 1\r
-        elif bctype == "cs2" or bctype == u"cs2":\r
-            if CS2update == 0:\r
-                ret.append(u"cs2")\r
-                CS2update = 1\r
-        elif bctype == "bs" or bctype == u"bs":\r
-            if BSupdate == 0:\r
-                ret.append(u"bs")\r
-                BSupdate = 1\r
-        else:\r
-            ret.append(bctype)\r
-    return ret\r
-def changeCHShow(chtxt,isshow):\r
-    rec10d.rec10db.change_visible_epg_ch(chtxt, isshow)\r
-def updateLogo():\r
-    ret=[]\r
-    BSCSUpdate=0\r
-    for datum in rec10d.rec10db.select_get_updatelogo_epg_ch("720"):\r
-        bctype=datum[0]\r
-        if bctype == "cs1" or bctype == u"cs1":\r
-            if BSCSUpdate==0:\r
-                ret.append(u"bs")\r
-                BSCSUpdate=1\r
-        elif bctype == "cs2" or bctype == u"cs2":\r
-            if BSCSUpdate==0:\r
-                ret.append(u"bs")\r
-                BSCSUpdate=1\r
-        elif bctype == "bs" or bctype == u"bs":\r
-            if BSCSUpdate==0:\r
-                ret.append(u"bs")\r
-                BSCSUpdate=1\r
-        else:\r
-            ret.append(bctype)\r
-    return ret\r
diff --git a/dist/trunk/rec10/checker.py b/dist/trunk/rec10/checker.py
deleted file mode 100755 (executable)
index 4e9bcc0..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-#!/usr/bin/python
-# coding: UTF-8
-# Rec10 TS Recording Tools
-# Copyright (C) 2009-2011 Yukikaze
-import os
-import os.path
-import time
-
-def checkB25Decode(b25filepath, decodedfilepath , csch):
-    ret = 0
-    if os.path.isfile(decodedfilepath):##tsファイルが存在している
-        dtime = time.time()-os.path.getmtime(decodedfilepath)
-        dtime = int(dtime)
-        if dtime > 20:
-            if csch>0:
-                if (compareFilesize(b25filepath, decodedfilepath, 10) and minimizeCheck(decodedfilepath, 800)):
-                    ret = 1
-            else:
-                if (compareFilesize(b25filepath, decodedfilepath, 60) and minimizeCheck(decodedfilepath, 800)):
-                    ret = 1
-        else:
-            time.sleep(30)
-            dtime = time.time()-os.path.getmtime(decodedfilepath)
-            dtime = int(dtime)
-            if dtime > 20:
-                if csch>0:
-                    if (compareFilesize(b25filepath, decodedfilepath, 10) and minimizeCheck(decodedfilepath, 800)):
-                        ret = 1
-                else:
-                    if (compareFilesize(b25filepath, decodedfilepath, 60) and minimizeCheck(decodedfilepath, 800)):
-                        ret = 1
-    #recdblist.printutf8("deleting b25 is " + str(ret))
-    return ret
-def compareFilesize(pathbase, path, percentage):
-    """
-    return true if size of path is larger than that of pathbase.
-    percentage is int(0< <100)
-    """
-    if not os.path.exists(pathbase):
-        return 0
-    basesize = os.path.getsize(pathbase)
-    pathsize = os.path.getsize(path)
-    size = pathsize * 100-basesize * percentage
-    if size < 0:
-        return 0
-    else:
-        return 1
-def minimizeCheck(filepath, minsize):
-    """
-    minsize is Megabytes
-    """
-    if os.path.getsize(filepath) > minsize * 1000 * 1000:
-        return 1
-    else:
-        return 0
diff --git a/dist/trunk/rec10/classify.py b/dist/trunk/rec10/classify.py
deleted file mode 100755 (executable)
index 29c72ee..0000000
+++ /dev/null
@@ -1,143 +0,0 @@
-#!/usr/bin/python\r
-# coding: UTF-8\r
-# Rec10 TS Recording Tools\r
-# Copyright (C) 2009-2011 Yukikaze\r
-\r
-import os\r
-import os.path\r
-import optparse\r
-import sys\r
-\r
-import configreader\r
-import recdblist\r
-import auto_move\r
-import guess\r
-recordedpath=unicode(configreader.getConfPath("recorded"),'utf-8')\r
-recpath=unicode(configreader.getConfPath("recpath"),'utf-8')\r
-\r
-if __name__ == "__main__":\r
-    usage="usage: %prog read -h"\r
-    version="%prog 0.9.4"\r
-    parser=optparse.OptionParser(usage=usage,version=version)\r
-    parser.add_option("-s","--search",action="store",type="string",dest="ltitle",default="",metavar="TITLE",help="test to search where the title should be contained(test for -e)")\r
-    parser.add_option("-A","--Auto",action="store_true",dest="auto",default=False,help="auto classifying mode(not a test)")\r
-    parser.add_option("-D","--Delete",action="store_true",dest="delete",default=False,help="auto delete tempfile mode(not a test)")\r
-    parser.add_option("-e","--exec",action="store",type="string",dest="etitle",default="",metavar="TITLE",help="exec move(not a test)")\r
-    parser.add_option("-l","--list",action="store_true",dest="list",default=False,help="File listing mode(test for -A)")\r
-    parser.add_option("-t","--tssearch",action="store_true",dest="tssearch",default=False,help="Ts move auto search")\r
-    parser.add_option("-T","--Tsmove",action="store_true",dest="tsmove",default=False,help="Ts auto move.")\r
-    parser.add_option("-S","--SeriesNum",action="store",type="string",dest="seriespath",default="",metavar="TITLE",help="Search Series Number in the path.")\r
-    #parser.add_option("-f","--filenumlist",action="store_true",dest="filenumlist",default=False,help="Guess Program Number.")\r
-\r
-    (opts,args)=parser.parse_args(sys.argv)\r
-    if opts.ltitle!="":##-sの場合\r
-        ltitle=unicode(opts.ltitle,'utf-8')\r
-        sf=guess.searchFolder(ltitle, recordedpath)\r
-        print "###MKV###"\r
-        recdblist.printutf8(os.path.join(sf, auto_move.getMoveDestpath(ltitle,recpath,sf,".mkv")+".mkv"),verbose_level=100)\r
-        print "\n"\r
-        print "###MP4###"\r
-        recdblist.printutf8(os.path.join(sf, auto_move.getMoveDestpath(ltitle,recpath,sf,".mp4")+".mp4"),verbose_level=100)\r
-        print "\n"\r
-    elif opts.auto:##-A の場合\r
-        sa=auto_move.searchFile(recpath, recordedpath, ".mkv")\r
-        for t in sa:\r
-            recdblist.printutf8(u"自動推測実行中-MKV",verbose_level=100)\r
-            sf=guess.searchFolder(t,recordedpath)\r
-            if sf!="":\r
-                recdblist.printutf8(u"移動先",verbose_level=100)\r
-                recdblist.printutf8(t+" : "+os.path.join(sf, auto_move.getMoveDestpath(t, recpath,sf,".mkv")+".mkv"),verbose_level=100)\r
-                recdblist.printutf8(u"実行中",verbose_level=100)\r
-                auto_move.execMove(t, recpath, recordedpath,".mkv",1)\r
-            else:\r
-                recdblist.printutf8(t+" can't find matching folder",verbose_level=100)\r
-        sa=auto_move.searchFile(recpath, recordedpath, ".mp4")\r
-        for t in sa:\r
-            recdblist.printutf8(u"自動推測実行中-MP4",verbose_level=100)\r
-            sf=guess.searchFolder(t,recordedpath)\r
-            if sf!="":\r
-                recdblist.printutf8(u"移動先",verbose_level=100)\r
-                recdblist.printutf8(t+" : "+os.path.join(sf, auto_move.getMoveDestpath(t, recpath,sf,".mp4")+".mp4"),verbose_level=100)\r
-                recdblist.printutf8(u"実行中",verbose_level=100)\r
-                auto_move.execMove(t, recpath, recordedpath,".mp4",1)\r
-            else:\r
-                recdblist.printutf8(t+" can't find matching folder",verbose_level=100)\r
-    elif opts.delete:##-Dの場合\r
-        sa=auto_move.searchFile(recpath, recordedpath,".mkv")\r
-        for t in sa:\r
-            auto_move.execDelete(t, recpath)\r
-        sa=auto_move.searchFile(recpath, recordedpath,".mp4")\r
-        for t in sa:\r
-            auto_move.execDelete(t, recpath)\r
-    elif opts.list:##-lの場合\r
-        sa=auto_move.searchFile(recpath, recordedpath,".mkv")\r
-        for t in sa:\r
-            sf=guess.searchFolder(t,recordedpath)\r
-            if sf!="":\r
-                recdblist.printutf8(t+u" : "+os.path.join(sf, auto_move.getMoveDestpath(t, recpath,sf,".mkv")+".mkv"),verbose_level=100)\r
-        sa=auto_move.searchFile(recpath, recordedpath,".mp4")\r
-        for t in sa:\r
-            sf=guess.searchFolder(t,recordedpath)\r
-            if sf!="":\r
-                recdblist.printutf8(t+u" : "+os.path.join(sf, auto_move.getMoveDestpath(t, recpath,sf,".mp4")+".mp4"),verbose_level=100)\r
-    elif opts.etitle!="":\r
-        if os.path.exists(os.path.join(recpath, etitle+".mkv")):\r
-            auto_move.execMove(etitle,recpath, recordedpath,".mkv",1)\r
-        elif os.path.exists(os.path.join(recpath, etitle+".mp4")):\r
-            auto_move.execMove(etitle,recpath, recordedpath,".mp4",1)\r
-    elif opts.tssearch:## -tの場合\r
-        tsmovepath=""\r
-        try:\r
-            tsmovepath=unicode(configreader.getConfPath("ts_movepath"),'utf-8')\r
-        except:\r
-            ""\r
-        if tsmovepath!="":\r
-            sa=auto_move.searchFile(recpath, tsmovepath,".ts")\r
-            for t in sa:\r
-                sf=guess.searchFolder(t,tsmovepath,700)\r
-                if sf!="":\r
-                    recdblist.printutf8(t+u" : "+os.path.join(sf, auto_move.getMoveDestpath(t, recpath,sf,".ts")+".ts"))\r
-                    print "\n"\r
-            sa=auto_move.searchFile(recpath, tsmovepath,".ts")\r
-        else:\r
-            recdblist.printutf8(u"ts_movepathが設定されていません。/etc/rec10.confを設定してください。",verbose_level=100)\r
-    elif opts.tsmove:##-Tの場合\r
-        tsmovepath=""\r
-        try:\r
-            tsmovepath=unicode(configreader.getConfPath("ts_movepath"),'utf-8')\r
-        except:\r
-            ""\r
-        if tsmovepath!="":\r
-            sa=auto_move.searchFile(recpath, tsmovepath,".ts")\r
-            for t in sa:\r
-                sf=guess.searchFolder(t,tsmovepath,700)\r
-                if sf!="":\r
-                    recdblist.printutf8(u"移動先",verbose_level=100)\r
-                    recdblist.printutf8(t+" : "+os.path.join(sf, auto_move.getMoveDestpath(t, recpath,sf,".ts")+".ts"),verbose_level=100)\r
-                    recdblist.printutf8(u"実行中",verbose_level=100)\r
-                    auto_move.execMove(t, recpath, tsmovepath,".ts",0)\r
-            sa=auto_move.searchFile(recpath, tsmovepath,".ts")\r
-        else:\r
-            recdblist.printutf8(u"ts_movepathが設定されていません。/etc/rec10.confを設定してください。",verbose_level=100)\r
-    elif opts.seriespath!="":##-Sの場合##与えられたパスにシリーズがそろっているかを調べる。\r
-        ss=guess.detSeriesNum(opts.seriespath)\r
-        for sstitle, ssv in ss.iteritems():\r
-            if len(ssv)>0:\r
-                maxt=0\r
-                bt=0\r
-                alr=[]\r
-                for ssi,ssiv in ssv.iteritems():\r
-                    alr.append(ssi)\r
-                    if maxt<ssi:\r
-                        maxt=ssi\r
-                alr=list(set(alr))\r
-                alr.sort()\r
-                alr.reverse()\r
-                nuke=""\r
-                for i in xrange(1,maxt+1,1):\r
-                    if alr.count(i)==0:\r
-                        nuke=nuke+str(i)+","\r
-                if len(nuke)==0:\r
-                    recdblist.printutf8(sstitle+" "+str(maxt))\r
-                else:\r
-                    recdblist.printutf8(u"**"+sstitle+" |"+str(maxt)+"| "+nuke)\r
diff --git a/dist/trunk/rec10/configreader.py b/dist/trunk/rec10/configreader.py
deleted file mode 100755 (executable)
index cf1eee5..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/usr/bin/python\r
-# coding: UTF-8\r
-# Rec10 TS Recording Tools\r
-# Copyright (C) 2009-2011 Yukikaze\r
-import ConfigParser\r
-import os\r
-import os.path\r
-mypath = str(os.path.dirname(os.path.abspath(__file__)))\r
-confp = ConfigParser.SafeConfigParser()\r
-Conf = 'rec10.conf'\r
-confpath=""\r
-if os.path.exists(os.path.join(mypath,Conf)):\r
-    confpath=os.path.join(mypath,Conf)\r
-elif os.path.exists(os.path.join("/etc","rec10.conf")):\r
-    confpath=os.path.join("/etc","rec10.conf")\r
-elif os.path.exists(os.path.join("/etc/rec10","rec10.conf")):\r
-    confpath=os.path.join("/etc/rec10","rec10.conf")\r
-confp.read(confpath)\r
-def getConfPath(string):\r
-    global confp\r
-    return confp.get('path', string)\r
-def getConfDB(string):\r
-    global confp\r
-    return confp.get('db', string)\r
-def getConfEnv(string):\r
-    global confp\r
-    return confp.get('env', string)\r
-def getConfLog(string):\r
-    global confp\r
-    return confp.get('log', string)\r
diff --git a/dist/trunk/rec10/configwriter.py b/dist/trunk/rec10/configwriter.py
deleted file mode 100755 (executable)
index aa67867..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/python\r
-# coding: UTF-8\r
-# Rec10 TS Recording Tools\r
-# Copyright (C) 2009-2011 Yukikaze\r
-import ConfigParser\r
-import os\r
-import os.path\r
-mypath = str(os.path.dirname(os.path.abspath(__file__)))\r
-confp = ConfigParser.SafeConfigParser()\r
-Conf = 'rec10.conf'\r
-confpath=os.path.join(mypath,Conf)\r
-confp.read(confpath)\r
-def getTempConfPath(string):\r
-    global confp\r
-    return confp.get('path', string)\r
-def setTempConfPath(option,value):\r
-    global confp\r
-    return confp.set('path',option,value)\r
-def setTempConfDB(option,value):\r
-    global confp\r
-    return confp.set('db',option,value)\r
-def setTempConfEnv(option,value):\r
-    global confp\r
-    return confp.set('env',option,value)\r
-def writeTempConf():\r
-    global confp\r
-    f=open(confpath,"w")\r
-    confp.write(f)\r
-    f.close\r
diff --git a/dist/trunk/rec10/dbMySQL.py b/dist/trunk/rec10/dbMySQL.py
deleted file mode 100755 (executable)
index 8a88b6e..0000000
+++ /dev/null
@@ -1,1323 +0,0 @@
-#!/usr/bin/python
-# coding: UTF-8
-# Rec10 TS Recording Tools
-# Copyright (C) 2009-2011 Yukikaze
-import MySQLdb
-import recdblist
-import warnings
-import traceback
-
-from decimal import Decimal
-class DB_MySQL:
-    dbname = ""
-    dbhost = ""
-    dbusr = ""
-    dbpasswd = ""
-    dbport = 0
-    def __init__(self, dbname, user, passwd, host="localhost", port=3306):
-        warnings.filterwarnings('ignore', "Data truncated for column")
-        self.dbname = dbname
-        self.dbhost = host
-        self.dbusr = user
-        self.dbpasswd = passwd
-        self.dbport = port
-        try:
-            con = MySQLdb.connect(user=user, passwd=passwd)
-            cur = con.cursor()
-            cur.execute('CREATE DATABASE ' + dbname + " DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;")
-            cur.close()
-            con.close()
-        except Exception, inst:
-            if not ((type(inst)==MySQLdb.ProgrammingError and inst[0]==1007)or(type(inst)==MySQLdb.OperationalError and inst[0]==1050)):
-                recdblist.addCommonlogEX("Error", "init (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
-        db = self.connect_db()
-        try:
-            db[1].execute('\
-            CREATE TABLE timeline \
-            (\
-            id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,\
-            type VARCHAR(40),\
-            chtxt VARCHAR(40),\
-            title VARCHAR(100),\
-            btime DATETIME,\
-            etime DATETIME,\
-            deltatime VARCHAR(5),\
-            deltaday VARCHAR(5),\
-            opt VARCHAR(20),\
-            epgtitle VARCHAR(100),\
-            epgbtime DATETIME,\
-            epgetime DATETIME,\
-            epgduplicate TINYINT DEFAULT 0,\
-            epgchange TINYINT DEFAULT 0,\
-            epgexp VARCHAR(200),\
-            epgcategory VARCHAR(100),\
-            counter TINYINT DEFAULT -1,\
-            UNIQUE uni (type,chtxt,title,btime,deltaday)\
-            )')
-        except Exception, inst:
-            if not ((type(inst)==MySQLdb.ProgrammingError and inst[0]==1007)or(type(inst)==MySQLdb.OperationalError and inst[0]==1050)):
-                recdblist.addCommonlogEX("Error", "init (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
-        self.close_db(db)
-        self.new_epg_timeline("")
-        self.new_in_timeline_log()
-        self.new_in_auto_bayes_key()
-        self.new_in_auto_jbk_key()
-        self.new_in_status()
-        self.new_in_settings()
-        self.new_auto_timeline_bayes()
-        self.new_auto_timeline_keyword()
-    def connect_db(self):
-        """
-        dbへの接続
-        """
-        con = MySQLdb.connect(db=self.dbname, host=self.dbhost, port=self.dbport, user=self.dbusr, passwd=self.dbpasswd, charset="utf8")
-        cur = con.cursor()
-        try:
-            con.autocommit(1)
-        except:
-            ""
-        cur.execute('set names utf8;')
-        return [con, cur]
-    def close_db(self, db):
-        db[1].close()
-        db[0].close()
-    def new_epg_ch(self):
-        db = self.connect_db()
-        try:
-            db[1].execute('drop table epg_ch')
-        except Exception, inst:
-            if not ((type(inst)==MySQLdb.ProgrammingError and inst[0]==1007)or(type(inst)==MySQLdb.OperationalError and (inst[0]==1050 or inst[0]==1051))):
-                recdblist.addCommonlogEX("Error", "new_epg_ch drop (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
-
-        try:
-            db[1].execute('\
-            CREATE TABLE epg_ch \
-            (\
-            bctype VARCHAR(15),\
-            chtxt VARCHAR(20) PRIMARY KEY,\
-            ch VARCHAR(20),\
-            csch VARCHAR(20),\
-            chname VARCHAR(100),\
-            updatetime DATETIME,\
-            status TINYINT,\
-            visible TINYINT DEFAULT 1,\
-            logo0 BLOB,\
-            logo1 BLOB,\
-            logo2 BLOB,\
-            logo3 BLOB,\
-            logo4 BLOB,\
-            logo5 BLOB,\
-            logoupdate DATETIME,\
-            logostatus TINYINT DEFAULT 2,\
-            scanupdate DATETIME\
-            )')
-        except Exception, inst:
-            if not ((type(inst)==MySQLdb.ProgrammingError and inst[0]==1007)or(type(inst)==MySQLdb.OperationalError and inst[0]==1050)):
-                recdblist.addCommonlogEX("Error", "new_epg_ch (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
-
-        self.close_db(db)
-    def add_epg_ch(self, bctype, chtxt, ch, csch, updatetime,logoupdate,scanupdate):
-        db = self.connect_db()
-        db[1].execute('\
-        INSERT INTO epg_ch (bctype,chtxt,ch,csch,chname,updatetime,status,visible,logoupdate,scanupdate)\
-        VALUES (%s,%s,%s,%s,"",%s,%s,%s,%s,%s)', \
-                      (bctype, chtxt, ch, csch, updatetime, "1","1",logoupdate,scanupdate))
-        self.close_db(db)
-    def delete_all_epg_ch(self):
-        db = self.connect_db()
-        db[1].execute('\
-        DROP TABLE epg_ch ')
-        self.close_db(db)
-    def select_by_chtxt_epg_ch(self, chtxt):
-        db = self.connect_db()
-        dbexe = db[1].execute("\
-        SELECT bctype,chtxt,ch,csch,updatetime,chname,status,visible,logoupdate,scanupdate \
-        FROM epg_ch \
-        WHERE chtxt LIKE %s", \
-                              (chtxt,))
-        ret = []
-        dls = []
-        if dbexe > 0:
-            dls = db[1].fetchall()
-        self.close_db(db)
-        for dl in dls:
-            r = list(dl)
-            r[4] = r[4].strftime("%Y-%m-%d %H:%M:%S")
-            if r[8]!=None:
-                r[8] = r[8].strftime("%Y-%m-%d %H:%M:%S")
-            else:
-                r[8]="2011-04-01 00:00:00"
-            r[9] = r[9].strftime("%Y-%m-%d %H:%M:%S")
-            ret.append(r)
-        return ret
-    def select_by_bctype_epg_ch(self, bctype):
-        db = self.connect_db()
-        dbexe = db[1].execute("\
-        SELECT bctype,chtxt,ch,csch,updatetime,status,chname,status,visible,logoupdate,scanupdate \
-        FROM epg_ch \
-        WHERE bctype = %s", \
-                              (bctype,))
-        ret = []
-        dls = []
-        if dbexe > 0:
-            dls = db[1].fetchall()
-        self.close_db(db)
-        for dl in dls:
-            #recdblist.printutf8(dl)
-            r = list(dl)
-            r[4] = r[4].strftime("%Y-%m-%d %H:%M:%S")
-            if r[9]!=None:
-                r[9] = r[9].strftime("%Y-%m-%d %H:%M:%S")
-            else:
-                r[9]="2011-04-01 00:00:00"
-            r[10] = r[10].strftime("%Y-%m-%d %H:%M:%S")
-            r[5] = str(r[5])
-            ret.append(r)
-        import random
-        ret.insert(0,ret[random.randint(0,len(ret)-1)])
-        return ret
-    def select_by_ch_epg_ch(self, ch):
-        db = self.connect_db()
-        dbexe = db[1].execute("\
-        SELECT \
-        bctype,chtxt,ch,csch,updatetime,chname,status,visible,logoupdate,scanupdate \
-        FROM epg_ch \
-        WHERE ch = %s", \
-                              (ch,))
-        ret = []
-        dls = []
-        if dbexe > 0:
-            dls = db[1].fetchall()
-        self.close_db(db)
-        for dl in dls:
-            r = list(dl)
-            r[4] = r[4].strftime("%Y-%m-%d %H:%M:%S")
-            r[8] = r[8].strftime("%Y-%m-%d %H:%M:%S")
-            r[9] = r[9].strftime("%Y-%m-%d %H:%M:%S")
-            ret.append(r)
-        return ret
-    def select_by_csch_epg_ch(self, csch):
-        db = self.connect_db()
-        dbexe = db[1].execute("\
-        SELECT \
-        bctype,chtxt,ch,csch,updatetime,chname,status,visible,logoupdate,scanupdate \
-        FROM epg_ch \
-        WHERE csch = %s", \
-                              (csch,))
-        ret = []
-        dls = []
-        if dbexe > 0:
-            dls = db[1].fetchall()
-        self.close_db(db)
-        for dl in dls:
-            r = list(dl)
-            r[4] = r[4].strftime("%Y-%m-%d %H:%M:%S")
-            r[8] = r[8].strftime("%Y-%m-%d %H:%M:%S")
-            r[9] = r[9].strftime("%Y-%m-%d %H:%M:%S")
-            ret.append(r)
-        return ret
-    def select_all_epg_ch(self):
-        db = self.connect_db()
-        dbexe = db[1].execute("\
-        SELECT bctype,chtxt,ch,csch,updatetime,chname,status,visible,logoupdate,scanupdate \
-        FROM epg_ch \
-        ")
-        ret = []
-        dls = []
-        if dbexe > 0:
-            dls = db[1].fetchall()
-        self.close_db(db)
-        for dl in dls:
-            r = list(dl)
-            r[4] = r[4].strftime("%Y-%m-%d %H:%M:%S")
-            r[8] = r[8].strftime("%Y-%m-%d %H:%M:%S")
-            r[9] = r[9].strftime("%Y-%m-%d %H:%M:%S")
-            ret.append(r)
-        return ret
-    def change_visible_epg_ch(self,chtxt,visible):
-        db = self.connect_db()
-        db[1].execute("\
-        UPDATE epg_ch SET visible=%s WHERE chtxt=%s",(visible,chtxt))
-        self.close_db(db)
-    def change_logodata_epg_ch(self,chtxt,logonum,logodata):
-        db = self.connect_db()
-        db[1].execute("\
-        UPDATE epg_ch SET logo"+str(logonum)+"=%s WHERE chtxt=%s",(logodata,chtxt))
-        self.close_db(db)
-    def set_new_status(self,dhour):
-        db = self.connect_db()
-        dbexe = db[1].execute("UPDATE epg_ch \
-        SET status = 1 \
-        WHERE \
-        ( \
-        updatetime < DATE_SUB(now(),INTERVAL " + dhour + " HOUR) \
-        AND \
-        status = 0 \
-        )"\
-        )
-    def select_get_update_epg_ch(self, dhour):
-        db = self.connect_db()
-        dbexe = db[1].execute("SELECT bctype,chtxt,status FROM epg_ch \
-        WHERE (\
-        ( \
-        updatetime < DATE_SUB(now(),INTERVAL " + dhour + " HOUR) \
-        AND \
-        status = 1 \
-        ) \
-        OR \
-        status > 1 )\
-        ORDER BY status DESC")
-        ret = []
-        #recdblist.printutf8(dbexe)
-        if dbexe > 0:
-            ret = db[1].fetchall()
-        self.close_db(db)
-        return ret
-    def select_get_updatelogo_epg_ch(self, dhour):
-        db = self.connect_db()
-        dbexe = db[1].execute("SELECT bctype,chtxt,logostatus FROM epg_ch \
-        WHERE (\
-        ( \
-        updatetime < DATE_SUB(now(),INTERVAL " + dhour + " HOUR) \
-        AND \
-        logostatus = 1 \
-        ) \
-        OR \
-        logostatus > 1 )\
-        ORDER BY status DESC")
-        ret = []
-        #recdblist.printutf8(dbexe)
-        if dbexe > 0:
-            ret = db[1].fetchall()
-        self.close_db(db)
-        return ret
-    def update_by_bctype_epg_ch(self, bctype):
-        db = self.connect_db()
-        db[1].execute("\
-        UPDATE epg_ch \
-        SET \
-        updatetime=now() , \
-        status = 1 \
-        WHERE bctype = %s", (bctype,))
-        self.close_db(db)
-
-    def update_by_bctype_and_chtxt_epg_ch(self, bctype, chtxt):
-        db = self.connect_db()
-        db[1].execute("\
-        UPDATE epg_ch \
-        SET \
-        updatetime=now() , \
-        status = 1\
-        WHERE bctype = %s AND chtxt = %s", (bctype, chtxt))
-        self.close_db(db)
-    def update_chname_by_chtxt_epg_ch(self,chtxt,chname):
-        db = self.connect_db()
-        db[1].execute("\
-        UPDATE epg_ch \
-        SET \
-        chname = %s \
-        WHERE chtxt = %s", (chname,chtxt))
-        self.close_db(db)
-    def update_status_by_bctype_epg_ch(self, bctype, status):
-        db = self.connect_db()
-        db[1].execute("\
-        UPDATE epg_ch \
-        SET \
-        status=%s , \
-        updatetime=now() \
-        WHERE bctype = %s", \
-                      (status, bctype)\
-                      )
-        self.close_db(db)
-    def update_logostatus_by_bctype_epg_ch(self,bctype,logostatus):
-        db = self.connect_db()
-        db[1].execute("\
-        UPDATE epg_ch \
-        SET \
-        logostatus=%s , \
-        logoupdate=now() \
-        WHERE bctype = %s", \
-                      (logostatus, bctype)\
-                      )
-        self.close_db(db)
-    def add_auto_proc_tmp(self,type,title,chtxt):
-        db = self.connect_db()
-        db[1].execute('\
-        INSERT IGNORE into auto_proc_tmp \
-        (type,title,chtxt) \
-        values (%s,%s,%s)',(type,title,chtxt))
-        ##db.commit()
-        self.close_db(db)
-    def new_auto_proc_tmp(self):
-        db = self.connect_db()
-        try:
-            db[1].execute('drop table auto_proc_tmp')
-        except Exception, inst:
-            if not ((type(inst)==MySQLdb.ProgrammingError and inst[0]==1007)or(type(inst)==MySQLdb.OperationalError and (inst[0]==1050 or inst[0]==1051))):
-                recdblist.addCommonlogEX("Error", "new_auto_proc_tmp drop (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
-
-        try:
-            db[1].execute('\
-            CREATE TABLE auto_proc_tmp \
-            (\
-            type VARCHAR(20),\
-            title VARCHAR(100) PRIMARY KEY,\
-            chtxt VARCHAR(30),\
-            UNIQUE unibayeskey(title)\
-            )')
-        except Exception, inst:
-            if not ((type(inst)==MySQLdb.ProgrammingError and inst[0]==1007)or(type(inst)==MySQLdb.OperationalError and inst[0]==1050)):
-                recdblist.addCommonlogEX("Error", "new_auto_proc_tmp (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
-
-        self.close_db(db)
-    def update_auto_proc(self):
-        db = self.connect_db()
-        try:
-            db[1].execute('INSERT INTO auto_proc SELECT * FROM auto_proc_tmp')
-        except Exception, inst:
-            if not ((type(inst)==MySQLdb.ProgrammingError and inst[0]==1007)or(type(inst)==MySQLdb.OperationalError and inst[0]==1050)):
-                recdblist.addCommonlogEX("Error", "update_auto_proc (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
-
-        self.close_db(db)
-    def new_auto_proc(self):
-        db = self.connect_db()
-        try:
-            db[1].execute('drop table auto_proc')
-        except Exception, inst:
-            if not ((type(inst)==MySQLdb.ProgrammingError and inst[0]==1007)or(type(inst)==MySQLdb.OperationalError and (inst[0]==1050 or inst[0]==1051))):
-                recdblist.addCommonlogEX("Error", "new_auto_proc drop (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
-
-        try:
-            db[1].execute('\
-            CREATE TABLE auto_proc \
-            (\
-            type VARCHAR(20),\
-            title VARCHAR(100) PRIMARY KEY,\
-            chtxt VARCHAR(30),\
-            UNIQUE unibayeskey(title)\
-            )')
-        except Exception, inst:
-            if not ((type(inst)==MySQLdb.ProgrammingError and inst[0]==1007)or(type(inst)==MySQLdb.OperationalError and inst[0]==1050)):
-                recdblist.addCommonlogEX("Error", "new_auto_proc (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
-
-        self.close_db(db)
-    def add_auto_proc(self,type,title,chtxt):
-        db = self.connect_db()
-        db[1].execute('\
-        INSERT IGNORE into auto_proc \
-        (type,title,chtxt) \
-        values (%s,%s,%s)',(type,title,chtxt))
-        ##db.commit()
-        self.close_db(db)
-    def drop_in_settings(self):
-        db = self.connect_db()
-        try:
-            db[1].execute('drop table in_settings')
-        except Exception, inst:
-            if not ((type(inst)==MySQLdb.ProgrammingError and inst[0]==1007)or(type(inst)==MySQLdb.OperationalError and (inst[0]==1050 or inst[0]==1051))):
-                recdblist.addCommonlogEX("Error", "drop_in_settings (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
-        self.close_db(db)
-    def new_in_settings(self):
-        db = self.connect_db()
-        try:
-            db[1].execute('\
-            CREATE TABLE in_settings \
-            (\
-            auto_jbk TINYINT,\
-            auto_bayes TINYINT,\
-            auto_opt VARCHAR(20),\
-            auto_del_tmp TINYINT\
-            )')
-            db[1].execute("INSERT IGNORE into in_settings VALUE (0,0,\"H\",1)")
-        except Exception, inst:
-            if not ((type(inst)==MySQLdb.ProgrammingError and inst[0]==1007)or(type(inst)==MySQLdb.OperationalError and inst[0]==1050)):
-                recdblist.addCommonlogEX("Error", "new_in_settings (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
-
-        self.close_db(db)
-    def select_all_in_settings(self):
-        db = self.connect_db()
-        dbexe = db[1].execute("\
-        SELECT auto_jbk,auto_bayes,auto_del_tmp,auto_opt \
-        FROM in_settings \
-        ")
-        ret = []
-        dls = []
-        if dbexe > 0:
-            dls = db[1].fetchall()
-        self.close_db(db)
-        for dl in dls:
-            r = list(dl)
-            r[0]=str(r[0])
-            r[1]=str(r[1])
-            r[2]=str(r[2])
-            r[3]=r[3]
-            ret.append(r)
-        return ret
-    def add_in_timeline_log(self , chtxt="", title="", btime="", etime="", opt="", exp="", longexp="", category=""):
-        db = self.connect_db()
-        db[1].execute('\
-        INSERT IGNORE into in_timeline_log \
-        (chtxt,title,btime,etime,opt,exp,longexp,category) \
-        values (%s,%s,%s,%s,%s,%s,%s,%s)', \
-                      ( chtxt, title, btime, etime, opt,exp,longexp,category))
-        ##db.commit()
-        self.close_db(db)
-    def del_in_timeline_log(self, title="", chtxt="", btime=""):
-        """
-
-        """
-        db = self.connect_db()
-        db[1].execute("\
-        DELETE FROM in_timeline_log \
-        WHERE title = %s AND chtxt = %s AND btime = %s", \
-                      (title, chtxt, btime))
-        #db.commit()
-        self.close_db(db)
-    def new_in_timeline_log(self):
-        db = self.connect_db()
-        try:
-            db[1].execute('\
-            CREATE TABLE in_timeline_log \
-            (\
-            id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,\
-            chtxt VARCHAR(20),\
-            title VARCHAR(100),\
-            btime DATETIME,\
-            etime DATETIME,\
-            opt VARCHAR(20),\
-            exp VARCHAR(200),\
-            longexp TEXT,\
-            category VARCHAR(100),\
-            UNIQUE uni (chtxt,title,btime,category)\
-            )')
-        except Exception, inst:
-            if not ((type(inst)==MySQLdb.ProgrammingError and inst[0]==1007)or(type(inst)==MySQLdb.OperationalError and inst[0]==1050)):
-                recdblist.addCommonlogEX("Error", "new_in_timeline_log (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
-
-        self.close_db(db)
-    def select_chtxt_by_title_timeline_log(self,title):
-        db = self.connect_db()
-        dbexe = db[1].execute("\
-        SELECT chtxt \
-        FROM in_timeline_log \
-        WHERE title LIKE \"%"+title+"%\"\
-        GROUP by chtxt\
-        ORDER by sum(1) DESC limit 1")
-        retdb=db[1].fetchall()
-        ret=""
-        if ret!=None:
-            if len(retdb)>0:
-                ret=retdb[0][0]
-        self.close_db(db)
-        return ret
-    def add_timeline(self, type="", chtxt="", title="", btime="", etime="", deltatime="", deltaday="", opt="" ,counter=-1):
-        db = self.connect_db()
-        db[1].execute('\
-        INSERT IGNORE into timeline \
-        (type,chtxt,title,btime,etime,deltatime,deltaday,opt,counter) \
-        values (%s,%s,%s,%s,%s,%s,%s,%s,%s)', \
-                      (type, chtxt, title, btime, etime, deltatime, deltaday, opt ,counter))
-        ##db.commit()
-        self.close_db(db)
-    def update_epg_timeline(self,type,chtxt,title,btime,epgbtime,epgetime,epgtitle,epgexp,epgcategory):
-        db = self.connect_db()
-        db[1].execute('\
-        UPDATE timeline \
-        SET epgbtime=%s,epgetime=%s,epgtitle=%s,epgexp=%s,epgcategory=%s \
-        WHERE type=%s AND chtxt=%s AND title=%s AND btime=%s ', \
-                      (epgbtime,epgetime,epgtitle,epgexp,epgcategory,type, chtxt, title, btime))
-        ##db.commit()
-        self.close_db(db)
-    def update_status_change_timeline(self,type,chtxt,title,btime,epgchange):
-        db = self.connect_db()
-        db[1].execute('\
-        UPDATE timeline \
-        SET epgchange =%s \
-        WHERE type=%s AND chtxt=%s AND title=%s AND btime=%s ', \
-                      (epgchange , type, chtxt, title, btime))
-        ##db.commit()
-        self.close_db(db)
-    def update_status_dup_timeline(self,type,chtxt,title,btime,epgduplicate):
-        db = self.connect_db()
-        db[1].execute('\
-        UPDATE timeline \
-        SET epgduplicate =%s \
-        WHERE type=%s AND chtxt=%s AND title=%s AND btime=%s ', \
-                      (epgduplicate , type, chtxt, title, btime))
-        ##db.commit()
-        self.close_db(db)
-    def del_timeline(self, type="", title="", chtxt="", btime=""):
-        """
-
-        """
-        db = self.connect_db()
-        db[1].execute("\
-        DELETE FROM timeline \
-        WHERE type = %s AND title = %s AND chtxt = %s AND btime = %s", \
-                      (type, title, chtxt, btime))
-        #db.commit()
-        self.close_db(db)
-    def select_all_timeline(self):
-        db = self.connect_db()
-        recdata = []
-        dbr = db[1].execute("\
-        SELECT type, chtxt, title, btime, etime, deltatime ,deltaday ,opt ,epgbtime ,epgetime ,epgtitle ,epgduplicate ,epgchange ,counter\
-        FROM timeline")
-        dbl = db[1].fetchall()
-        self.close_db(db)
-        if dbr > 0:
-            recdata = self.getdic_timeline(dbl)
-        return recdata
-    def select_bytime_timeline(self, dminutes):
-        db = self.connect_db()
-        recdatum = []
-        #dbr=db[1].execute("SELECT type, chtxt, title, btime, etime, deltatime ,deltaday ,opt FROM rectime WHERE btime < DATE_SUB(now(),INTERVAL "+dminutes+" MINUTE ) AND btime > DATE_ADD(now(),INTERVAL "+dminutes+" MINUTE )")
-        dbr = db[1].execute("SELECT \
-        type, chtxt, title, btime, etime, deltatime ,deltaday ,opt ,epgbtime ,epgetime ,epgtitle ,epgduplicate ,epgchange ,counter\
-        FROM timeline \
-        WHERE btime BETWEEN DATE_SUB(now(),INTERVAL " + dminutes + " MINUTE ) AND \
-        DATE_ADD(now(),INTERVAL " + dminutes + " MINUTE )")
-        dbl = db[1].fetchall()
-        self.close_db(db)
-        #recdblist.printutf8(dbl)
-        if dbr > 0:
-            recdatum = self.getdic_timeline(dbl)
-        return recdatum
-    def select_by_name_time_timeline(self,title,btime,btime2):
-        db = self.connect_db()
-        recdatum = []
-        #dbr=db[1].execute("SELECT type, chtxt, title, btime, etime, deltatime ,deltaday ,opt FROM rectime WHERE btime < DATE_SUB(now(),INTERVAL "+dminutes+" MINUTE ) AND btime > DATE_ADD(now(),INTERVAL "+dminutes+" MINUTE )")
-        dbr = db[1].execute("SELECT \
-        type, chtxt, title, btime, etime, deltatime ,deltaday ,opt ,epgbtime ,epgetime ,epgtitle ,epgduplicate ,epgchange ,counter\
-        FROM timeline \
-        WHERE btime > %s AND \
-        btime < %s AND title = %s",(btime,btime2,title))
-        dbl = db[1].fetchall()
-        self.close_db(db)
-        #recdblist.printutf8(dbl)
-        if dbr > 0:
-            recdatum = self.getdic_timeline(dbl)
-        return recdatum
-    def select_bytime_all_timeline(self,btime,etime):
-        db = self.connect_db()
-        recdatum = []
-        #dbr=db[1].execute("SELECT type, chtxt, title, btime, etime, deltatime ,deltaday ,opt FROM rectime WHERE btime < DATE_SUB(now(),INTERVAL "+dminutes+" MINUTE ) AND btime > DATE_ADD(now(),INTERVAL "+dminutes+" MINUTE )")
-        dbr = db[1].execute("SELECT \
-        type, chtxt, title, btime, etime, deltatime ,deltaday ,opt ,epgbtime ,epgetime ,epgtitle ,epgduplicate ,epgchange ,counter\
-        FROM timeline \
-        WHERE btime >= %s AND \
-        etime <= %s",(btime,etime))
-        dbl = db[1].fetchall()
-        self.close_db(db)
-        #recdblist.printutf8(dbl)
-        if dbr > 0:
-            recdatum = self.getdic_timeline(dbl)
-        return recdatum
-    def select_byepgtime_all_timeline(self,epgbtime,epgetime):
-        db = self.connect_db()
-        recdatum = []
-        #dbr=db[1].execute("SELECT type, chtxt, title, btime, etime, deltatime ,deltaday ,opt FROM rectime WHERE btime < DATE_SUB(now(),INTERVAL "+dminutes+" MINUTE ) AND btime > DATE_ADD(now(),INTERVAL "+dminutes+" MINUTE )")
-        dbr = db[1].execute("SELECT \
-        type, chtxt, title, btime, etime, deltatime ,deltaday ,opt ,epgbtime ,epgetime ,epgtitle ,epgduplicate ,epgchange ,counter\
-        FROM timeline \
-        WHERE epgbtime >= %s AND \
-        epgetime <= %s",(epgbtime,epgetime))
-        dbl = db[1].fetchall()
-        self.close_db(db)
-        #recdblist.printutf8(dbl)
-        if dbr > 0:
-            recdatum=self.getdic_timeline(dbl)
-        return recdatum
-    def select_byepgtime_over_timeline(self,epgbtime,epgetime):
-        db = self.connect_db()
-        recdatum = []
-        #dbr=db[1].execute("SELECT type, chtxt, title, btime, etime, deltatime ,deltaday ,opt FROM rectime WHERE btime < DATE_SUB(now(),INTERVAL "+dminutes+" MINUTE ) AND btime > DATE_ADD(now(),INTERVAL "+dminutes+" MINUTE )")
-        dbr = db[1].execute("SELECT \
-        type, chtxt, title, btime, etime, deltatime ,deltaday ,opt ,epgbtime ,epgetime ,epgtitle ,epgduplicate ,epgchange ,counter\
-        FROM timeline \
-        WHERE (NOT(( timeline.epgetime <= %s )OR( timeline.epgbtime >= %s )))"\
-        ,(epgbtime,epgetime))
-        dbl = db[1].fetchall()
-        self.close_db(db)
-        #recdblist.printutf8(dbl)
-        if dbr > 0:
-            recdatum=self.getdic_timeline(dbl)
-        return recdatum
-    def count_schedule_timeline(self, btime, etime):
-        """
-        count rectasknum
-        return [te num,bs/cs num]
-        """
-        db = self.connect_db()
-        dbexe = "SELECT type,epg_ch.bctype,timeline.chtxt,title FROM timeline INNER JOIN epg_ch ON timeline.chtxt=epg_ch.chtxt"
-        dbexe = dbexe + " WHERE ((NOT(( timeline.etime <= %s )OR( timeline.btime >= %s ))) OR ((timeline.btime = %s) AND (timeline.etime = %s) ) )"
-        Srec = 0
-        Trec = 0
-        db[1].execute(dbexe, (btime, etime,btime,etime))
-        dbl=db[1].fetchall()
-        for typet, bctypet, chtxtt, titlet in dbl:
-            if (typet == recdblist.REC_RESERVE) or (typet == recdblist.REC_FINAL_RESERVE) or (typet == recdblist.REC_KEYWORD) or (typet == recdblist.REC_KEYWORD_EVERY_SOME_DAYS):
-                if bctypet.find("cs") > -1:
-                    Srec = Srec + 1
-                elif bctypet.find("bs") > -1:
-                    Srec = Srec + 1
-                elif bctypet.find("te") > -1:
-                    Trec = Trec + 1
-        self.close_db(db)
-        return [Trec, Srec]
-    def search_schedule_timeline(self,btime,etime):
-        """
-        count rectasknum
-        return [(type,bctype,chtxt,title,btime,etime)]
-        """
-        db = self.connect_db()
-        dbexe = "SELECT type,epg_ch.bctype,timeline.chtxt,title,timeline.btime,timeline.etime FROM timeline INNER JOIN epg_ch ON timeline.chtxt=epg_ch.chtxt"
-        dbexe = dbexe + " WHERE ((NOT(( timeline.etime <= %s )OR( timeline.btime >= %s ))) OR ((timeline.btime = %s) AND (timeline.etime = %s) ) )"
-        ret=[]
-        db[1].execute(dbexe, (btime, etime,btime,etime))
-        dbl=db[1].fetchall()
-        for typet, bctypet, chtxtt, titlet , btimet, etimet in dbl:
-            if (typet == recdblist.REC_RESERVE) or (typet == recdblist.REC_FINAL_RESERVE) or (typet == recdblist.REC_KEYWORD) or (typet == recdblist.REC_KEYWORD_EVERY_SOME_DAYS):
-                ret.append([typet,bctypet,chtxtt,titlet,btimet,etimet])
-        self.close_db(db)
-        return ret
-    def count_epgschedule_timeline(self, epgbtime, epgetime):
-        """
-        count rectasknum
-        return [te num,bs/cs num]
-        """
-        db = self.connect_db()
-        dbexe = "SELECT type,epg_ch.bctype,timeline.chtxt,title FROM timeline INNER JOIN epg_ch ON timeline.chtxt=epg_ch.chtxt"
-        dbexe = dbexe + " WHERE (NOT(( timeline.epgetime <= %s )OR( timeline.epgbtime >= %s )))"
-        Srec = 0
-        Trec = 0
-        db[1].execute(dbexe, (epgbtime, epgetime))
-        dbl=db[1].fetchall()
-        for typet, bctypet, chtxtt, titlet in dbl:
-            if (typet == recdblist.REC_RESERVE) or (typet == recdblist.REC_FINAL_RESERVE) or (typet == recdblist.REC_KEYWORD) or (typet == recdblist.REC_KEYWORD_EVERY_SOME_DAYS):
-                if bctypet.find("cs") > -1:
-                    Srec = Srec + 1
-                elif bctypet.find("bs") > -1:
-                    Srec = Srec + 1
-                elif bctypet.find("te") > -1:
-                    Trec = Trec + 1
-        self.close_db(db)
-        return [Trec, Srec]
-    def search_epgschedule_timeline(self,epgbtime,epgetime):
-        """
-        count rectasknum
-        return [(type,bctype,chtxt,title,btime,etime)]
-        """
-        db = self.connect_db()
-        dbexe = "SELECT type,epg_ch.bctype,timeline.chtxt,title,timeline.btime,timeline.etime FROM timeline INNER JOIN epg_ch ON timeline.chtxt=epg_ch.chtxt"
-        dbexe = dbexe + " WHERE ((NOT(( timeline.epgetime <= %s )OR( timeline.epgbtime >= %s ))) OR ((timeline.epgbtime = %s) AND (timeline.epgetime = %s) ) )"
-        ret=[]
-        db[1].execute(dbexe, (epgbtime, epgetime,epgbtime,epgetime))
-        dbl=db[1].fetchall()
-        for typet, bctypet, chtxtt, titlet , btimet, etimet in dbl:
-            if (typet == recdblist.REC_RESERVE) or (typet == recdblist.REC_FINAL_RESERVE) or (typet == recdblist.REC_KEYWORD) or (typet == recdblist.REC_KEYWORD_EVERY_SOME_DAYS):
-                ret.append([typet,bctypet,chtxtt,titlet,btimet,etimet])
-        self.close_db(db)
-        return ret
-    def select_bytime_bychtxt_all_timeline(self,btime,etime,chtxt):
-        db = self.connect_db()
-        recdatum = []
-        #dbr=db[1].execute("SELECT type, chtxt, title, btime, etime, deltatime ,deltaday ,opt FROM rectime WHERE btime < DATE_SUB(now(),INTERVAL "+dminutes+" MINUTE ) AND btime > DATE_ADD(now(),INTERVAL "+dminutes+" MINUTE )")
-        dbr = db[1].execute("SELECT \
-        type, chtxt, title, btime, etime, deltatime ,deltaday ,opt ,epgbtime ,epgetime ,epgtitle ,epgduplicate ,epgchange ,counter\
-        FROM timeline \
-        WHERE btime > %s AND \
-        etime < %s\
-        AND chtxt=%s ",(btime,etime,chtxt))
-        dbl = db[1].fetchall()
-        self.close_db(db)
-        #recdblist.printutf8(dbl)
-        if dbr > 0:
-            recdatum = self.getdic_timeline(dbl)
-        return recdatum
-    def getdic_timeline(self,timelinelists):
-        recdatum=[]
-        for typet, chtxt, title, btime, etime, deltatime, deltaday, opt ,epgbtimet , epgetimet ,epgtitlet ,epgduplicatet ,epgchanget ,countert in timelinelists:
-            ret = {}
-            ret['type'] = typet
-            ret['chtxt'] = chtxt
-            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['etime'] = etime
-            ret['opt'] = opt
-            try:
-                ret['epgbtime'] = epgbtimet.strftime("%Y-%m-%d %H:%M:%S")
-                ret['epgetime'] = epgetimet.strftime("%Y-%m-%d %H:%M:%S")
-            except:
-                ret['epgbtime'] = "2010-01-01 00:00:00"
-                ret['epgetime'] = "2010-01-01 00:00:00"
-            ret['epgtitle'] = epgtitlet
-            ret['epgduplicate'] = epgduplicatet
-            ret['epgchange'] = epgchanget
-            if deltatime == None or deltatime == "":
-                deltatime = "3"
-            if deltaday == None or deltaday == "":
-                deltaday = "7"
-            if typet == recdblist.REC_KEYWORD:
-                ret['deltatime'] = deltatime
-            elif typet == recdblist.REC_KEYWORD_EVERY_SOME_DAYS:
-                ret['deltatime'] = deltatime
-                ret['deltaday'] = deltaday
-            try:
-                ret['counter'] = int(countert)
-            except:
-                ret['counter']=-1
-            recdatum.append(ret)
-        return recdatum
-    def delete_old_timeline(self, dhour):
-        db = self.connect_db()
-        db[1].execute("\
-        DELETE FROM timeline \
-        WHERE \
-        btime < DATE_SUB(now(),INTERVAL " + dhour + " HOUR )")
-        #db.commit()
-        self.close_db(db)
-    def new_in_auto_jbk_key(self):
-        db = self.connect_db()
-        try:
-            db[1].execute("\
-            CREATE TABLE in_auto_jbk_key \
-            (\
-            id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,\
-            keyword VARCHAR(200),\
-            auto TINYINT DEFAULT 0,\
-            opt VARCHAR(20),\
-            UNIQUE unijbk (keyword)\
-            )")
-        except Exception, inst:
-            if not ((type(inst)==MySQLdb.ProgrammingError and inst[0]==1007)or(type(inst)==MySQLdb.OperationalError and inst[0]==1050)):
-                recdblist.addCommonlogEX("Error", "new_in_auto_jbk_key (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
-        self.close_db(db)
-    def add_in_auto_jbk_key(self,key):
-        db = self.connect_db()
-        db[1].execute('\
-        INSERT IGNORE into in_auto_jbk_key \
-        (keyword) \
-        values (%s)', \
-                      (key,))
-        ##db.commit()
-        self.close_db(db)
-    def select_all_in_auto_jbk_key(self):
-        db = self.connect_db()
-        dbexe = db[1].execute("\
-        SELECT keyword,auto,opt \
-        FROM in_auto_jbk_key \
-vim         ")
-        ret = []
-        if dbexe > 0:
-            ret = db[1].fetchall()
-        self.close_db(db)
-        return ret
-    def drop_in_status(self):
-        db = self.connect_db()
-        try:
-            db[1].execute('drop table in_status')
-        except Exception, inst:
-            if not ((type(inst)==MySQLdb.ProgrammingError and inst[0]==1007)or(type(inst)==MySQLdb.OperationalError and (inst[0]==1050 or inst[0]==1051))):
-                recdblist.addCommonlogEX("Error", "drop_in_status (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
-        self.close_db(db)
-    def new_in_status(self):
-        db = self.connect_db()
-        try:
-            db[1].execute("\
-            CREATE TABLE in_status \
-            (\
-            ts2avi TINYINT DEFAULT 0,\
-            terec TINYINT DEFAULT 0,\
-            bscsrec TINYINT DEFAULT 0,\
-            b252ts TINYINT DEFAULT 0,\
-            installed TINYINT DEFAULT 0,\
-            version TINYINT\
-            )")
-            db[1].execute("INSERT IGNORE into in_status VALUE (0,0,0,0,0,0)")
-        except Exception, inst:
-            if not ((type(inst)==MySQLdb.ProgrammingError and inst[0]==1007)or(type(inst)==MySQLdb.OperationalError and inst[0]==1050)):
-                recdblist.addCommonlogEX("Error", "new_in_status (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
-        self.close_db(db)
-    def select_all_in_status(self):
-        db = self.connect_db()
-        dbexe = db[1].execute("\
-        SELECT ts2avi,terec,bscsrec,b252ts \
-        FROM in_status \
-        ")
-        ret = []
-        dls = []
-        if dbexe > 0:
-            dls = db[1].fetchall()
-        self.close_db(db)
-        for dl in dls:
-            r = list(dl)
-            r[0]=str(r[0])
-            r[1]=str(r[1])
-            r[2]=str(r[2])
-            r[3]=str(r[3])
-            ret.append(r)
-        return ret
-    def select_version_in_status(self):
-        db = self.connect_db()
-        version=0
-        try:
-            dbexe = db[1].execute("\
-            SELECT version \
-            FROM in_status \
-            ")
-            if dbexe > 0:
-                dls = db[1].fetchall()
-            self.close_db(db)
-            for dl in dls:
-                r = list(dl)
-                version=int(str(r[0]))
-        except Exception, inst:
-            if not ((type(inst)==MySQLdb.ProgrammingError and inst[0]==1007)or(type(inst)==MySQLdb.OperationalError and inst[0]==1050)):
-                recdblist.addCommonlogEX("Error", "select_version_in_status (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
-        return version
-    def change_version_in_status(self,version):
-        db = self.connect_db()
-        db[1].execute("\
-        UPDATE in_status SET version=%s",str(version))
-        self.close_db(db)
-    def change_ts2avi_in_status(self,i):
-        """
-        statuをiだけ増減する
-        iはint
-        """
-        db = self.connect_db()
-        db[1].execute("\
-        UPDATE in_status SET ts2avi=ts2avi+%s",i)
-        self.close_db(db)
-    def change_terec_in_status(self,i):
-        """
-        statuをiだけ増減する
-        iはint
-        """
-        db = self.connect_db()
-        db[1].execute("\
-        UPDATE in_status SET terec=terec+%s",i)
-        self.close_db(db)
-    def change_bscsrec_in_status(self,i):
-        """
-        statuをiだけ増減する
-        iはint
-        """
-        db = self.connect_db()
-        db[1].execute("\
-        UPDATE in_status SET bscsrec=bscsrec+%s",i)
-        self.close_db(db)
-    def change_b252ts_in_status(self,i):
-        """
-        statuをiだけ増減する
-        iはint
-        """
-        db = self.connect_db()
-        db[1].execute("\
-        UPDATE in_status SET b252ts=b252ts+%s",i)
-        self.close_db(db)
-    def select_installed_in_status(self):
-        db = self.connect_db()
-        dbexe = db[1].execute("\
-        SELECT ts2avi,terec,bscsrec,b252ts,installed \
-        FROM in_status \
-        ")
-        ret = 0
-        dls = []
-        if dbexe > 0:
-            dls = db[1].fetchall()
-        self.close_db(db)
-        for dl in dls:
-            r = list(dl)
-            ret=r[4]
-        return ret
-    def change_chscaned_in_status(self):
-        """
-        installedを設定する
-        """
-        db = self.connect_db()
-        db[1].execute("\
-        UPDATE in_status SET installed=2")
-        self.close_db(db)
-    def change_installed_in_status(self,num=1):
-        """
-        installedを設定する
-        """
-        db = self.connect_db()
-        db[1].execute("\
-        UPDATE in_status SET installed=%s",(num,))
-        self.close_db(db)
-    def new_epg_timeline(self, bctype):
-        db = self.connect_db()
-        try:
-            db[1].execute("\
-            DELETE FROM epg_timeline \
-            WHERE bctype = %s", \
-                          (bctype,))
-        except Exception, inst:
-            if not ((type(inst)==MySQLdb.ProgrammingError and (inst[0]==1007 or inst[0]==1146))or(type(inst)==MySQLdb.OperationalError and inst[0]==1050)):
-                recdblist.addCommonlogEX("Error", "new_epg_timeline delete (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
-        try:
-            db[1].execute("\
-            CREATE TABLE epg_timeline \
-            (\
-            bctype VARCHAR(20),\
-            channel VARCHAR(100) NOT NULL,\
-            start VARCHAR(30),\
-            stop  VARCHAR(30),\
-            title VARCHAR(100),\
-            exp VARCHAR(200),\
-            longexp TEXT,\
-            category VARCHAR(100),\
-            UNIQUE unitv(bctype,channel,start,stop,title)\
-            )")
-        except Exception, inst:
-            if not ((type(inst)==MySQLdb.ProgrammingError and inst[0]==1007)or(type(inst)==MySQLdb.OperationalError and inst[0]==1050)):
-                recdblist.addCommonlogEX("Error", "new_epg_timeline (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
-        #db.commit()
-        self.close_db(db)
-    def add_epg_timeline(self, bctype, channel, start, stop, title, desc,longdesc, category):
-        db = self.connect_db()
-        db[1].execute('\
-        INSERT IGNORE INTO epg_timeline \
-        VALUES (%s,%s,%s,%s,%s,%s,%s,%s)', \
-                      (bctype, channel, start, stop, title, desc,longdesc,category))
-        #db.commit()
-        self.close_db(db)
-    def add_multi_epg_timeline(self, tvlists):
-        """
-        tvlists is (bctype,channel,start,stop,title,desc,longdesc,category) lists.
-        """
-        db = self.connect_db()
-        db[1].executemany('\
-        INSERT IGNORE INTO epg_timeline \
-        (bctype,channel,start,stop,title,exp,longexp,category) \
-        values(%s,%s,%s,%s,%s,%s,%s,%s)', \
-                          tvlists)
-        self.close_db(db)
-    def select_by_time_ngram_epg_timeline(self, btime, etime, chtxt):
-        db = self.connect_db()
-        dbexe = "\
-        SELECT \
-        channel,title,start,stop,exp,longexp,category \
-        FROM epg_timeline \
-        WHERE start >= %s \
-        AND \
-        start <= %s \
-        AND \
-        channel LIKE %s"
-        dbcmd = db[1].execute(dbexe, (btime, etime, chtxt))
-        retall = []
-        if dbcmd > 0:
-            retall = db[1].fetchall()
-        self.close_db(db)
-        return retall
-    def select_by_time_keyword_auto_suggest_epg_timeline(self,keyword,btime,etime):
-        db = self.connect_db()
-        dbexe = "\
-        SELECT \
-        epg_ch.chtxt,title,start,stop,exp,longexp,category \
-        FROM epg_timeline \
-        INNER JOIN epg_ch \
-        WHERE epg_ch.chtxt=epg_timeline.channel \
-        AND \
-        epg_ch.visible=1 \
-        AND \
-        start >= %s \
-        AND \
-        stop <= %s \
-        AND \
-        ( \
-        ( title LIKE \'%%"+keyword+"%%\' ) \
-        OR \
-        ( exp LIKE \'%%"+keyword+"%%\' ) \
-        OR \
-        ( longexp LIKE \'%%"+keyword+"%%\' ) \
-        )"
-        dbcmd = db[1].execute(dbexe,(btime, etime))
-        retall = []
-        if dbcmd > 0:
-            retall = db[1].fetchall()
-        self.close_db(db)
-        return retall
-    def new_in_auto_bayes_key(self):
-        db = self.connect_db()
-        try:
-            db[1].execute('CREATE TABLE in_auto_bayes_key \
-            (\
-            keychar VARCHAR(10),\
-            chtxt VARCHAR(20),\
-            ratio_rec DECIMAL(32,14),\
-            ratio_all DECIMAL(32,14),\
-            UNIQUE unibayeskey(keychar,chtxt)\
-            )')
-            db[1].execute('CREATE INDEX keycharindex ON in_auto_bayes_key(keychar)')
-        except Exception, inst:
-            if not ((type(inst)==MySQLdb.ProgrammingError and inst[0]==1007)or(type(inst)==MySQLdb.OperationalError and inst[0]==1050)):
-                recdblist.addCommonlogEX("Error", "new_in_auto_bayes_key (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
-        self.close_db(db)
-
-    def add_in_auto_bayes_key(self,key,chtxt,ratio_rec,ratio_all):
-        db = self.connect_db()
-        ratio_rec=str(ratio_rec)
-        ratio_all=str(ratio_all)
-        db[1].execute('\
-        INSERT IGNORE INTO in_auto_bayes_key \
-        (keychar,chtxt,ratio_rec,ratio_all) \
-        values (%s,%s,%s,%s)',\
-        (key,chtxt,ratio_rec,ratio_all))
-        self.close_db(db)
-    def add_num_in_auto_bayes_key(self,chtxt,add_rec_num,add_all_num):
-        db = self.connect_db()
-        add_rec_num=str(add_rec_num)
-        add_all_num=str(add_all_num)
-        db[1].execute("\
-        UPDATE in_auto_bayes_key SET ratio_rec=CONVERT(ratio_rec+%s,DECIMAL(32,14)),ratio_all=CONVERT(ratio_all+%s,DECIMAL(32,14)) WHERE keychar=\"NUM\" AND chtxt=%s",\
-        (add_rec_num,add_all_num,chtxt))
-        self.close_db(db)
-    def change_in_auto_bayes_key(self,key,chtxt,new_ratio_rec,new_ratio_all):
-        """
-        """
-        db = self.connect_db()
-        db[1].execute("\
-        UPDATE in_auto_bayes_key SET ratio_rec=%s,ratio_all=%s WHERE keychar=%s AND chtxt=%s",(str(new_ratio_rec),str(new_ratio_all),key,chtxt)\
-        )
-        self.close_db(db)
-    def change_ratio_all_reduce_in_auto_bayes_key(self,chtxt,beforenum,newnum):
-        beforenum=str(beforenum)
-        newnum=str(newnum)
-        db = self.connect_db()
-        db[1].execute("\
-        UPDATE in_auto_bayes_key SET ratio_all=CONVERT(ratio_all*%s/(%s+%s),DECIMAL(32,14)) WHERE chtxt=%s AND NOT (keychar=\"NUM\")",(beforenum,newnum,beforenum,chtxt)\
-        )
-        self.close_db(db)
-    def change_ratio_all_in_auto_bayes_key(self,key,chtxt,beforenum,addnum):
-        db = self.connect_db()
-        beforenumf=beforenum
-        beforenum=str(beforenum)
-        db[1].execute("INSERT INTO in_auto_bayes_key (keychar,chtxt,ratio_rec,ratio_all) \
-        VALUES (%s,%s,%s,%s)\
-        ON DUPLICATE KEY UPDATE \
-        ratio_all=CONVERT((ratio_all*%s+%s)/%s,DECIMAL(32,14))",(key,chtxt,"0",str(Decimal(addnum)/beforenumf),beforenum,chtxt,key))
-        self.close_db(db)
-    def change_multi_ratio_all_in_auto_bayes_key(self,chtxt,beforenum,list):
-        """
-        list={key:addnum}のリスト
-        """
-        beforenumf=beforenum
-        beforenum=str(beforenum)
-        db = self.connect_db()
-        for i,j in list.items():
-            retl=(i,chtxt,"0",str(Decimal(j)/beforenumf),beforenum,str(j),beforenum)
-            try:
-                db[1].execute("INSERT INTO in_auto_bayes_key (keychar,chtxt,ratio_rec,ratio_all) \
-                VALUES (%s,%s,%s,%s)\
-                ON DUPLICATE KEY UPDATE \
-                ratio_all=CONVERT((ratio_all*%s+%s)/%s,DECIMAL(32,14))",retl)
-            except Exception, inst:
-                if not ((type(inst)==MySQLdb.ProgrammingError and inst[0]==1007)or(type(inst)==MySQLdb.OperationalError and inst[0]==1050)):
-                    recdblist.addCommonlogEX("Error", "change_multi_ratio_all_in_auto_bayes_key (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
-        self.close_db(db)
-    def change_ratio_rec_reduce_in_auto_bayes_key(self,chtxt,beforenum,newnum):
-        beforenum=str(beforenum)
-        newnum=str(newnum)
-        db = self.connect_db()
-        db[1].execute("\
-        UPDATE in_auto_bayes_key SET ratio_rec=CONVERT(ratio_rec*%s/(%s+%s),DECIMAL(32,14)) WHERE chtxt=%s AND NOT (keychar=\"NUM\")",(beforenum,newnum,beforenum,chtxt)\
-        )
-        self.close_db(db)
-    def change_ratio_rec_in_auto_bayes_key(self,key,chtxt,beforenum,addnum):
-        db = self.connect_db()
-        beforenumf=beforenum
-        beforenum=str(beforenum)
-        db[1].execute("INSERT INTO in_auto_bayes_key (keychar,chtxt,ratio_rec,ratio_all) \
-        VALUES (%s,%s,%s,%s)\
-        ON DUPLICATE KEY UPDATE \
-        ratio_rec=CONVERT((ratio_rec*%s+%s)/%s,DECIMAL(32,14))",(key,chtxt,str(Decimal(addnum)/beforenumf),"0",beforenum,chtxt,key))
-        self.close_db(db)
-    def change_multi_ratio_rec_in_auto_bayes_key(self,chtxt,beforenum,list):#self,key,chtxt,beforenum,addnum):
-        beforenumf=beforenum
-        beforenum=str(beforenum)
-        db = self.connect_db()
-        for i,j in list.items():
-            retl=(i,chtxt,str(Decimal(j)/beforenumf),"0",beforenum,str(j),beforenum)
-            try:
-                db[1].execute("INSERT INTO in_auto_bayes_key (keychar,chtxt,ratio_rec,ratio_all) \
-                VALUES (%s,%s,%s,%s)\
-                ON DUPLICATE KEY UPDATE \
-                ratio_rec=CONVERT((ratio_rec*%s+%s)/%s,DECIMAL(32,14))",retl)
-            except Exception, inst:
-                if not ((type(inst)==MySQLdb.ProgrammingError and inst[0]==1007)or(type(inst)==MySQLdb.OperationalError and inst[0]==1050)):
-                    recdblist.addCommonlogEX("Error", "change_multi_ratio_rec_in_auto_bayes_key (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
-        self.close_db(db)
-    def select_by_key_in_auto_bayes_key(self,key,chtxt):
-        db = self.connect_db()
-        dbexe = db[1].execute("\
-        SELECT keychar,chtxt,ratio_rec,ratio_all \
-        FROM in_auto_bayes_key \
-        WHERE keychar = %s AND chtxt = %s", \
-                              (key,chtxt))
-        dls = []
-        if dbexe > 0:
-            dls = db[1].fetchall()
-        self.close_db(db)
-        if len(dls)>0:
-            return dls[0]
-        else:
-            return dls
-    def new_auto_timeline_keyword(self):
-        db = self.connect_db()
-        try:
-            db[1].execute('\
-            CREATE TABLE auto_timeline_keyword \
-            (\
-            id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,\
-            chtxt VARCHAR(40),\
-            title VARCHAR(100),\
-            btime DATETIME,\
-            etime DATETIME,\
-            UNIQUE uni (chtxt,title,btime,etime)\
-            )')
-        except Exception, inst:
-            if not ((type(inst)==MySQLdb.ProgrammingError and inst[0]==1007)or(type(inst)==MySQLdb.OperationalError and inst[0]==1050)):
-                recdblist.addCommonlogEX("Error", "new_auto_timeline_keyword (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
-    def add_auto_timeline_keyword(self,chtxt="", title="", btime="", etime=""):
-        db = self.connect_db()
-        db[1].execute('\
-        INSERT IGNORE into auto_timeline_keyword \
-        (chtxt,title,btime,etime) \
-        values (%s,%s,%s,%s)', \
-                       (chtxt, title, btime, etime))
-        ##db.commit()
-        self.close_db(db)
-    def delete_old_auto_timeline_keyword(self, dhour):
-        db = self.connect_db()
-        db[1].execute("\
-        DELETE FROM auto_timeline_keyword \
-        WHERE \
-        btime < DATE_SUB(now(),INTERVAL " + dhour + " HOUR )")
-        self.close_db(db)
-    def new_auto_timeline_bayes(self):
-        db = self.connect_db()
-        try:
-            db[1].execute('\
-            CREATE TABLE auto_timeline_bayes \
-            (\
-            id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,\
-            chtxt VARCHAR(40),\
-            title VARCHAR(100),\
-            btime DATETIME,\
-            etime DATETIME,\
-            point INT,\
-            UNIQUE uni (chtxt,title,btime,etime)\
-            )')
-        except Exception, inst:
-            if not ((type(inst)==MySQLdb.ProgrammingError and inst[0]==1007)or(type(inst)==MySQLdb.OperationalError and inst[0]==1050)):
-                recdblist.addCommonlogEX("Error", "new_auto_timeline_bayes (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
-    def add_auto_timeline_bayes(self,chtxt="", title="", btime="", etime="",point=""):
-        db = self.connect_db()
-        db[1].execute('\
-        INSERT IGNORE into auto_timeline_bayes \
-        (chtxt,title,btime,etime,point) \
-        values (%s,%s,%s,%s,%s)', \
-                      (chtxt, title, btime, etime,point))
-        self.close_db(db)
-    def delete_old_auto_timeline_bayes(self, dhour):
-        db = self.connect_db()
-        db[1].execute("\
-        DELETE FROM auto_timeline_bayes \
-        WHERE \
-        btime < DATE_SUB(now(),INTERVAL " + dhour + " HOUR )")
-        self.close_db(db)
-    def update_db_to93(self):
-        db = self.connect_db()
-        self.drop_in_settings()
-        self.new_in_settings()
-        db[1].execute("\
-        ALTER TABLE timeline ADD epgtitle VARCHAR(100),\
-        ADD epgbtime DATETIME,\
-        ADD epgetime DATETIME,\
-        ADD epgduplicate TINYINT DEFAULT 0,\
-        ADD epgchange TINYINT DEFAULT 0")
-        db[1].execute("\
-        ALTER TABLE in_status ADD version TINYINT")
-        self.close_db(db)
-        self.change_version_in_status("93")
-    def update_db_93to94(self):
-        db = self.connect_db()
-        self.drop_in_settings()
-        self.new_in_settings()
-        db[1].execute("\
-        ALTER TABLE timeline ADD counter TINYINT DEFAULT -1")
-        self.close_db(db)
-        self.change_version_in_status("94")
-    def update_db_94to95(self):
-        db = self.connect_db()
-        self.drop_in_settings()
-        self.new_in_settings()
-        db[1].execute("\
-        ALTER TABLE timeline ADD epgexp VARCHAR(200)")
-        self.close_db(db)
-        self.change_version_in_status("95")
-    def update_db_95to96(self):
-        db = self.connect_db()
-        self.drop_in_settings()
-        self.new_in_settings()
-        self.close_db(db)
-        self.change_version_in_status("96")
-    def update_db_96to98(self):
-        db = self.connect_db()
-        self.drop_in_settings()
-        self.new_in_settings()
-        self.close_db(db)
-        self.change_version_in_status("98")
-    def update_db_98to100(self):
-        ###ここで前のepg_chをバックアップしてchtxtの変換をする必要がある。
-        self.drop_in_settings()
-        self.new_in_settings()
-        db = self.connect_db()
-        db[1].execute("\
-        UPDATE timeline INNER JOIN epg_ch ON timeline.chtxt=epg_ch.chtxt SET timeline.chtxt=CONCAT(CONCAT(epg_ch.ch,'_'),epg_ch.csch) WHERE NOT (substring(epg_ch.bctype,1,2) = 'bs' OR substring(epg_ch.bctype,1,2) = 'cs')")
-        db[1].execute("\
-        UPDATE timeline INNER JOIN epg_ch ON timeline.chtxt=epg_ch.chtxt SET timeline.chtxt=CONCAT('BS_',epg_ch.ch) WHERE substring(epg_ch.bctype,1,2) = 'bs'")
-        db[1].execute("\
-        UPDATE timeline INNER JOIN epg_ch ON timeline.chtxt=epg_ch.chtxt SET timeline.chtxt=CONCAT('CS_',epg_ch.csch) WHERE substring(epg_ch.bctype,1,2) = 'cs'")
-        try:
-            db[1].execute("\
-            ALTER TABLE epg_ch DROP ontv")
-        except:
-            ""
-        db[1].execute("\
-        ALTER TABLE epg_ch ADD logo0 BLOB,\
-        ADD logo1 BLOB,\
-        ADD logo2 BLOB,\
-        ADD logo3 BLOB,\
-        ADD logo4 BLOB,\
-        ADD logo5 BLOB\
-        ")
-        db[1].execute("\
-        ALTER TABLE in_auto_jbk_key ADD auto TINYINT DEFAULT 0")
-        db[1].execute("\
-        ALTER TABLE in_auto_jbk_key ADD opt VARCHAR(20) DEFAULT \"\"")
-        self.close_db(db)
-        self.change_installed_in_status(1)#チャンネルスキャンをさせる
-        self.change_version_in_status("100")
-    def update_db_100to101(self):
-        self.drop_in_settings()
-        self.new_in_settings()
-        self.new_epg_ch()
-        db = self.connect_db()
-        try:
-            db[1].execute("\
-            ALTER TABLE timeline ADD epgcategory VARCHAR(100)\
-            ")
-        except:
-            ""
-        self.close_db(db)
-        self.change_installed_in_status(1)
-        self.change_version_in_status("101")
-        #self.change_installed_in_status()#チャンネルスキャンをさせる
-        
diff --git a/dist/trunk/rec10/epgdb.py b/dist/trunk/rec10/epgdb.py
deleted file mode 100755 (executable)
index f0bfaf6..0000000
+++ /dev/null
@@ -1,277 +0,0 @@
-#!/usr/bin/python\r
-# coding: UTF-8\r
-# Rec10 TS Recording Tools\r
-# Copyright (C) 2009-2011 Yukikaze\r
-import datetime\r
-import os\r
-import shutil\r
-import time\r
-import os.path\r
-import traceback\r
-\r
-import chdb\r
-import n_gram\r
-import rec10d\r
-import ts2epg\r
-import xml2db_dom\r
-import configreader\r
-import recdblist\r
-path = str(os.path.dirname(os.path.abspath(__file__))) + "/"\r
-tmppath = configreader.getConfPath("tmp")+"/"\r
-if tmppath=="/":\r
-    tmppath=path\r
-if not os.path.exists(tmppath):\r
-    os.mkdir(tmppath)\r
-def update(chtxt):\r
-    recdblist.printutf8(chtxt)\r
-    tnow = datetime.datetime.now()\r
-    try:\r
-        lastup = datetime.datetime.strptime(chdb.searchCHFromChtxt(chtxt)[0]['update'], "%Y-%m-%d %H:%M:%S")\r
-    except:\r
-        lastup = datetime.datetime.strptime("2009-04-01 00:00:00", "%Y-%m-%d %H:%M:%S")\r
-    dt = tnow-lastup\r
-    dt = dt.days * 24 * 60 + dt.seconds\r
-    if dt > 2 * 60 * 60:\r
-        ts2epg.writeEpgXML(os.path.join(tmppath, chtxt + "epgdata.xml"), chdb.searchCHFromChtxt(chtxt)['ch'])\r
-        xml2db_dom.xml2db_dom(os.path.join(tmppath, chtxt + "epgdata.xml"), chdb.searchCHFromChtxt(chtxt)['bctype'])\r
-def updatebc(bctype):\r
-    bctypel = chdb.searchCHFromBctype(bctype)\r
-    #print bctype\r
-    try:\r
-        ts2epg.writeEpgXML(tmppath + bctype + "epgdata.xml", chdb.searchCHFromBctype(bctype)['ch'])\r
-        xml2db_dom.xml2db_dom(tmppath + bctype + "epgdata.xml", bctype)\r
-        shutil.copyfile(tmppath + bctype + "epgdata.xml", tmppath + bctype + "epgdata.bak.xml")\r
-        time.sleep(5)\r
-        rec10d.rec10db.update_by_bctype_epg_ch(bctype)\r
-    except Exception, inst:\r
-        recdblist.addCommonlogEX("Error","updatebc(epgdb.py)", str(type(inst)), str(inst)+"\n"+traceback.format_exc(),log_level=200)\r
-        xml2db_dom.xml2db_dom(tmppath + bctype + "epgdata.bak.xml", bctype)\r
-        rec10d.rec10db.update_status_by_bctype_epg_ch(bctype, "2")\r
-def updateLogo_bc(bctype):\r
-    bctypel = chdb.searchCHFromBctype(bctype)\r
-    #print bctype\r
-    try:\r
-        ts2epg.writeLogoEpgXML(tmppath + bctype + "logo.xml", chdb.searchCHFromBctype(bctype)['ch'])\r
-        xml2db_dom.xml2db_dom_logo(tmppath + bctype + "logo.xml", bctype)\r
-        shutil.copyfile(tmppath + bctype + "logo.xml", tmppath + bctype + "logo.bak.xml")\r
-        time.sleep(5)\r
-        rec10d.rec10db.update_logostatus_by_bctype_epg_ch(bctype,"1")\r
-    except Exception, inst:\r
-        recdblist.addCommonlogEX("Error","updatebc(epgdb.py)", str(type(inst)), str(inst)+"\n"+traceback.format_exc(),log_level=200)\r
-        xml2db_dom.xml2db_dom(tmppath + bctype + "logo.bak.xml", bctype)\r
-        rec10d.rec10db.update_logostatus_by_bctype_epg_ch(bctype,"2")\r
-def searchTime(titletxt, timet, deltatime, chtxt):\r
-    time = datetime.datetime.strptime(timet, "%Y-%m-%d %H:%M:%S")\r
-    ret = []\r
-    deltatime = int(deltatime)\r
-    beforetime = time.strftime("%Y%m%d%H%M%S")\r
-    beforetime = time - datetime.timedelta(hours=deltatime)\r
-    aftertime = time + datetime.timedelta(hours=deltatime)\r
-    beforetime = beforetime.strftime("%Y%m%d%H%M%S")\r
-    aftertime = aftertime.strftime("%Y%m%d%H%M%S")\r
-    one = ["", "", "", "","","",""]\r
-    tempt = 0\r
-    chtxtt=chtxt.replace("_0","_%")\r
-    d = rec10d.rec10db.select_by_time_ngram_epg_timeline(beforetime, aftertime, chtxtt)\r
-    for chtxtt, title, start, stop ,exp,longexp,category in d:\r
-        #recdblist.printutf8(chtxtt+":"+title+":"+start+":"+stop)\r
-        p = n_gram.bigram(titletxt, title)\r
-        btime = start\r
-        btime = btime[0:4] + "-" + btime[4:6] + "-" + btime[6:8] + " " + btime[8:10] + ":" + btime[10:12] + ":00"\r
-        etime = stop\r
-        etime = etime[0:4] + "-" + etime[4:6] + "-" + etime[6:8] + " " + etime[8:10] + ":" + etime[10:12] + ":00"\r
-        bt = datetime.datetime.strptime(btime, "%Y-%m-%d %H:%M:%S")\r
-        dt = bt-time\r
-        dt = abs(dt)\r
-        dt = 24 * 60 * 60 * dt.days + dt.seconds + 1\r
-        p = p * 90\r
-        dt = 1000-1000 * dt / (7 * 24 * 60 * 60)\r
-        if p > 0:\r
-            p = p + dt\r
-        if p > tempt:\r
-            one = [chtxtt, title, btime, etime,exp,longexp,category]\r
-            tempt = p\r
-        if p > 0:\r
-            #recdblist.printutf8(title + ":" + str(p) + u"点")\r
-            ""\r
-    ret = one\r
-    #print ret\r
-    return ret\r
-def searchTimeAuto(keytxt, timet, deltatime):\r
-    time = datetime.datetime.strptime(timet, "%Y-%m-%d %H:%M:%S")\r
-    ret = []\r
-    deltatime = int(deltatime)\r
-    beforetime = time.strftime("%Y%m%d%H%M%S")\r
-    aftertime = time + datetime.timedelta(hours=deltatime)\r
-    aftertime = aftertime.strftime("%Y%m%d%H%M%S")\r
-    d = rec10d.rec10db.select_by_time_keyword_auto_suggest_epg_timeline(keytxt,beforetime, aftertime)\r
-    for chtxtt, title, start, stop ,exp,longexp,category in d:\r
-        btime = start\r
-        btime = btime[0:4] + "-" + btime[4:6] + "-" + btime[6:8] + " " + btime[8:10] + ":" + btime[10:12] + ":00"\r
-        etime = stop\r
-        etime = etime[0:4] + "-" + etime[4:6] + "-" + etime[6:8] + " " + etime[8:10] + ":" + etime[10:12] + ":00"\r
-        ret.append([chtxtt, title, btime, etime,exp,longexp,category])\r
-    return ret\r
-def countSchedule(btime,etime):\r
-    """\r
-    return rec num (int return[0]:TE /int return[1]:BS/CS)\r
-    """\r
-    def cmpare(x, y):\r
-        xt = x\r
-        yt = y\r
-        if xt > yt:\r
-            return -1\r
-        elif xt == yt:\r
-            return 0\r
-        else:\r
-            return 1\r
-    dls = rec10d.rec10db.select_bytime_all_timeline(btime, etime)\r
-    times = []\r
-    btd = datetime.datetime.strptime(btime, "%Y-%m-%d %H:%M:%S")\r
-    etd = datetime.datetime.strptime(etime, "%Y-%m-%d %H:%M:%S")\r
-    for dl in dls:\r
-        dd1 = datetime.datetime.strptime(dl['btime'], "%Y-%m-%d %H:%M:%S")\r
-        dd2 = datetime.datetime.strptime(dl['etime'], "%Y-%m-%d %H:%M:%S")\r
-        if dd1 < btd:\r
-            dd1 = btd\r
-        if dd2 > etd:\r
-            dd2 = etd\r
-        times.append(dd1)\r
-        times.append(dd2)\r
-    times = list(set(times))\r
-    times.sort(cmpare)\r
-    times.reverse()\r
-    retcount = [0, 0]\r
-    for i in xrange(0, len(times)-2, 1):\r
-        bt1 = times[i]\r
-        et1 = times[i + 1]\r
-        btime1 = bt1.strftime("%Y-%m-%d %H:%M:%S")\r
-        etime1 = et1.strftime("%Y-%m-%d %H:%M:%S")\r
-        ret1 = rec10d.rec10db.count_schedule_timeline(btime1, etime1)\r
-        if retcount[0] < ret1[0]:\r
-            retcount[0] = ret1[0]\r
-        if retcount[1] < ret1[1]:\r
-            retcount[1] = ret1[1]\r
-    return retcount\r
-\r
-def searchSchedule(btime,etime):\r
-    """\r
-    return rec num (int return[0]:TE /int return[1]:BS/CS)\r
-    """\r
-    def cmpare(x, y):\r
-        xt = x\r
-        yt = y\r
-        if xt > yt:\r
-            return -1\r
-        elif xt == yt:\r
-            return 0\r
-        else:\r
-            return 1\r
-    dls = rec10d.rec10db.select_bytime_all_timeline(btime, etime)\r
-    times = []\r
-    btd = datetime.datetime.strptime(btime, "%Y-%m-%d %H:%M:%S")\r
-    etd = datetime.datetime.strptime(etime, "%Y-%m-%d %H:%M:%S")\r
-    for dl in dls:\r
-        dd1 = datetime.datetime.strptime(dl['btime'], "%Y-%m-%d %H:%M:%S")\r
-        dd2 = datetime.datetime.strptime(dl['etime'], "%Y-%m-%d %H:%M:%S")\r
-        if dd1 < btd:\r
-            dd1 = btd\r
-        if dd2 > etd:\r
-            dd2 = etd\r
-        times.append(dd1)\r
-        times.append(dd2)\r
-    times = list(set(times))\r
-    times.sort(cmpare)\r
-    times.reverse()\r
-    ret=[]\r
-    for i in xrange(0, len(times)-2, 1):\r
-        bt1 = times[i]\r
-        et1 = times[i + 1]\r
-        btime1 = bt1.strftime("%Y-%m-%d %H:%M:%S")\r
-        etime1 = et1.strftime("%Y-%m-%d %H:%M:%S")\r
-        ret1 = rec10d.rec10db.search_schedule_timeline(btime1, etime1)\r
-        ret.append(ret1)\r
-    ret = list(set(ret))\r
-    return ret\r
-\r
-def countEpgSchedule(epgbtime,epgetime):\r
-    """\r
-    return rec num (int return[0]:TE /int return[1]:BS/CS)\r
-    """\r
-    def cmpare(x, y):\r
-        xt = x\r
-        yt = y\r
-        if xt > yt:\r
-            return -1\r
-        elif xt == yt:\r
-            return 0\r
-        else:\r
-            return 1\r
-    dls = rec10d.rec10db.select_byepgtime_over_timeline(epgbtime, epgetime)\r
-    #print dls\r
-    times = []\r
-    btd = datetime.datetime.strptime(epgbtime, "%Y-%m-%d %H:%M:%S")\r
-    etd = datetime.datetime.strptime(epgetime, "%Y-%m-%d %H:%M:%S")\r
-    for dl in dls:\r
-        dd1 = datetime.datetime.strptime(dl['epgbtime'], "%Y-%m-%d %H:%M:%S")\r
-        dd2 = datetime.datetime.strptime(dl['epgetime'], "%Y-%m-%d %H:%M:%S")\r
-        if dd1 < btd:\r
-            dd1 = btd\r
-        if dd2 > etd:\r
-            dd2 = etd\r
-        times.append(dd1)\r
-        times.append(dd2)\r
-    times = list(set(times))\r
-    times.sort(cmpare)\r
-    times.reverse()\r
-    retcount = [0, 0]\r
-    for i in xrange(0, len(times)-1, 1):\r
-        bt1 = times[i]\r
-        et1 = times[i + 1]\r
-        epgbtime1 = bt1.strftime("%Y-%m-%d %H:%M:%S")\r
-        epgetime1 = et1.strftime("%Y-%m-%d %H:%M:%S")\r
-        ret1 = rec10d.rec10db.count_epgschedule_timeline(epgbtime1, epgetime1)\r
-        if retcount[0] < ret1[0]:\r
-            retcount[0] = ret1[0]\r
-        if retcount[1] < ret1[1]:\r
-            retcount[1] = ret1[1]\r
-    return retcount\r
-def searchEpgSchedule(epgbtime,epgetime):\r
-    """\r
-    return rec num (int return[0]:TE /int return[1]:BS/CS)\r
-    """\r
-    def cmpare(x, y):\r
-        xt = x\r
-        yt = y\r
-        if xt > yt:\r
-            return -1\r
-        elif xt == yt:\r
-            return 0\r
-        else:\r
-            return 1\r
-    dls = rec10d.rec10db.select_byepgtime_all_timeline(epgbtime, epgetime)\r
-    times = []\r
-    btd = datetime.datetime.strptime(epgbtime, "%Y-%m-%d %H:%M:%S")\r
-    etd = datetime.datetime.strptime(epgetime, "%Y-%m-%d %H:%M:%S")\r
-    for dl in dls:\r
-        dd1 = datetime.datetime.strptime(dl['epgbtime'], "%Y-%m-%d %H:%M:%S")\r
-        dd2 = datetime.datetime.strptime(dl['epgetime'], "%Y-%m-%d %H:%M:%S")\r
-        if dd1 < btd:\r
-            dd1 = btd\r
-        if dd2 > etd:\r
-            dd2 = etd\r
-        times.append(dd1)\r
-        times.append(dd2)\r
-    times = list(set(times))\r
-    times.sort(cmpare)\r
-    times.reverse()\r
-    ret=[]\r
-    for i in xrange(0, len(times)-2, 1):\r
-        bt1 = times[i]\r
-        et1 = times[i + 1]\r
-        epgbtime1 = bt1.strftime("%Y-%m-%d %H:%M:%S")\r
-        epgetime1 = et1.strftime("%Y-%m-%d %H:%M:%S")\r
-        ret1 = rec10d.rec10db.search_epgschedule_timeline(epgbtime1, epgetime1)\r
-        ret.append(ret1)\r
-    ret = list(set(ret))\r
-    return ret\r
diff --git a/dist/trunk/rec10/epgrefresh.py b/dist/trunk/rec10/epgrefresh.py
deleted file mode 100755 (executable)
index 523bdfc..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/usr/bin/python
-# coding: UTF-8
-# Rec10 TS Recording Tools
-# Copyright (C) 2009-2011 Yukikaze
-import os
-import sys
-import time
-
-import chdb
-import epgdb
-import recdblist
-
-update = chdb.update()
-if len(update) > 0:
-    #recdblist.printutf8(u"番組表を更新")
-    #print update
-    pid = os.fork()
-    if pid > 0:#親プロセスの場合
-        ""
-    else:#子プロセスの場合 アップデートを行って終了
-        for bctype in update:
-            time.sleep(1)
-            epgdb.updatebc(bctype)
-        sys.exit(0)
\ No newline at end of file
diff --git a/dist/trunk/rec10/guess.py b/dist/trunk/rec10/guess.py
deleted file mode 100755 (executable)
index cad73e1..0000000
+++ /dev/null
@@ -1,240 +0,0 @@
-#!/usr/bin/python
-# coding: UTF-8
-# Rec10 TS Recording Tools
-# Copyright (C) 2009-2011 Yukikaze
-
-import os
-import os.path
-import re
-import time
-import os
-import datetime
-import n_gram
-import recdblist
-import zenhan
-import auto_move
-
-def detSeriesNum(execpath):
-    files=os.listdir(execpath)
-    ss={}
-    for file in files:
-        ftitle=os.path.splitext(file)
-        fname=ftitle[0]
-        fname=zenhan.toHankaku(unicode(fname,"utf-8"))
-        nt=detNameType(fname, execpath)
-        st=nt['title']
-        if not ss.has_key(st):
-            ss[st]={}
-        ss[st][nt['num']]=ftitle
-        print ss
-    return ss
-def detDeltaNum(title,movepath):
-    """
-        #番組の話数を推測する。
-    """
-    files=os.listdir(movepath)
-    ff=[]
-    maxnum=0
-    for file in files:
-        recdblist.printutf8(unicode(file,'utf-8'),verbose_level=800)
-        file=os.path.join(movepath,file)
-        if os.path.isfile(file):
-            name=os.path.splitext(os.path.split(file)[1])
-            name=name[0]
-            name=zenhan.toHankaku(unicode(name,'utf-8'))
-            p1=detNameType(name,movepath)
-            #recdblist.printutf8(p1['title']+" "+str(p1['num']))
-            time1=time.localtime(os.path.getmtime(file))
-            time1=datetime.datetime.fromtimestamp(os.path.getmtime(file))
-            if p1['num']!=-1:
-                ff.append([p1['num'],p1['title'],time1])
-                if maxnum<p1['num']+1:
-                    maxnum=p1['num']+1
-    return detMultiDeltaDays(ff)
-def detMultiDeltaDays(num_with_title_with_dates):
-    maxnum=0
-    for ft in num_with_title_with_dates:
-        if maxnum<ft[0]+1:
-            maxnum=ft[0]+1
-    ff=num_with_title_with_dates
-    f3=[None]*maxnum
-    fret={}
-    for i in range(0, maxnum, 1):
-        f3[i]=[]
-    for f2 in ff:
-        f3[f2[0]].append(f2)
-    for i in range(maxnum):
-        for j in range(i+1,maxnum,1):
-            for ft3 in f3[i]:
-                for ft4 in f3[j]:
-                    for gdd in detSingleDeltaDay(i, ft3[2], j, ft4[2]):
-                        #print gdd
-                        if fret.get(gdd[0])!=None:
-                            #print fret
-                            fret[gdd[0]]=fret[gdd[0]]+gdd[1]
-                        else:
-                            fret[gdd[0]]=gdd[1]
-    #print fret
-    maxk=0
-    maxp=0
-    for i in range(maxnum):
-        if fret.get(i)!=None:
-            if maxp<fret[i]:
-                maxk=i
-                maxp=fret[i]
-    #print maxk
-    #print maxp
-    return maxk
-def detSingleDeltaDay(num1,date1,num2,date2):
-    dd=date1-date2
-    if date1<date2:
-        dd=date2-date1
-    dn=dd.days
-    d=num2-num1
-    if d<0:
-        d=-1*d
-    dp=dd+datetime.timedelta(hours=6)
-    dp=dp.days
-    dm=dd-datetime.timedelta(hours=6)
-    dm=dm.days
-    ret=[]
-    if dn%d*2>d:
-        dn=dn+d
-    if dm%d*2>d:
-        dm=dm+d
-    if dp%d*2>d:
-        dp=dp+d
-    #recdblist.printutf8(str(d)+":"+str(dn))
-    if dp!=dn:
-        ret.append([dn/d,60])
-        ret.append([dp/d,40])
-    elif dm!=dn:
-        ret.append([dn/d,60])
-        ret.append([dm/d,40])
-    else:
-        ret.append([dn/d,100])
-    return ret
-def detNameType(title,path):
-    """
-    type A ---title#<number>
-    type B ---title#<number>subtitle
-    type C ---title subtitle
-    type D ---title(without number)
-    type Aj ---title第<number>話
-    path --search reflexively
-    """
-    new=0
-    if re.search(u"[新]",title) or re.search(u" 新",title):
-        title=title.replace(u"[新]","")
-        title=title.replace(u" 新","")
-        new=1
-    recdblist.printutf8(title,verbose_level=800)
-    title=auto_move.getTitle(title)##titleから日時を除く
-    title=title.replace(u"無料≫","")
-    #rA=re.compile(".+(?P<title>)#\d(?P<num>)\s[0,10]\z")
-    rA=re.compile("(.+)#(\d*)\s*\Z")
-    tA=rA.match(title)
-    rB=re.compile("(.+)#(\d*)\s*(\D*)")
-    tB=rB.match(title)
-    rAj=re.compile("(.+)第(\d*)話\s*\Z")
-    tAj=rAj.match(title)
-    ret={'title':"",'type':"",'num':0,'subtitle':"",'folder':""}
-    if tA:
-        #recdblist.printutf8("typeA")
-        #recdblist.printutf8("title="+tA.group(1))
-        #recdblist.printutf8("num="+tA.group(2))
-        ret['type']="A"
-        ret['title']=tA.group(1).replace(" ","")
-        ret['num']=int(tA.group(2))
-        ret['folder']=searchFolder(tA.group(1),unicode(path,'utf-8'))
-    if tAj:
-        #recdblist.printutf8("typeA")
-        #recdblist.printutf8("title="+tAj.group(1))
-        #recdblist.printutf8("num="+tAj.group(2))
-        ret['type']="Aj"
-        ret['title']=tAj.group(1).replace(" ","")
-        ret['num']=int(tAj.group(2))
-        ret['folder']=searchFolder(tAj.group(1),unicode(path,'utf-8'))
-    elif tB:
-        #recdblist.printutf8("typeB")
-        #recdblist.printutf8("title="+tB.group(1))
-        #recdblist.printutf8("num="+tB.group(2))
-        #recdblist.printutf8("subtitle="+tB.group(3))
-        ret['type']="B"
-        ret['title']=tB.group(1).replace(" ","")
-        ret['num']=int(tB.group(2))
-        ret['folder']=searchFolder(tB.group(1),unicode(path,'utf-8'))
-        ret['subtitle']=tB.group(3)
-    else:#type C or type D
-        #fold=searchFolder(title, path)
-        ts=title.split(" ")
-        tt=""
-        rt=["",0,""]
-        for t in ts:
-            tt=tt+" "+t
-            ft1=searchFolder(tt,unicode(path,'utf-8'))
-            #recdblist.printutf8(tt)
-            #print ft1
-            if ft1!="":
-                #recdblist.printutf8(rt)
-                #recdblist.printutf8(ft1[0]+" : "+str(ft1[1]))
-                if ft1[1]>rt[1]:
-                    rt[0]=tt
-                    rt[1]=ft1[1]
-                    rt[2]=ft1[0]
-                    #recdblist.printutf8(rt)
-        #recdblist.printutf8("title="+rt[0][1:]+"/")
-        #recdblist.printutf8("subtitle = "+title.replace(rt[0][1:],"")[1:])
-        ret['title']=rt[0][1:].replace(" ","")
-        ret['num']=-1
-        ret['folder']=rt[2]
-        ret['subtitle']=title.replace(rt[0][1:],"")[1:]
-        if ret['subtitle'].replace(" ","")=="":
-            ret['type']="D"
-        else:
-            ret['type']="C"
-    if new==1:
-        ret['num']=1
-    return ret
-def searchFolder(title,path,threshold=500):
-    """
-    titleからフォルダーを探す
-    """
-    folderpath=os.listdir(path)
-    lfpath=[]
-    ngram=[]
-    for ft in folderpath:
-        fullpath=os.path.join(path, ft)
-        if os.path.isdir(fullpath):
-            lfpath.append(fullpath)
-            ftt=os.listdir(fullpath)
-            if len(ftt)>0:
-                for ft2 in ftt:
-                    folderpath.append(os.path.join(fullpath, ft2))
-        else:
-            lfpath.append(fullpath)
-    for dirp in lfpath:
-        cmpp=""
-        appp=""
-        if os.path.isdir(dirp):
-            cmpp=os.path.dirname(dirp)
-            appp=dirp
-        else:
-            cmpp=os.path.basename(dirp)
-            appp=os.path.dirname(dirp)
-        ntitle=auto_move.getTitle(title)
-        ncmpp=auto_move.getTitle(cmpp)
-        p=n_gram.trigram(ntitle,ncmpp)
-        if p>0:
-            ngram.append((p,appp))
-    ngram=list(set(ngram))
-    ngram.sort()
-    ngram.reverse()
-    if len(ngram)>0:
-        #recdblist.printutf8(title + ngram[0][1] + " : "+str(ngram[0][0]))
-        if ngram[0][0]>threshold:
-            return ngram[0][1]
-        else:
-            return ""
-    else:
-        return ""
\ No newline at end of file
diff --git a/dist/trunk/rec10/install.py b/dist/trunk/rec10/install.py
deleted file mode 100755 (executable)
index c2c9135..0000000
+++ /dev/null
@@ -1,276 +0,0 @@
-#!/usr/bin/python\r
-# coding: UTF-8\r
-# Rec10 TS Recording Tools\r
-# Copyright (C) 2009-2011 Yukikaze\r
-import time\r
-import os.path\r
-import ConfigParser\r
-import sys\r
-import commands\r
-import configwriter\r
-import shutil\r
-import traceback\r
-\r
-import recdblist\r
-def printutf8(str):\r
-    print str.encode('utf-8')\r
-def install():\r
-    version = recdblist.version\r
-