Skip to content

Commit 59c1b95

Browse files
committed
🎨 style: 格式化代码
1 parent ae7174b commit 59c1b95

File tree

1 file changed

+20
-10
lines changed

1 file changed

+20
-10
lines changed

src/SimpleCutMainFrame.py

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ def on_add_file_button_click(self, event):
7777

7878
self.append_files(filename, path)
7979

80-
logging.debug("导入文件:{}, {}".format(file_dlg.GetFilename(), file_dlg.GetPath()))
80+
logging.debug("导入文件:{}, {}".format(
81+
file_dlg.GetFilename(), file_dlg.GetPath()))
8182

8283
file_dlg.Destroy()
8384

@@ -128,7 +129,8 @@ def on_move_up_file_button_click(self, event):
128129
return # 如果没有选中
129130

130131
if value == 0:
131-
wx.MessageBox("选中素材已置顶。", "错误", style=wx.YES_DEFAULT | wx.ICON_QUESTION)
132+
wx.MessageBox("选中素材已置顶。", "错误",
133+
style=wx.YES_DEFAULT | wx.ICON_QUESTION)
132134
return # 如果是第一个物品
133135

134136
self.video_sequence.swap_item(value, value - 1)
@@ -146,10 +148,12 @@ def on_move_down_file_button_click(self, event):
146148
return # 如果没有选中
147149

148150
if value == self.list_ctrl.GetItemCount() - 1:
149-
wx.MessageBox("选中素材在最末端。", "错误", style=wx.YES_DEFAULT | wx.ICON_QUESTION)
151+
wx.MessageBox("选中素材在最末端。", "错误",
152+
style=wx.YES_DEFAULT | wx.ICON_QUESTION)
150153
return # 如果是最后一个
151154

152-
self.video_sequence.swap_item(self.first_selected_index, self.first_selected_index + 1)
155+
self.video_sequence.swap_item(
156+
self.first_selected_index, self.first_selected_index + 1)
153157

154158
self.update_video_model_item(value)
155159
self.update_video_model_item(value + 1)
@@ -175,7 +179,8 @@ def on_export_button_click(self, event):
175179

176180
# 导出文件名为空则使用时间
177181
if export_name == '':
178-
export_name = str(time.strftime('No Title %Y.%m.%d - %H.%M.output.mp4'))
182+
export_name = str(time.strftime(
183+
'No Title %Y.%m.%d - %H.%M.output.mp4'))
179184

180185
# 导出路径不为空则更改导出目录
181186
if not export_path == '':
@@ -242,7 +247,8 @@ def export_video_file(self, export_amix, export_mbps, export_name):
242247
if audio_tracks_number > 0 and export_amix:
243248
# 多音轨,合并
244249
# amix_filter
245-
filter_complex_filters.append(merge_filestream_audio_channel(f"{no}", audio_tracks_number, f"{no}a"))
250+
filter_complex_filters.append(merge_filestream_audio_channel(
251+
f"{no}", audio_tracks_number, f"{no}a"))
246252
concat_inputs.append(f'{no}a')
247253
else:
248254
# 单音轨
@@ -251,7 +257,8 @@ def export_video_file(self, export_amix, export_mbps, export_name):
251257
concat_string = concat_filter(concat_inputs, "v", "a")
252258
filter_complex_filters.append(concat_string)
253259
# 拼接 filter_complex 命令行参数,拼接滤镜
254-
console_command += filter_complex_string + f'"{";".join(filter_complex_filters)}"'
260+
console_command += filter_complex_string + \
261+
f'"{";".join(filter_complex_filters)}"'
255262
console_command += ' -map "[v]" -map "[a]"'
256263
# 拼接全指令
257264
if os.path.split(export_name)[1] == '':
@@ -262,13 +269,16 @@ def export_video_file(self, export_amix, export_mbps, export_name):
262269

263270
# 执行命令
264271
try:
265-
subprocess.run(console_command, shell=False, check=True, creationflags=subprocess.CREATE_NO_WINDOW)
272+
subprocess.run(console_command, shell=False, check=True,
273+
creationflags=subprocess.CREATE_NO_WINDOW)
266274

267275
# 完成命令,发送事件
268-
wx.CallAfter(self.on_export_done, ExportMessage(WorkStateEnum.SUCCESS, "导出完成", export_name))
276+
wx.CallAfter(self.on_export_done, ExportMessage(
277+
WorkStateEnum.SUCCESS, "导出完成", export_name))
269278
except subprocess.CalledProcessError as e:
270279
# 导出失败,发送事件
271-
wx.CallAfter(self.on_export_done, ExportMessage(WorkStateEnum.FAIL, e))
280+
wx.CallAfter(self.on_export_done,
281+
ExportMessage(WorkStateEnum.FAIL, e))
272282

273283
def on_open_project_website_button_click(self, event):
274284
# TODO: Implement ProjectWebBtnOnClick

0 commit comments

Comments
 (0)