Skip to content

Commit b8d3b8c

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 6c25538 commit b8d3b8c

2 files changed

Lines changed: 0 additions & 15 deletions

File tree

snapper/cli.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232

3333
@dataclass(repr=True)
3434
class ExtendedClip:
35-
3635
clip = Any
3736
media_pool_path = Any
3837

@@ -148,7 +147,6 @@ def get_subfolder(parent_folder, subfolder_name: str):
148147
current_folder = root_folder
149148

150149
for i, seg in enumerate(path_segments):
151-
152150
# If folder exists, navigate
153151

154152
if sub := get_subfolder(current_folder, seg):
@@ -168,14 +166,12 @@ def get_subfolder(parent_folder, subfolder_name: str):
168166
remaining_segs = path_segments[i:]
169167

170168
for x in remaining_segs:
171-
172169
current_folder = media_pool.current_folder
173170
logger.debug(
174171
f"[magenta]Creating subfolder '{x}' in '{current_folder.name}'"
175172
)
176173
new_folder = media_pool.add_subfolder(x, current_folder)
177174
if not media_pool.set_current_folder(new_folder):
178-
179175
logger.error(
180176
f"Couldn't create subfolder '{x}'"
181177
f"for path '{media_pool_path}' in media pool"
@@ -210,9 +206,7 @@ def get_next_version_name():
210206

211207
versions = []
212208
for timeline in resolve.project.timelines:
213-
214209
if timeline is not None:
215-
216210
logger.debug(f'[magenta]Found timeline: "{timeline.name}"')
217211
if re.search(
218212
rf"^({re.escape(current_timeline_name)})(\s)(V\d+)",
@@ -224,7 +218,6 @@ def get_next_version_name():
224218

225219
# If none exist, start first
226220
if not versions:
227-
228221
logger.debug("[magenta]No snapshots exist. Starting first.")
229222
return f"{current_timeline_name} V1"
230223

@@ -247,7 +240,6 @@ def get_next_version_name():
247240
next_version_name = get_next_version_name()
248241

249242
if dry_run:
250-
251243
print(
252244
"[bold][yellow]Dry-run enabled:[/bold]"
253245
"No timeline snapshot will be created."
@@ -266,7 +258,6 @@ def get_next_version_name():
266258
extended_clip = get_clip_with_path(next_version_name, "Timeline")
267259

268260
if not extended_clip:
269-
270261
logger.warning(
271262
"[yellow]Couldn't get timeline path to make snapshot subfolder!"
272263
"Locate and tidy up manually"
@@ -277,7 +268,6 @@ def get_next_version_name():
277268
snapshots_folder = get_folder_from_media_pool_path(snapshots_path)
278269

279270
if not snapshots_folder:
280-
281271
logger.warning(
282272
"[yellow]Couldn't get snapshots folder." "Locate and tidy up manually"
283273
)

snapper/utils.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88

99
def setup_rich_logging():
10-
1110
"""Set logger to rich, allowing for console markup."""
1211

1312
FORMAT = "%(message)s"
@@ -37,7 +36,6 @@ def install_rich_tracebacks(show_locals=False):
3736

3837

3938
def app_exit(level: int = 0, timeout: int = -1, cleanup_funcs: list = []):
40-
4139
"""
4240
Exit function to allow time to
4341
read console output if necessary before exit.
@@ -47,7 +45,6 @@ def app_exit(level: int = 0, timeout: int = -1, cleanup_funcs: list = []):
4745

4846
# Run any cleanup functions
4947
if cleanup_funcs:
50-
5148
for x in cleanup_funcs:
5249
if x is not None:
5350
x()
@@ -57,9 +54,7 @@ def app_exit(level: int = 0, timeout: int = -1, cleanup_funcs: list = []):
5754
sys.exit(level)
5855

5956
else:
60-
6157
for i in range(timeout, -1, -1):
62-
6358
time.sleep(1)
6459
sys.stdout.write("\rExiting in " + str(i))
6560

0 commit comments

Comments
 (0)