From 4592eb9c8269aaa2459fd620726209c9586d861c Mon Sep 17 00:00:00 2001 From: Guido Günther Date: Fri, 23 Sep 2016 11:37:30 +0200 Subject: whatmaps/command.py: flake8 clean --- whatmaps/command.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'whatmaps') diff --git a/whatmaps/command.py b/whatmaps/command.py index f59b214..913268c 100755 --- a/whatmaps/command.py +++ b/whatmaps/command.py @@ -17,7 +17,6 @@ # - import errno import glob import os @@ -30,15 +29,16 @@ from . distro import Distro from . pkg import PkgError from . systemd import Systemd + def check_maps(procs, shared_objects): restart_procs = {} for proc in procs: for so in shared_objects: if proc.maps(so): if proc.exe in restart_procs: - restart_procs[proc.exe] += [ proc ] + restart_procs[proc.exe] += [proc] else: - restart_procs[proc.exe] = [ proc ] + restart_procs[proc.exe] = [proc] break return restart_procs @@ -78,7 +78,7 @@ def find_pkgs(procs, distro): if pkg.name in pkgs: pkgs[pkg.name].procs.append(proc) else: - pkg.procs = [ proc ] + pkg.procs = [proc] pkgs[pkg.name] = pkg if pkgs: @@ -125,7 +125,7 @@ def find_systemd_units(procmap, distro): "- restart manually" % proc.exe) else: units.add(unit) - units -= set([ service + '.service' for service in distro.service_blacklist ]) + units -= set([service + '.service' for service in distro.service_blacklist]) return units @@ -165,7 +165,7 @@ def main(argv): logging.debug("Detected distribution: '%s'", distro.id) if args: - pkgs = [ distro.pkg(arg) for arg in args ] + pkgs = [distro.pkg(arg) for arg in args] elif options.apt and distro.has_apt(): try: pkgs = distro.read_apt_pipeline() @@ -242,6 +242,7 @@ def main(argv): return 0 + def run(): return(main(sys.argv)) -- cgit v1.2.3