3 # Rec10 TS Recording Tools
4 # Copyright (C) 2009 Yukikaze
15 recdblist.printutf8(u"rec10の環境インストールを開始します。")
17 recdblist.printutf8(u"環境インストール処理中・・・")
18 path = str(os.path.dirname(os.path.abspath(__file__)))
19 confp = ConfigParser.SafeConfigParser()
22 if os.path.exists(os.path.join(path,Conf)):
23 confpath=os.path.join(path,Conf)
24 elif os.path.exists(os.path.join("/etc","rec10.conf")):
25 confpath=os.path.join("/etc","rec10.conf")
26 elif os.path.exists(os.path.join("/etc/rec10","rec10.conf")):
27 confpath=os.path.join("/etc/rec10","rec10.conf")
31 recdblist.printutf8(u"rec10.confが見つかりません。")
32 recdblist.printutf8(u"このinstall.pyと同じフォルダに置くか、/etc/rec10.confもしくは/etc/rec10/rec10.confにおいてください。")
34 recdblist.printutf8(u"設定ファイルの読み込みを確認//設定ファイルのパスは"+confpath)
35 if confp.get('path',"recpath")=="/path of /recording":
36 recdblist.printutf8(u"録画先のフォルダを設定してください(recpath=)")
38 recdblist.printutf8(u"DB処理に入ります")
39 if os.path.exists(os.path.join(path,"rec10d.py")):
42 rec10d.rec10db.drop_in_status()
43 rec10d.rec10db.drop_in_settings()
45 rec10d.rec10db.new_in_status()
46 rec10d.rec10db.new_in_settings()
47 except Exception, inst:
48 recdblist.printutf8(u"DB処理中にエラーが出ました。configファイルのDB設定を見直してください。")
51 recdblist.printutf8(u"チャンネル設定に入ります")
52 if os.path.exists(os.path.join(path,"chlist.xml")):
53 recdblist.printutf8(u"チャンネルリストが見つかりました。||chlist.xml")
55 recdblist.printutf8(u"チャンネルリストが見つかりません。"+os.path.join(path,"chlist.xml")+u"を作成してください。")
56 recdblist.printutf8(u"東京/名古屋/神戸のサンプルがchlist_sample_*.xmlにあるため、参考にしてください。")
58 recdblist.printutf8(u"BS放送は受信可能ですか?")
59 bsok=raw_input("y/N:")
60 if bsok=="Y" or bsok == "y" :
64 recdblist.printutf8(u"CS放送は受信可能ですか?")
65 csok=raw_input("y/N:")
66 if csok=="Y" or csok == "y" :
71 chdata.new_chdata(bsok,csok)
72 recdblist.printutf8(u"おめでとうございます 初期設定は完了しました。")
73 recdblist.printutf8(u"rec10を実行するユーザーのcrontabに"+os.path.join(path,"rec10")+u"を追加してください(5分周期が目安)")
75 rec10d.rec10db.change_installed_in_status()
80 recdblist.printutf8(cmd+u"の場所を確認中")
81 txt=commands.getoutput(u"which "+cmd)
82 if len(txt.splitlines())>2:
83 recdblist.printutf8(cmd+u"の場所を確認できませんでした。終了します")
86 recdblist.printutf8(cmd+u" : "+txt)
89 path = str(os.path.dirname(os.path.abspath(__file__)))
90 recdblist.printutf8(u"rec10 ver 0.9.1 installer.")
91 recdblist.printutf8(u"rec10のインストールを開始します。")
93 configwriter.setpath(u"wine", getpath(u"wine"))
94 configwriter.setpath(u"recpt1", getpath(u"recpt1"))
95 #configwriter.setpath(u"xvfb-run", getpath(u"xvfb-run"))
96 configwriter.setpath(u"mkvmerge", getpath(u"mkvmerge"))
97 configwriter.setpath(u"b25", getpath(u"b25"))
98 recdblist.printutf8(u"必須環境の設定が完了しました")
99 recdblist.printutf8(u"個人設定に入ります")
100 recdblist.printutf8(u"rec10の録画ファイルが置かれる場所を入力してください(1/)")
101 recdblist.printutf8(u"100GB程度は確保されている必要があります")
102 recpath=raw_input("path : ")
103 configwriter.setpath(u"recpath",recpath)
104 recdblist.printutf8(u"DBの設定に入ります。")
105 recdblist.printutf8(u"rec10が使用するMySQLのユーザーを設定してください。(2/)")
106 mysql_user=raw_input("mysql_user : ")
107 configwriter.setdbpath("mysql_user", mysql_user)
108 recdblist.printutf8(u"パスワードを設定してください(3/)")
109 mysql_passwd=raw_input("mysql_passwd : ")
110 configwriter.setdbpath("mysql_passwd", mysql_passwd)
111 recdblist.printutf8(u"同時録画可能数の設定に入ります")
112 recdblist.printutf8(u"TE(地デジ)録画可能数(PT*だと2 白Friioだと1)(4/)")
113 te_max=raw_input("te_max : ")
114 te_max=str(int(te_max))
115 configwriter.setenv("te_max", te_max)
116 recdblist.printutf8(u"BS/CS110録画可能数(PT*だと2 黒Friioだと1)(5/)")
117 bscs_max=raw_input("bscs_max : ")
118 bscs_max=str(int(bscs_max))
119 configwriter.setenv("bscs_max", bscs_max)
120 recdblist.printutf8(u"同時エンコード最大数を設定してください(6/)")
121 recdblist.printutf8(u"CPUのコア数が目安です")
122 enc_max=raw_input("[2]:")
126 enc_max=str(int(enc_max))
127 configwriter.setenv("enc_max", enc_max)
128 configwriter.writeconf()
129 recdblist.printutf8(u"チャンネルの設定に入ります(7/)")
130 recdblist.printutf8(u"rec10を設置する地域を選んでください。")
131 recdblist.printutf8(u"1:東京 2:神戸 3:名古屋 4:その他")
135 shutil.copy(os.path.join(path,"chlist_sample_tokyo.xml"),os.path.join(path,"chlist.xml"))
137 shutil.copy(os.path.join(path,"chlist_sample_kobe.xml"),os.path.join(path,"chlist.xml"))
139 shutil.copy(os.path.join(path,"chlist_sample_nagoya.xml"),os.path.join(path,"chlist.xml"))
141 recdblist.printutf8(u"チャンネルの設定が必要です。")
142 recdblist.printutf8(u"chlist_sample_*を参考にchlist.xmlを作成した後に次のステップに進んでください。")
144 recdblist.printutf8(u"初期設定が終了しました。")
145 recdblist.printutf8(u"makeを実行した後にrootにてmake installを実行するとインストールされます。")
146 if __name__ == "__main__":