Skip to content

Commit

Permalink
Merge ec700ab into 5b525b4
Browse files Browse the repository at this point in the history
  • Loading branch information
underchemist committed Oct 6, 2019
2 parents 5b525b4 + ec700ab commit 6012324
Show file tree
Hide file tree
Showing 6 changed files with 162 additions and 49 deletions.
4 changes: 0 additions & 4 deletions .bumpversion.cfg
Expand Up @@ -11,10 +11,6 @@ replace = version = "{new_version}"
search = __version__ = "{current_version}"
replace = __version__ = "{new_version}"

[bumpversion:file:tests/test_geojsplit.py]
search = __version__ = "{current_version}"
replace = __version__ = "{new_version}"

[bumpversion:file:docs/source/conf.py]
search = version = "{current_version}"
replace = version = "{new_version}"
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Expand Up @@ -104,4 +104,5 @@ venv.bak/
.mypy_cache/

# vscode settings
.vscode/settings.json
.vscode/settings.json
.vscode/launch.json
15 changes: 9 additions & 6 deletions geojsplit/cli.py
Expand Up @@ -40,9 +40,12 @@ def gen_filename(
count: int
features: geojson.feature.FeatureCollection
for count, features in enumerate(gj.stream(batch=args.geometry_count)):
new_filename: Path = gen_filename(
gj.geojson, count, width=args.suffix_length, parent=args.output
)
try:
new_filename: Path = gen_filename(
gj.geojson, count, width=args.suffix_length, parent=args.output
)
except TypeError as e:
logger.error(f"Could not generate a unique suffix.", exc_info=e)
try:
if not args.dry_run:
if not new_filename.parent.exists():
Expand Down Expand Up @@ -77,7 +80,7 @@ def pad(file_count: int, width: int) -> str:
logger.error(
f"Suffix of width of {width} is not enough to generate a unique filename. Increase "
)
sys.exit(1)
return

char_array: List[str] = []
digit: int
Expand Down Expand Up @@ -164,11 +167,11 @@ def setup_parser() -> argparse.ArgumentParser:
return parser


def main() -> None:
def main(args=None) -> None:
setup_logger()
logger: logging.Logger = logging.getLogger(__name__)
parser: argparse.ArgumentParser = setup_parser()
args: argparse.Namespace = parser.parse_args()
args: argparse.Namespace = parser.parse_args(args=args)

if args.verbose:
logger.setLevel(logging.DEBUG)
Expand Down

0 comments on commit 6012324

Please sign in to comment.