From ac5a9503449c3e8414d9cd205d813b6947daf671 Mon Sep 17 00:00:00 2001 From: "Reid D. 'arrdem' McKenzie" Date: Tue, 12 Apr 2022 01:49:29 -0600 Subject: [PATCH] Fmt. --- projects/cram/src/python/cram/__main__.py | 16 ++++++++++++++-- projects/cram/src/python/cram/common.py | 1 - projects/cram/src/python/cram/v0.py | 1 - projects/cram/src/python/cram/v1.py | 1 - 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/projects/cram/src/python/cram/__main__.py b/projects/cram/src/python/cram/__main__.py index ff9f0e9..cfc198d 100644 --- a/projects/cram/src/python/cram/__main__.py +++ b/projects/cram/src/python/cram/__main__.py @@ -1,4 +1,4 @@ -"""Cram's entry point.""" + """Cram's entry point.""" from itertools import chain import logging @@ -8,7 +8,12 @@ import pickle import sys from typing import List -from . import __version__, __author__, __license__, __copyright__ +from . import ( + __author__, + __copyright__, + __license__, + __version__, +) from .v0 import PackageV0, ProfileV0 from .v1 import PackageV1, ProfileV1 @@ -252,6 +257,13 @@ def do_state(confdir, state_file): print(*e) +@cli.command("migrate-to-toml") +@click.argument("confdir", type=Path) +@click.argument("requirement", type=str) +def do_migrate(confdig, requirement): + """Convert from the 0.0.0 config format to the 0.1.0 TOML format""" + + if __name__ == "__main__" or 1: logging.basicConfig( level=logging.INFO, diff --git a/projects/cram/src/python/cram/common.py b/projects/cram/src/python/cram/common.py index eacfbe7..ab13749 100644 --- a/projects/cram/src/python/cram/common.py +++ b/projects/cram/src/python/cram/common.py @@ -1,6 +1,5 @@ #!/usr/bin/env python3 -from abc import abstractmethod from pathlib import Path from shlex import quote as sh_quote from typing import List, Optional diff --git a/projects/cram/src/python/cram/v0.py b/projects/cram/src/python/cram/v0.py index c7fee10..b9b2ac0 100644 --- a/projects/cram/src/python/cram/v0.py +++ b/projects/cram/src/python/cram/v0.py @@ -5,7 +5,6 @@ An ill-considered pseudo-format. from pathlib import Path import re -from typing import NamedTuple from .common import Package, sh, stow diff --git a/projects/cram/src/python/cram/v1.py b/projects/cram/src/python/cram/v1.py index f830dad..2118f44 100644 --- a/projects/cram/src/python/cram/v1.py +++ b/projects/cram/src/python/cram/v1.py @@ -8,7 +8,6 @@ Based on well* defined TOML manifests, rather than many files. from hashlib import sha256 from pathlib import Path from typing import List, Optional, Union -from typing import NamedTuple from .common import Package, sh, stow