From 39e0aaed71ab787e7baaa4d8c1c2fdee206d1c06 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Mon, 9 Aug 2021 17:37:19 -0700 Subject: [PATCH] Various lint appeasements. --- adb_install.py | 2 +- directory_discrepancy.py | 1 - ffstreams.py | 9 ++++++++- filepull.py | 6 +++++- filetimelapse.py | 7 ++++--- groups_of.py | 2 +- nonempty_directories.py | 1 - pypi_release.py | 3 ++- rarpar.py | 3 ++- rejpg.py | 1 - resize.py | 1 - sole_subdir_lift.py | 2 -- threaded_dl.py | 8 +++++++- 13 files changed, 30 insertions(+), 16 deletions(-) diff --git a/adb_install.py b/adb_install.py index c216460..d488bf0 100644 --- a/adb_install.py +++ b/adb_install.py @@ -27,7 +27,7 @@ def adbinstall_argparse(args): patterns = pipeable.input_many(args.apks, skip_blank=True, strip=True) apks = [file for pattern in patterns for file in winglob.glob(pattern)] installs = [] - for apk in args.apks: + for apk in apks: apk = pathclass.Path(apk) if apk.is_dir: files = apk.glob('*.apk') diff --git a/directory_discrepancy.py b/directory_discrepancy.py index 7881cb7..767a045 100644 --- a/directory_discrepancy.py +++ b/directory_discrepancy.py @@ -11,7 +11,6 @@ flags: --recurse: Also check subdirectories. ''' -import os import argparse import sys diff --git a/ffstreams.py b/ffstreams.py index 2794bbd..ff9e134 100644 --- a/ffstreams.py +++ b/ffstreams.py @@ -98,7 +98,14 @@ def subtitle_maps(input_file, moveto=None): moveto=moveto, ) -def ffstreams(input_file, do_videos=False, do_audios=False, do_subtitles=False, dry=False, moveto=None): +def ffstreams( + input_file, + do_videos=False, + do_audios=False, + do_subtitles=False, + dry=False, + moveto=None, + ): maps = [] if do_videos: maps.extend(video_maps(input_file, moveto=moveto)) diff --git a/filepull.py b/filepull.py index 1606363..ee518e8 100644 --- a/filepull.py +++ b/filepull.py @@ -23,7 +23,11 @@ def filepull(pull_from='.', autoyes=False): duplicate_count.setdefault(basename, []) duplicate_count[basename].append(f.absolute_path) - duplicates = ['\n'.join(sorted(copies)) for (basename, copies) in duplicate_count.items() if len(copies) > 1] + duplicates = [ + '\n'.join(sorted(copies)) + for (basename, copies) in duplicate_count.items() + if len(copies) > 1 + ] duplicates = sorted(duplicates) if len(duplicates) > 0: raise Exception('duplicate names:\n' + '\n'.join(duplicates)) diff --git a/filetimelapse.py b/filetimelapse.py index 2c7d40d..05b05af 100644 --- a/filetimelapse.py +++ b/filetimelapse.py @@ -1,7 +1,8 @@ ''' -Copy your file every few minutes while you work on it, so that you can have snapshots of its history. -Not a replacement for real version control but could be applicable in very simple situations or in -cases where e.g. git is not. +Copy your file every few minutes while you work on it, so that you can have +snapshots of its history. +Not a replacement for real version control but could be applicable in very +simple situations or in cases where e.g. git is not. ''' import argparse import hashlib diff --git a/groups_of.py b/groups_of.py index d348e3c..e5e39f3 100644 --- a/groups_of.py +++ b/groups_of.py @@ -6,7 +6,7 @@ from voussoirkit import pipeable def groupsof_argparse(args): lines = pipeable.input(args.source, read_files=True, strip=True, skip_blank=True) - + chunks = gentools.chunk_generator(lines, args.chunk_size) for chunk in chunks: chunk = args.separator.join(chunk) diff --git a/nonempty_directories.py b/nonempty_directories.py index 5f5bc22..fab45a7 100644 --- a/nonempty_directories.py +++ b/nonempty_directories.py @@ -3,7 +3,6 @@ import sys from voussoirkit import pathclass from voussoirkit import pipeable -from voussoirkit import spinal from voussoirkit import winglob def nonempty_directories_argparse(args): diff --git a/pypi_release.py b/pypi_release.py index 08423a7..0ed9f25 100644 --- a/pypi_release.py +++ b/pypi_release.py @@ -154,7 +154,8 @@ def write_setup(setup_py): ################################################################################ def git_assert_current_greater_than_latest(latest_release_version, new_version): if latest_release_version >= semver_split(new_version): - raise VersionOutOfOrder(f'New version should be {new_version} but {latest_release_version} already exists.') + msg = f'New version should be {new_version} but {latest_release_version} already exists.' + raise VersionOutOfOrder(msg) def git_assert_no_stashes(): command = [GIT, 'stash', 'list'] diff --git a/rarpar.py b/rarpar.py index d35b55c..23b2905 100644 --- a/rarpar.py +++ b/rarpar.py @@ -6,7 +6,6 @@ import shutil import subprocess import sys import time -import traceback from voussoirkit import betterhelp from voussoirkit import bytestring @@ -410,8 +409,10 @@ def rarpar( def move_rars(): move(f'{workdir.absolute_path}\\{basename}*.rar', f'{moveto.absolute_path}') + def move_revs(): move(f'{workdir.absolute_path}\\{basename}*.rev', f'{moveto.absolute_path}') + def move_pars(): move(f'{workdir.absolute_path}\\{basename}*.par2', f'{moveto.absolute_path}') diff --git a/rejpg.py b/rejpg.py index 9bbbb2d..80e450b 100644 --- a/rejpg.py +++ b/rejpg.py @@ -6,7 +6,6 @@ import io import os import PIL.Image import PIL.ImageFile -import string import sys from voussoirkit import bytestring diff --git a/resize.py b/resize.py index 0ed9272..523c3bf 100644 --- a/resize.py +++ b/resize.py @@ -30,7 +30,6 @@ new_h: JPEG compression quality. ''' import argparse -import os import PIL.Image import sys diff --git a/sole_subdir_lift.py b/sole_subdir_lift.py index 1aa5187..c5ef49d 100644 --- a/sole_subdir_lift.py +++ b/sole_subdir_lift.py @@ -6,10 +6,8 @@ import sys from voussoirkit import passwordy from voussoirkit import pathclass -from voussoirkit import pipeable from voussoirkit import spinal from voussoirkit import vlogging -from voussoirkit import winglob log = vlogging.getLogger(__name__, 'sole_subdir_lift') diff --git a/threaded_dl.py b/threaded_dl.py index dc261f3..7921101 100644 --- a/threaded_dl.py +++ b/threaded_dl.py @@ -31,7 +31,13 @@ def clean_url_list(urls): def download_thread(url, filename, *, bytespersecond=None, headers=None, timeout=None): print(f' Starting "{filename}"') - downloady.download_file(url, filename, bytespersecond=bytespersecond, headers=headers, timeout=timeout) + downloady.download_file( + url, + filename, + bytespersecond=bytespersecond, + headers=headers, + timeout=timeout, + ) print(f'+Finished "{filename}"') def remove_finished(threads):