Skip to content

Commit

Permalink
Removed unused imports etc.
Browse files Browse the repository at this point in the history
  • Loading branch information
pchakraborty committed May 23, 2024
1 parent c6c1cdb commit d1910da
Show file tree
Hide file tree
Showing 13 changed files with 17 additions and 30 deletions.
3 changes: 0 additions & 3 deletions src/mepo/command/changed-files.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import os
from shutil import get_terminal_size

from ..state import MepoState
from ..component import MepoVersion

from ..utilities import colors
from ..utilities import verify
from ..utilities.version import version_to_string
from ..utilities.version import sanitize_version_string
Expand Down
1 change: 0 additions & 1 deletion src/mepo/command/checkout-if-exists.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from ..state import MepoState
from ..utilities import verify
from ..git import GitRepository
from ..utilities import colors

Expand Down
8 changes: 5 additions & 3 deletions src/mepo/command/commit.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import os
import tempfile
import subprocess

from ..state import MepoState
from ..utilities import verify
from ..git import GitRepository
from ..git import get_editor as get_git_editor

from .stage import stage_files

# Popping up an EDITOR is based on https://stackoverflow.com/a/39989442
import os, tempfile, subprocess


def run(args):
allcomps = MepoState.read_state()
Expand All @@ -17,6 +18,7 @@ def run(args):
tf_file = None

# Pop up an editor if a message is not provided
# Popping up an EDITOR is based on https://stackoverflow.com/a/39989442
if not args.message:
EDITOR = get_git_editor()
initial_message = b"" # set up the file
Expand Down
2 changes: 1 addition & 1 deletion src/mepo/command/compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def run(args):
allcomps = MepoState.read_state()

if not any_differing_repos(allcomps):
print(f"No repositories have changed")
print("No repositories have changed")
else:
max_namelen, max_origlen = calculate_header_lengths(allcomps, args.all)
print_header(max_namelen, max_origlen)
Expand Down
2 changes: 1 addition & 1 deletion src/mepo/command/develop.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ def run(args):
)
)
git.checkout(comp.develop)
output = git.pull()
_ = git.pull()
3 changes: 0 additions & 3 deletions src/mepo/command/diff.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import sys
import time
import multiprocessing as mp
import os

from shutil import get_terminal_size
Expand Down
2 changes: 1 addition & 1 deletion src/mepo/command/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def run(args):
else:
style = None

allcomps = MepoState.initialize(args.registry, style)
_ = MepoState.initialize(args.registry, style)

if not style:
print(f"Initializing mepo using {args.registry}")
Expand Down
8 changes: 4 additions & 4 deletions src/mepo/command/reset.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def run(args):
# will ask them to confirm that they want to reset the project
if not args.force and not args.dry_run:
print(
f"Are you sure you want to reset the project? If so, type 'yes' and press enter.",
"Are you sure you want to reset the project? If so, type 'yes' and press enter.",
end=" ",
)
answer = input()
Expand All @@ -58,12 +58,12 @@ def run(args):
print(f"dry-run only. Not removing {relpath}")

# Next, we need to remove the .mepo directory
print(f"Removing mepo state", end="...")
print("Removing mepo state", end="...")
if not args.dry_run:
shutil.rmtree(MepoState.get_dir())
print("done.")
else:
print(f"dry-run only. Not removing mepo state")
print("dry-run only. Not removing mepo state")

# If they pass in the --reclone flag, then we will re-clone all the subrepos
if args.reclone:
Expand All @@ -88,7 +88,7 @@ def run(args):
mepo_clone_run(clone_args)
print("Recloning done.")
else:
print(f"Dry-run only. Not re-cloning all subrepos")
print("Dry-run only. Not re-cloning all subrepos")


def _get_relative_path(local_path):
Expand Down
2 changes: 0 additions & 2 deletions src/mepo/command/restore-state.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import sys
import time
import multiprocessing as mp

from ..state import MepoState
Expand Down
8 changes: 5 additions & 3 deletions src/mepo/command/tag_create.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import os
import tempfile
import subprocess

from ..state import MepoState
from ..utilities import verify
from ..git import GitRepository
from ..git import get_editor as get_git_editor

# Popping up an EDITOR is based on https://stackoverflow.com/a/39989442
import os, tempfile, subprocess


def run(args):
allcomps = MepoState.read_state()
Expand All @@ -22,6 +23,7 @@ def run(args):

if create_annotated_tag:
# Pop up an editor if a message is not provided
# Popping up an EDITOR is based on https://stackoverflow.com/a/39989442
if not args.message:
EDITOR = get_git_editor()
initial_message = b"" # set up the file
Expand Down
1 change: 0 additions & 1 deletion src/mepo/command/unstage.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from ..state import MepoState
from ..utilities import shellcmd
from ..utilities import verify
from ..git import GitRepository

Expand Down
3 changes: 0 additions & 3 deletions src/mepo/component.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import os
import shlex
import textwrap

from collections import namedtuple
from urllib.parse import urlparse

from .utilities import shellcmd
from .utilities import mepoconfig
from .utilities.version import MepoVersion

# This will be used to store the "final nodes" from each subrepo
Expand Down
4 changes: 0 additions & 4 deletions src/mepo/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,12 @@
import stat
import pickle

from pathlib import Path

from .registry import Registry
from .component import MepoComponent
from .utilities import shellcmd
from .utilities import colors
from .utilities.exceptions import StateDoesNotExistError
from .utilities.exceptions import StateAlreadyInitializedError
from .utilities.chdir import chdir as mepo_chdir
from .utilities.version import MepoVersion


class MepoState(object):
Expand Down

0 comments on commit d1910da

Please sign in to comment.