Various lint appeasements.

This commit is contained in:
voussoir 2021-08-09 17:37:19 -07:00
parent 5f201f99a1
commit 39e0aaed71
No known key found for this signature in database
GPG key ID: 5F7554F8C26DACCB
13 changed files with 30 additions and 16 deletions

View file

@ -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')

View file

@ -11,7 +11,6 @@ flags:
--recurse:
Also check subdirectories.
'''
import os
import argparse
import sys

View file

@ -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))

View file

@ -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))

View file

@ -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

View file

@ -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)

View file

@ -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):

View file

@ -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']

View file

@ -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}')

View file

@ -6,7 +6,6 @@ import io
import os
import PIL.Image
import PIL.ImageFile
import string
import sys
from voussoirkit import bytestring

View file

@ -30,7 +30,6 @@ new_h:
JPEG compression quality.
'''
import argparse
import os
import PIL.Image
import sys

View file

@ -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')

View file

@ -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):