tutorial07-2_check_cuesheet_from_csv.py
6 import cri.atomcraft.debug
as acdebug
7 import cri.atomcraft.project
as acproject
10 csv_path = os.path.dirname(os.path.dirname(__file__)) +
'/tutorial_data/tutorial_data03/tutorial_data3.csv'
13 if os.path.isfile(csv_path) ==
False:
14 acdebug.warning(
"CSV ファイルが見つかりません: " + csv_path)
19 registered_cue_name_list = []
22 workunit = acproject.get_workunit(
"WorkUnit_Tutorial")[
"data"]
24 cuesheet_rootfolder = acproject.get_cuesheet_rootfolder(workunit)[
"data"]
27 cuesheet_name = os.path.splitext(os.path.basename(csv_path))[0]
28 cuesheet = acproject.get_child_object(cuesheet_rootfolder,
"CueSheet", cuesheet_name)[
"data"]
30 cues = acproject.find_objects(cuesheet,
"Cue")[
"data"]
33 acdebug.log(
"tutorial_data3.csv からキュー情報を収集しています...")
36 cue_name = acproject.get_value(cue,
"Name")[
"data"]
38 registered_cue_name_list.append(cue_name)
42 acdebug.log(
"tutorial_data3.csv を使ってキューのチェックを行います...")
43 unregistered_cue_name_list = []
45 with open(csv_path)
as f:
46 reader = csv.reader(f)
53 if not cue_name
in registered_cue_name_list:
55 unregistered_cue_name_list.append(cue_name)
58 if len(unregistered_cue_name_list) > 0:
59 acdebug.warning(cuesheet_name +
"に未登録キューがあります")
60 for cue_name
in unregistered_cue_name_list:
61 acdebug.warning(
"Cue " + cue_name +
"がみつかりません。")
63 acdebug.log(
"チェックシートと違いはありません。")
65 acdebug.log(
"[チュートリアル]CSV を使った未登録キューのチェック が完了しました。")