Skip to content

Commit

Permalink
Make pylint happy
Browse files Browse the repository at this point in the history
- disable superfluous-parens
- drop disable=no-self-use as it's moved to optional extension
- fix one too broad exception
  • Loading branch information
marmarek committed Aug 17, 2023
1 parent 4023ee2 commit beefb31
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 8 deletions.
1 change: 1 addition & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ disable=
consider-using-set-comprehension,
consider-using-dict-comprehension,
consider-using-f-string,
superfluous-parens,
not-an-iterable

[REPORTS]
Expand Down
2 changes: 1 addition & 1 deletion qubesadmin/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@ def _update_power_state_cache(self, subject, event, **kwargs):
:param event: name of the event
:param kwargs: other arguments
:return:
""" # pylint: disable=unused-argument,no-self-use
""" # pylint: disable=unused-argument

if not self.app.cache_enabled:
return
Expand Down
1 change: 0 additions & 1 deletion qubesadmin/tools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,6 @@ def set_qubes_verbosity(namespace):
elif verbose >= 1:
qubesadmin.log.enable()

# pylint: disable=no-self-use
def print_error(self, *args, **kwargs):
''' Print to ``sys.stderr``'''
print(*args, file=sys.stderr, **kwargs)
Expand Down
2 changes: 0 additions & 2 deletions qubesadmin/tools/dochelpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ def __init__(self, command, args, document):

def visit_desc(self, node):
""" Skips all but 'option' elements """
# pylint: disable=no-self-use
if not node.get('desctype', None) == 'option':
raise docutils.nodes.SkipChildren

Expand Down Expand Up @@ -172,7 +171,6 @@ def visit_section(self, node):
Uses :py:class:`OptionsCheckVisitor` for checking
sub-commands options
"""
# pylint: disable=no-self-use
title = str(node[0][0])
if title.upper() == SUBCOMMANDS_TITLE:
return
Expand Down
1 change: 0 additions & 1 deletion qubesadmin/tools/qvm_ls.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,6 @@ def helper(self, vm):

class FlagsColumn(Column):
'''Some fancy flags that describe general status of the domain.'''
# pylint: disable=no-self-use

def __init__(self):
super().__init__(head='FLAGS', doc=self.__class__.__doc__)
Expand Down
2 changes: 0 additions & 2 deletions qubesadmin/tools/qvm_start_daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,6 @@ async def send_monitor_layout(self, vm, layout=None, startup=False):
:param startup:
:return: None
"""
# pylint: disable=no-self-use
if vm.features.check_with_template('no-monitor-layout', False) \
or not vm.is_running():
return
Expand Down Expand Up @@ -548,7 +547,6 @@ async def start_audio_for_vm(self, vm):
:param vm: VM for which start AUDIO daemon
"""
# pylint: disable=no-self-use
pacat_cmd = [PACAT_DAEMON_PATH, '-l', self.pacat_domid(vm), vm.name]
vm.log.info('Starting AUDIO')

Expand Down
4 changes: 3 additions & 1 deletion qubesadmin/tools/qvm_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import rpm

import qubesadmin
import qubesadmin.exc
import qubesadmin.vm
import qubesadmin.utils
import qubesadmin.tools
Expand Down Expand Up @@ -1087,7 +1088,8 @@ def verify(rpmfile, reponame, package_hdr=None):
with tempfile.TemporaryDirectory(dir=TEMP_DIR) as target:
print(f'Installing template \'{name}\'...', file=sys.stderr)
if not extract_rpm(name, rpmfile, target):
raise Exception(f'Failed to extract {name} template')
raise qubesadmin.exc.QubesException(
f'Failed to extract {name} template')
cmdline = [
'qvm-template-postprocess',
'--really',
Expand Down

0 comments on commit beefb31

Please sign in to comment.