Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Sep 19, 2023
1 parent b30c705 commit 1c8503c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 15 deletions.
10 changes: 0 additions & 10 deletions snapper/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@

@dataclass(repr=True)
class ExtendedClip:

clip = Any
media_pool_path = Any

Expand Down Expand Up @@ -148,7 +147,6 @@ def get_subfolder(parent_folder, subfolder_name: str):
current_folder = root_folder

for i, seg in enumerate(path_segments):

# If folder exists, navigate

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

for x in remaining_segs:

current_folder = media_pool.current_folder
logger.debug(
f"[magenta]Creating subfolder '{x}' in '{current_folder.name}'"
)
new_folder = media_pool.add_subfolder(x, current_folder)
if not media_pool.set_current_folder(new_folder):

logger.error(
f"Couldn't create subfolder '{x}'"
f"for path '{media_pool_path}' in media pool"
Expand Down Expand Up @@ -210,9 +206,7 @@ def get_next_version_name():

versions = []
for timeline in resolve.project.timelines:

if timeline is not None:

logger.debug(f'[magenta]Found timeline: "{timeline.name}"')
if re.search(
rf"^({re.escape(current_timeline_name)})(\s)(V\d+)",
Expand All @@ -224,7 +218,6 @@ def get_next_version_name():

# If none exist, start first
if not versions:

logger.debug("[magenta]No snapshots exist. Starting first.")
return f"{current_timeline_name} V1"

Expand All @@ -247,7 +240,6 @@ def get_next_version_name():
next_version_name = get_next_version_name()

if dry_run:

print(
"[bold][yellow]Dry-run enabled:[/bold]"
"No timeline snapshot will be created."
Expand All @@ -266,7 +258,6 @@ def get_next_version_name():
extended_clip = get_clip_with_path(next_version_name, "Timeline")

if not extended_clip:

logger.warning(
"[yellow]Couldn't get timeline path to make snapshot subfolder!"
"Locate and tidy up manually"
Expand All @@ -277,7 +268,6 @@ def get_next_version_name():
snapshots_folder = get_folder_from_media_pool_path(snapshots_path)

if not snapshots_folder:

logger.warning(
"[yellow]Couldn't get snapshots folder." "Locate and tidy up manually"
)
Expand Down
5 changes: 0 additions & 5 deletions snapper/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@


def setup_rich_logging():

"""Set logger to rich, allowing for console markup."""

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


def app_exit(level: int = 0, timeout: int = -1, cleanup_funcs: list = []):

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

# Run any cleanup functions
if cleanup_funcs:

for x in cleanup_funcs:
if x is not None:
x()
Expand All @@ -57,9 +54,7 @@ def app_exit(level: int = 0, timeout: int = -1, cleanup_funcs: list = []):
sys.exit(level)

else:

for i in range(timeout, -1, -1):

time.sleep(1)
sys.stdout.write("\rExiting in " + str(i))

Expand Down

0 comments on commit 1c8503c

Please sign in to comment.