Skip to content

Commit

Permalink
Merge pull request #1376 from sbrunner/be-able-to-overide-cli
Browse files Browse the repository at this point in the history
The preset takes the advantage to the cli
  • Loading branch information
sbrunner authored Jul 14, 2024
2 parents ebc8dfe + 8a7402d commit 885bbd9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
1 change: 1 addition & 0 deletions ci/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ poetry-plugin-export==1.8.0
pip==24.0
pre-commit==3.7.1
poetry-plugin-drop-python-upper-constraint==0.1.0
importlib-metadata<8.0.0
11 changes: 4 additions & 7 deletions scan_to_paperless/scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,14 +195,11 @@ def main() -> None:
else:
call(scanimage)

args_: schema.Arguments = {}
args_: schema.Arguments = {
"append_credit_card": args.append_credit_card,
"assisted_split": args.assisted_split,
}
args_.update(config.get("default_args", {}))
args_cmd = dict(args._get_kwargs()) # pylint: disable=protected-access
del args_cmd["mode"]
del args_cmd["preset"]
del args_cmd["config"]
del args_cmd["set_config"]
args_.update(cast(schema.Arguments, args_cmd))

except subprocess.CalledProcessError as exception:
print(exception)
Expand Down

0 comments on commit 885bbd9

Please sign in to comment.