Run black python linting utility on all source files
This commit is contained in:
@ -4,7 +4,7 @@ import configparser
|
||||
import pathlib
|
||||
|
||||
# ========== Constants ==========
|
||||
PACMAN_CONF = pathlib.Path('/etc/pacman.conf')
|
||||
PACMAN_CONF = pathlib.Path("/etc/pacman.conf")
|
||||
|
||||
|
||||
# ========== Functions ==========
|
||||
@ -21,8 +21,7 @@ def parse_configfile(filepath):
|
||||
if not pathlib.Path(filepath).is_file():
|
||||
raise FileNotFoundError(f"{filepath} does not exist")
|
||||
|
||||
config_reader = configparser.ConfigParser(strict=False,
|
||||
allow_no_value=True)
|
||||
config_reader = configparser.ConfigParser(strict=False, allow_no_value=True)
|
||||
config_reader.read(filepath)
|
||||
|
||||
return config_reader
|
||||
|
@ -5,7 +5,7 @@ import os
|
||||
import os.path
|
||||
|
||||
# ========== Constants ==========
|
||||
PKGEXT = 'pkg.tar.xz'
|
||||
PKGEXT = "pkg.tar.xz"
|
||||
SIGEXT = f"{PKGEXT}.sig"
|
||||
|
||||
|
||||
|
@ -37,10 +37,10 @@ def db_modify(operation, db, *args):
|
||||
:raises: RepoAddError if repo-add failed
|
||||
:raises: ValueError if an invalid operation was specified
|
||||
"""
|
||||
if operation == 'add':
|
||||
syslog.info('Adding packages to database')
|
||||
elif operation == 'remove':
|
||||
syslog.info('Removing packages from database')
|
||||
if operation == "add":
|
||||
syslog.info("Adding packages to database")
|
||||
elif operation == "remove":
|
||||
syslog.info("Removing packages from database")
|
||||
else:
|
||||
raise ValueError(f"Invalid operation specified: {operation}")
|
||||
|
||||
@ -53,7 +53,7 @@ def db_modify(operation, db, *args):
|
||||
raise RepoAddError(e)
|
||||
else:
|
||||
syslog.debug(process.stdout)
|
||||
syslog.info('Database operation complete')
|
||||
syslog.info("Database operation complete")
|
||||
|
||||
|
||||
def _run_script(operation, *args):
|
||||
@ -66,7 +66,6 @@ def _run_script(operation, *args):
|
||||
options and packages
|
||||
:type args: str
|
||||
"""
|
||||
return subprocess.run((f"repo-{operation}", *args),
|
||||
check=True,
|
||||
capture_output=True,
|
||||
text=True)
|
||||
return subprocess.run(
|
||||
(f"repo-{operation}", *args), check=True, capture_output=True, text=True
|
||||
)
|
||||
|
@ -1,7 +1,6 @@
|
||||
#compdef addpkg
|
||||
|
||||
# zsh completions for 'addpkg'
|
||||
# automatically generated with http://github.com/RobSis/zsh-completion-generator
|
||||
local arguments
|
||||
|
||||
arguments=(
|
||||
|
Reference in New Issue
Block a user