Skip to content

Commit

Permalink
Fix: ビルド用に細かい修正
Browse files Browse the repository at this point in the history
  • Loading branch information
aorinngoDo committed Aug 30, 2023
1 parent 0a9514f commit d9e2c80
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions nicochannel_comment.py
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ def comments_file_save(packet: ET.Element, filename: str) -> None:
for video_id in videos_id_list:
video_info = get_video_info(video_id)

default_output_dir = os.path.dirname(os.path.abspath(__file__))
default_output_dir = os.path.dirname(os.path.abspath(sys.argv[0]))
default_output_filename = video_info.get('data', {}).get('video_page', {}).get('title', '') + '.xml'
default_output_filename = check_output_filename(default_output_filename)

Expand All @@ -505,8 +505,11 @@ def comments_file_save(packet: ET.Element, filename: str) -> None:
output_filename = os.path.join(default_output_dir, default_output_filename)
else:
output_filename = output_filepath_input_dialog(os.path.join(default_output_dir, default_output_filename))
if output_filename is None:
logger.info('処理をキャンセルします.')
sys.exit(0)

if output_filename is None:
if output_filename is None or output_filename == '':
logger.warning('出力先ファイルパスが入力されていないため, デフォルト値を使用します.')
output_filename = os.path.join(default_output_dir, default_output_filename)
elif check_output_dir(output_filename):
Expand Down

0 comments on commit d9e2c80

Please sign in to comment.