diff --git a/boxchars.py b/boxchars.py index 83bd66c..bf4158e 100644 --- a/boxchars.py +++ b/boxchars.py @@ -8,4 +8,4 @@ s = ''' ╞ ╪ ╡ ╟ ╫ ╢ ╘═╧═╛ ╙─╨─╜ ''' -print(s.strip()) \ No newline at end of file +print(s.strip()) diff --git a/brename.py b/brename.py index f1d4b76..3e92694 100644 --- a/brename.py +++ b/brename.py @@ -117,7 +117,7 @@ def brename_argparse(args): return brename( args.transformation, autoyes=args.autoyes, - do_naturalsort=args.do_naturalsort, + do_naturalsort=args.naturalsort, recurse=args.recurse, ) @@ -163,8 +163,8 @@ def main(argv): parser.add_argument('transformation', help='python command using x as variable name') parser.add_argument('-y', '--yes', dest='autoyes', action='store_true') - parser.add_argument('--recurse', dest='recurse', action='store_true') - parser.add_argument('--naturalsort', dest='do_naturalsort', action='store_true') + parser.add_argument('--recurse', action='store_true') + parser.add_argument('--naturalsort', action='store_true') parser.set_defaults(func=brename_argparse) return betterhelp.single_main(argv, parser, DOCSTRING) diff --git a/breplace.py b/breplace.py index 7b1c264..b213546 100644 --- a/breplace.py +++ b/breplace.py @@ -29,8 +29,8 @@ def main(argv): parser.add_argument('replace_from') parser.add_argument('replace_to') parser.add_argument('-y', '--yes', dest='autoyes', action='store_true', help='accept results without confirming') - parser.add_argument('--recurse', dest='recurse', action='store_true', help='operate on subdirectories also') - parser.add_argument('--regex', dest='regex', action='store_true', help='treat arguments as regular expressions') + parser.add_argument('--recurse', action='store_true', help='operate on subdirectories also') + parser.add_argument('--regex', action='store_true', help='treat arguments as regular expressions') parser.set_defaults(func=breplace_argparse) args = parser.parse_args(argv) diff --git a/contentreplace.py b/contentreplace.py index c99ce49..d7dd062 100644 --- a/contentreplace.py +++ b/contentreplace.py @@ -78,9 +78,9 @@ def main(argv): parser.add_argument('replace_from') parser.add_argument('replace_to') parser.add_argument('-y', '--yes', dest='autoyes', action='store_true', help='accept results without confirming') - parser.add_argument('--recurse', dest='recurse', action='store_true') + parser.add_argument('--recurse', action='store_true') parser.add_argument('--regex', dest='do_regex', action='store_true') - parser.add_argument('--clip_prompt', '--clip-prompt', dest='clip_prompt', action='store_true') + parser.add_argument('--clip_prompt', '--clip-prompt', action='store_true') parser.set_defaults(func=contentreplace_argparse) args = parser.parse_args(argv) diff --git a/crop.py b/crop.py index 99bb280..5efc5bc 100644 --- a/crop.py +++ b/crop.py @@ -43,7 +43,7 @@ def main(argv): parser.add_argument('pattern') parser.add_argument('crops', nargs='+', type=int, default=None) - parser.add_argument('--inplace', dest='inplace', action='store_true') + parser.add_argument('--inplace', action='store_true') parser.set_defaults(func=crop_argparse) args = parser.parse_args(argv) diff --git a/delete.py b/delete.py index 9b68c7c..9738f31 100644 --- a/delete.py +++ b/delete.py @@ -1,6 +1,5 @@ import os import shutil -import sys from voussoirkit import pipeable from voussoirkit import winglob diff --git a/drawn_quartered.py b/drawn_quartered.py index 48b7a2d..45c7f20 100644 --- a/drawn_quartered.py +++ b/drawn_quartered.py @@ -4,10 +4,8 @@ This script takes an image and splits it up into pieces as separate files. drawn_quartered test.jpg --width 2 --height 2 drawn_quartered test.jpg outputname.jpg --width 3 --height 4 ''' - import argparse import math -import os import PIL.Image import sys @@ -62,8 +60,8 @@ def main(argv): parser.add_argument('input_filename') parser.add_argument('output_filename', nargs='?', default=None) - parser.add_argument('--width', dest='width', type=int, default=2) - parser.add_argument('--height', dest='height', type=int, default=2) + parser.add_argument('--width', type=int, default=2) + parser.add_argument('--height', type=int, default=2) parser.set_defaults(func=drawquarter_argparse) args = parser.parse_args(argv) diff --git a/empty_directories.py b/empty_directories.py index b0a399e..b8f4a67 100644 --- a/empty_directories.py +++ b/empty_directories.py @@ -13,7 +13,7 @@ def empty_directories_argparse(args): else: directories = pathclass.cwd().listdir() directories = (d for d in directories if d.is_dir) - + for directory in directories: if len(directory.listdir()) == 0: pipeable.stdout(directory.absolute_path) diff --git a/ffstreams.py b/ffstreams.py index d8083d0..5e1f8da 100644 --- a/ffstreams.py +++ b/ffstreams.py @@ -136,7 +136,7 @@ def main(argv): parser = argparse.ArgumentParser(description=__doc__) parser.add_argument('input_filename', nargs='+') - parser.add_argument('--moveto', dest='moveto', default=None) + parser.add_argument('--moveto', default=None) parser.add_argument('--video', '--videos', dest='videos', action='store_true') parser.add_argument('--audio', '--audios', dest='audios', action='store_true') parser.add_argument('--subtitles', '--subs', dest='subtitles', action='store_true') diff --git a/filetimelapse.py b/filetimelapse.py index 96593d6..2c7d40d 100644 --- a/filetimelapse.py +++ b/filetimelapse.py @@ -69,7 +69,7 @@ def main(argv): parser = argparse.ArgumentParser(description=__doc__) parser.add_argument('filepath') - parser.add_argument('--rate', dest='rate', default=None, required=True, type=int) + parser.add_argument('--rate', default=None, required=True, type=int) parser.set_defaults(func=filetimelapse_argparse) args = parser.parse_args(argv) diff --git a/getcrx.py b/getcrx.py index fdc112d..60b89c4 100644 --- a/getcrx.py +++ b/getcrx.py @@ -59,7 +59,7 @@ def getcrx(extension_id, auto_overwrite=None): if name is None or version is None: (crx_name, crx_ver) = get_crx_name_version(response.content) name = name or crx_name - version = version or crx_version + version = version or crx_ver name = name or extension_id version = version or time.strftime('%Y%m%d') @@ -130,10 +130,10 @@ def main(argv): parser = argparse.ArgumentParser() parser.add_argument('extension_ids', nargs='*', default=None) - parser.add_argument('--file', dest='file', default=None) - parser.add_argument('--fail_early', '--fail-early', dest='fail_early', action='store_true') - parser.add_argument('--overwrite', dest='overwrite', action='store_true') - parser.add_argument('--dont_overwrite', '--dont-overwrite', dest='dont_overwrite', action='store_true') + parser.add_argument('--file', default=None) + parser.add_argument('--fail_early', '--fail-early', action='store_true') + parser.add_argument('--overwrite', action='store_true') + parser.add_argument('--dont_overwrite', '--dont-overwrite', action='store_true') parser.set_defaults(func=getcrx_argparse) args = parser.parse_args(argv) diff --git a/grayscale.py b/grayscale.py index 96cb0ca..47f690e 100644 --- a/grayscale.py +++ b/grayscale.py @@ -3,7 +3,6 @@ import PIL.Image import sys from voussoirkit import pathclass -from voussoirkit import pipeable from voussoirkit import winglob def grayscale(filename, *, inplace=False): @@ -32,7 +31,7 @@ def main(argv): parser = argparse.ArgumentParser(description=__doc__) parser.add_argument('pattern') - parser.add_argument('--inplace', dest='inplace', action='store_true') + parser.add_argument('--inplace', action='store_true') parser.set_defaults(func=grayscale_argparse) args = parser.parse_args(argv) diff --git a/groups_of.py b/groups_of.py index 2a18071..4b30b04 100644 --- a/groups_of.py +++ b/groups_of.py @@ -1,5 +1,4 @@ import argparse -import os import sys from voussoirkit import gentools @@ -18,7 +17,7 @@ def main(argv): parser.add_argument('source') parser.add_argument('chunk_size', type=int) - parser.add_argument('--separator', dest='separator', default=',') + parser.add_argument('--separator', default=',') parser.set_defaults(func=groupsof_argparse) args = parser.parse_args(argv) diff --git a/hexdump.py b/hexdump.py index 6873510..377f90a 100644 --- a/hexdump.py +++ b/hexdump.py @@ -50,10 +50,10 @@ def main(argv): parser = argparse.ArgumentParser() parser.add_argument('filename') - parser.add_argument('--width', dest='width', default=DEFAULT_WIDTH, type=int) - parser.add_argument('--start', dest='start', default=None) - parser.add_argument('--end', dest='end', default=None) - parser.add_argument('--ellipse', dest='ellipse', action='store_true') + parser.add_argument('--width', default=DEFAULT_WIDTH, type=int) + parser.add_argument('--start', default=None) + parser.add_argument('--end', default=None) + parser.add_argument('--ellipse', action='store_true') parser.set_defaults(func=hexdump_argparse) args = parser.parse_args(argv) diff --git a/hexpng.py b/hexpng.py index 7c8a71d..ce4f097 100644 --- a/hexpng.py +++ b/hexpng.py @@ -33,8 +33,8 @@ def main(argv): parser = argparse.ArgumentParser(description=__doc__) parser.add_argument('hex_value') - parser.add_argument('--width', dest='width', type=int, default=1) - parser.add_argument('--height', dest='height', type=int, default=1) + parser.add_argument('--width', type=int, default=1) + parser.add_argument('--height', type=int, default=1) parser.set_defaults(func=hexpng_argparse) args = parser.parse_args(argv) diff --git a/inputrename.py b/inputrename.py index dfdd22e..3f46375 100644 --- a/inputrename.py +++ b/inputrename.py @@ -31,7 +31,7 @@ def main(argv): parser = argparse.ArgumentParser(description=__doc__) parser.add_argument('keyword') - parser.add_argument('--recurse', dest='recurse', action='store_true') + parser.add_argument('--recurse', action='store_true') parser.set_defaults(func=inputrename_argparse) args = parser.parse_args(argv) diff --git a/linenumbers.py b/linenumbers.py index c9c3186..5710de5 100644 --- a/linenumbers.py +++ b/linenumbers.py @@ -18,7 +18,7 @@ def main(argv): parser = argparse.ArgumentParser(description=__doc__) parser.add_argument('source') - parser.add_argument('--lazy', dest='lazy', action='store_true') + parser.add_argument('--lazy', action='store_true') parser.set_defaults(func=linenumbers_argparse) args = parser.parse_args(argv) diff --git a/mp3slice.py b/mp3slice.py index 879dec7..9b19110 100644 --- a/mp3slice.py +++ b/mp3slice.py @@ -92,7 +92,7 @@ def hyphen_range(s): low = _unitconvert(low) high = _unitconvert(high) if low is not None and high is not None and low > high: - raise exceptions.OutOfOrder(range=s, min=low, max=high) + raise ValueError(s) return low, high def hms_to_seconds(hms): diff --git a/nonempty_directories.py b/nonempty_directories.py index 9de0fa8..5f5bc22 100644 --- a/nonempty_directories.py +++ b/nonempty_directories.py @@ -13,7 +13,7 @@ def nonempty_directories_argparse(args): else: directories = pathclass.cwd().listdir() directories = (d for d in directories if d.is_dir) - + for directory in directories: if len(directory.listdir()) != 0: pipeable.stdout(directory.absolute_path) diff --git a/prune_shortcuts.py b/prune_shortcuts.py index c4c9bcc..471a853 100644 --- a/prune_shortcuts.py +++ b/prune_shortcuts.py @@ -49,7 +49,7 @@ def prune_shortcuts_argparse(args): def main(argv): parser = argparse.ArgumentParser(description=__doc__) - parser.add_argument('--recurse', dest='recurse', action='store_true') + parser.add_argument('--recurse', action='store_true') parser.add_argument('--yes', dest='autoyes', action='store_true') parser.set_defaults(func=prune_shortcuts_argparse) diff --git a/pypi_release.py b/pypi_release.py index 40a13ee..08423a7 100644 --- a/pypi_release.py +++ b/pypi_release.py @@ -408,11 +408,11 @@ def pypi_release_argparse(args): def main(argv): parser = argparse.ArgumentParser(description=__doc__) - parser.add_argument('--major', dest='major', action='store_true') - parser.add_argument('--minor', dest='minor', action='store_true') - parser.add_argument('--patch', dest='patch', action='store_true') - parser.add_argument('--do_tag', '--do-tag', dest='do_tag', action='store_true') - parser.add_argument('--debug', dest='debug', action='store_true') + parser.add_argument('--major', action='store_true') + parser.add_argument('--minor', action='store_true') + parser.add_argument('--patch', action='store_true') + parser.add_argument('--do_tag', '--do-tag', action='store_true') + parser.add_argument('--debug', action='store_true') parser.set_defaults(func=pypi_release_argparse) args = parser.parse_args(argv) diff --git a/rarpar.py b/rarpar.py index 34d8fcd..87ec14c 100644 --- a/rarpar.py +++ b/rarpar.py @@ -512,19 +512,19 @@ def main(argv): parser = argparse.ArgumentParser(description=__doc__) parser.add_argument('path') - parser.add_argument('--volume', dest='volume') - parser.add_argument('--rec', dest='rec') - parser.add_argument('--rev', dest='rev') - parser.add_argument('--par', dest='par') - parser.add_argument('--basename', dest='basename') - parser.add_argument('--password', dest='password') + parser.add_argument('--volume') + parser.add_argument('--rec') + parser.add_argument('--rev') + parser.add_argument('--par') + parser.add_argument('--basename') + parser.add_argument('--password') parser.add_argument('--profile', dest='rar_profile') - parser.add_argument('--workdir', dest='workdir', default='.') - parser.add_argument('--moveto', dest='moveto') + parser.add_argument('--workdir', default='.') + parser.add_argument('--moveto') parser.add_argument('--recycle', dest='recycle_original', action='store_true') parser.add_argument('--dictionary', dest='dictionary_size') - parser.add_argument('--solid', dest='solid', action='store_true') - parser.add_argument('--dry', dest='dry', action='store_true') + parser.add_argument('--solid', action='store_true') + parser.add_argument('--dry', action='store_true') parser.set_defaults(func=rarpar_argparse) return betterhelp.single_main(argv, parser, DOCSTRING) diff --git a/recycle.py b/recycle.py index 5d50f63..1ed96c5 100644 --- a/recycle.py +++ b/recycle.py @@ -1,6 +1,5 @@ import os import send2trash -import sys from voussoirkit import pipeable from voussoirkit import winglob diff --git a/reg_extension_icon.py b/reg_extension_icon.py index d8f21c3..d86debb 100644 --- a/reg_extension_icon.py +++ b/reg_extension_icon.py @@ -58,7 +58,7 @@ def main(argv): parser = argparse.ArgumentParser(description=__doc__) parser.add_argument('ico_file') - parser.add_argument('--name', dest='name', default=None) + parser.add_argument('--name', default=None) parser.set_defaults(func=extension_registry_argparse) args = parser.parse_args(argv) diff --git a/rejpg.py b/rejpg.py index d46feb8..2ea3ce7 100644 --- a/rejpg.py +++ b/rejpg.py @@ -51,7 +51,7 @@ def main(argv): parser = argparse.ArgumentParser(description=__doc__) parser.add_argument('patterns', nargs='+', default={'*.jpg', '*.jpeg'}) - parser.add_argument('--recurse', dest='recurse', action='store_true') + parser.add_argument('--recurse', action='store_true') parser.set_defaults(func=rejpg_argparse) args = parser.parse_args(argv) diff --git a/resize.py b/resize.py index ae189c0..0751c95 100644 --- a/resize.py +++ b/resize.py @@ -77,10 +77,10 @@ def main(argv): parser.add_argument('pattern') parser.add_argument('new_x', nargs='?', type=int, default=None) parser.add_argument('new_y', nargs='?', type=int, default=None) - parser.add_argument('--inplace', dest='inplace', action='store_true') + parser.add_argument('--inplace', action='store_true') parser.add_argument('--nearest', dest='nearest_neighbor', action='store_true') - parser.add_argument('--only_shrink', '--only-shrink', dest='only_shrink', action='store_true') - parser.add_argument('--scale', dest='scale', type=float, default=None) + parser.add_argument('--only_shrink', '--only-shrink', action='store_true') + parser.add_argument('--scale', type=float, default=None) parser.set_defaults(func=resize_argparse) args = parser.parse_args(argv) diff --git a/retry.py b/retry.py index 19fc7ee..aa28fbd 100644 --- a/retry.py +++ b/retry.py @@ -39,15 +39,15 @@ def retry_argparse(args): return retry( command=args.command, limit=args.limit, - sleepy=args.sleepy, + sleepy=args.sleep, ) def main(argv): parser = argparse.ArgumentParser(description=__doc__) parser.add_argument('command', nargs='+') - parser.add_argument('--limit', dest='limit', type=int, default=None) - parser.add_argument('--sleep', dest='sleepy', type=float, default=None) + parser.add_argument('--limit', type=int, default=None) + parser.add_argument('--sleep', type=float, default=None) parser.set_defaults(func=retry_argparse) args = parser.parse_args(argv) diff --git a/reverse.py b/reverse.py index 251eb49..e684c04 100644 --- a/reverse.py +++ b/reverse.py @@ -4,8 +4,6 @@ Reverse a string. import argparse import sys -from voussoirkit import clipext - def reverse_argparse(args): print(''.join(reversed(args.string))) diff --git a/search.py b/search.py index d704d39..385e4c2 100644 --- a/search.py +++ b/search.py @@ -283,8 +283,8 @@ def main(argv): parser.add_argument('yes_all_1', nargs='*', default=None) parser.add_argument('--all', dest='yes_all_2', nargs='+', default=[]) parser.add_argument('--any', dest='yes_any', nargs='+', default=[]) - parser.add_argument('--not_all', '--not-all', dest='not_all', nargs='+', default=[]) - parser.add_argument('--not_any', '--not-any', dest='not_any', nargs='+', default=[]) + parser.add_argument('--not_all', '--not-all', nargs='+', default=[]) + parser.add_argument('--not_any', '--not-any', nargs='+', default=[]) parser.add_argument('--strip', dest='do_strip', action='store_true') parser.add_argument('--case', dest='case_sensitive', action='store_true') @@ -292,10 +292,10 @@ def main(argv): parser.add_argument('--count', dest='show_count', action='store_true') parser.add_argument('--expression', dest='do_expression', action='store_true') parser.add_argument('--glob', dest='do_glob', action='store_true') - parser.add_argument('--line_numbers', '--line-numbers', dest='line_numbers', action='store_true') + parser.add_argument('--line_numbers', '--line-numbers', action='store_true') parser.add_argument('--local', dest='local_only', action='store_true') parser.add_argument('--regex', dest='do_regex', action='store_true') - parser.add_argument('--text', dest='text', default=None) + parser.add_argument('--text', default=None) parser.add_argument('--dirs', '--folders', dest='only_dirs', action='store_true') parser.add_argument('--files', dest='only_files', action='store_true') parser.set_defaults(func=search_argparse) diff --git a/shortcut.py b/shortcut.py index 8d73736..7e3e214 100644 --- a/shortcut.py +++ b/shortcut.py @@ -51,8 +51,8 @@ def main(argv): parser.add_argument('lnk_name') parser.add_argument('target') - parser.add_argument('--start_in', '--start-in', '--startin', dest='start_in', default=None) - parser.add_argument('--icon', dest='icon', default=None) + parser.add_argument('--start_in', '--start-in', '--startin', default=None) + parser.add_argument('--icon', default=None) parser.set_defaults(func=shortcut_argparse) args = parser.parse_args(argv) diff --git a/sole_subdir_lift.py b/sole_subdir_lift.py index 121cca7..777b630 100644 --- a/sole_subdir_lift.py +++ b/sole_subdir_lift.py @@ -11,7 +11,6 @@ import sys from voussoirkit import passwordy from voussoirkit import pathclass from voussoirkit import pipeable -from voussoirkit import spinal from voussoirkit import winglob def sole_lift(starting): diff --git a/sorted.py b/sorted.py index df874fe..4675411 100644 --- a/sorted.py +++ b/sorted.py @@ -18,7 +18,7 @@ def main(argv): parser = argparse.ArgumentParser(description=__doc__) parser.add_argument('source') - parser.add_argument('--nocase', dest='nocase', action='store_true') + parser.add_argument('--nocase', action='store_true') parser.set_defaults(func=sorted_argparse) args = parser.parse_args(argv) diff --git a/threaded_dl.py b/threaded_dl.py index 41cee28..dc261f3 100644 --- a/threaded_dl.py +++ b/threaded_dl.py @@ -140,9 +140,9 @@ def main(argv): parser.add_argument('url_file') parser.add_argument('thread_count', type=int) parser.add_argument('filename_format', nargs='?', default='{now}_{index}_{basename}') - parser.add_argument('--bytespersecond', dest='bytespersecond', default=None) - parser.add_argument('--timeout', dest='timeout', default=15) - parser.add_argument('--headers', dest='headers', nargs='+', default=None) + parser.add_argument('--bytespersecond', default=None) + parser.add_argument('--timeout', default=15) + parser.add_argument('--headers', nargs='+', default=None) parser.set_defaults(func=threaded_dl_argparse) args = parser.parse_args(argv) diff --git a/watchforlinks.py b/watchforlinks.py index 2f0af3c..88eb948 100644 --- a/watchforlinks.py +++ b/watchforlinks.py @@ -47,7 +47,7 @@ def main(argv): parser = argparse.ArgumentParser(description=__doc__) parser.add_argument('extension', nargs='?', default='generic') - parser.add_argument('--regex', dest='regex', default=None) + parser.add_argument('--regex', default=None) parser.set_defaults(func=watchforlinks_argparse) args = parser.parse_args(argv)