Mercurial > hgrepos > Python > apps > py-cutils
changeset 10:77446cd3ea6f
Move the digest generation loop from "main()" into an own function "generate_digests()".
This is to prepare for proper "--check" support in the future.
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Fri, 04 Dec 2020 16:10:41 +0100 |
| parents | 81f28bf89c26 |
| children | 15c3416d3677 |
| files | shasum.py |
| diffstat | 1 files changed, 6 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/shasum.py Fri Dec 04 15:50:28 2020 +0100 +++ b/shasum.py Fri Dec 04 16:10:41 2020 +0100 @@ -56,13 +56,16 @@ if not opts.algorithm: opts.algorithm = argv2algo("1") + if not opts.files: + opts.files.append('-') + generate_digests(opts) + + +def generate_digests(opts): if opts.bsd: out = out_bsd else: out = out_std - - if not opts.files: - opts.files.append('-') if len(opts.files) == 1 and opts.files[0] == '-': if PY2: if sys.platform == "win32":
