Skip to content

Commit 6db05ed

Browse files
committed
Simplify manage-cookie main file
1 parent 31b15d8 commit 6db05ed

File tree

2 files changed

+11
-14
lines changed

2 files changed

+11
-14
lines changed

cookie_python/manage/main.py

+10-13
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313

1414
class Action(str, Enum):
15-
UPDATE = "update", "test"
15+
UPDATE = "update", "Update repository cruft and dependencies"
1616

1717
def __new__(cls, value: str, description: str = "") -> Action:
1818
obj = str.__new__(cls, value)
@@ -23,10 +23,10 @@ def __new__(cls, value: str, description: str = "") -> Action:
2323

2424
class ManageCookie:
2525
def __init__(self) -> None:
26-
self.args = self.parse_args()
27-
print(self.args)
26+
self.args = self._parse_args()
2827

29-
def parse_args(self) -> argparse.Namespace:
28+
@staticmethod
29+
def _parse_args() -> argparse.Namespace:
3030
ap = argparse.ArgumentParser()
3131
ap.add_argument(
3232
"action",
@@ -47,13 +47,10 @@ def parse_args(self) -> argparse.Namespace:
4747

4848
def run(self) -> None:
4949
for repo in self.args.repo:
50-
with RepoSandbox(repo) as rs:
51-
print(f"In the sandbox for {repo}")
52-
print(rs.tempdir)
53-
print(rs)
50+
with RepoSandbox(repo):
51+
pass
5452

55-
@staticmethod
56-
def main() -> None:
57-
print("manage cookie main")
58-
mc = ManageCookie()
59-
mc.run()
53+
54+
def main() -> None:
55+
mc = ManageCookie()
56+
mc.run()

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ types-PyYAML = "*"
4949

5050
[tool.poetry.scripts]
5151
new-cookie = "cookie_python.new:main"
52-
manage-cookie = "cookie_python.manage.main:ManageCookie.main"
52+
manage-cookie = "cookie_python.manage.main:main"
5353

5454
[tool.poetry-dynamic-versioning]
5555
enable = false

0 commit comments

Comments
 (0)