Skip to content

Commit

Permalink
Fix more linting errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
Isaak-Malers committed Feb 22, 2024
1 parent 5c30628 commit 8cb925a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion CliFunction.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,20 @@
import re


"""
Provides the simplest possible wrapper for exposing python functions to be run on a command line!
Annotate python functions with the [@cli_function] decorator, and annotate the function fully with the builtin python tools.
The library will generate a man page for your file, and provide helpful error messages when arguments are not formatted correctly.
"""


class FunctionCliException(Exception):
"""
Common exception type for CliFunction.
This ensures it is obvious when a problem occurs with the CLI wrapper vs the code being called into.
"""
pass


class DefaultArgumentParser:
Expand Down Expand Up @@ -61,6 +69,7 @@ def type_coercer(self, *, arg: str, desired_type: type):

if desired_type is float:
return float(arg)
# pylint: disable=broad-exception-caught
except Exception: # noqa
return None # what a vile pythonic thing to do.

Expand Down

0 comments on commit 8cb925a

Please sign in to comment.