From eda0a709c9bc0eb42f6fccce4e00285dfff60bd9 Mon Sep 17 00:00:00 2001 From: nico wellpott Date: Tue, 6 Apr 2021 11:23:09 +0200 Subject: cleanup: make flake8 happy again * remove wildcard import * remove unnecessary imports * various smaller whitespace cleanups --- src/blimp/__init__.py | 9 --------- src/blimp/bl_process.py | 2 +- src/blimp/main.py | 20 ++++---------------- 3 files changed, 5 insertions(+), 26 deletions(-) (limited to 'src/blimp') diff --git a/src/blimp/__init__.py b/src/blimp/__init__.py index 769e3ce..19c2b68 100644 --- a/src/blimp/__init__.py +++ b/src/blimp/__init__.py @@ -3,12 +3,3 @@ # version __version__ = "0.1" - -# modules -from .bl_process import ProcessBlocklist - -# main -from .main import Blimp - -# utils -from .misc import * diff --git a/src/blimp/bl_process.py b/src/blimp/bl_process.py index 2e56275..e0db3da 100644 --- a/src/blimp/bl_process.py +++ b/src/blimp/bl_process.py @@ -4,7 +4,7 @@ import sys from ruamel.yaml import YAML, scalarstring -from .misc import * +from .misc import local_file_present class ProcessBlocklist: diff --git a/src/blimp/main.py b/src/blimp/main.py index 4189bbc..fccf9af 100644 --- a/src/blimp/main.py +++ b/src/blimp/main.py @@ -1,11 +1,13 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- +from pathlib import Path + import requests from appdirs import user_cache_dir from .bl_process import ProcessBlocklist -from .misc import * +from .misc import local_file_present class Blimp: @@ -89,21 +91,7 @@ class Blimp: # blacklist processing ProcessBlocklist.process(self.blacklist, self.outfile, self.dryrun) - """ - # reload config if changes have been applied - if self.change: - # catch ejabberdctl missing - if Path("/usr/sbin/ejabberdctl").is_file(): - subprocess.call(["/usr/sbin/ejabberdctl", "reload_config"], shell=False) - - # report missing ejabberdctl reload_config - else: - print("/usr/sbin/ejabberdctl was not found", file=sys.stderr) - print("blacklist changes have been applied\nejabberd config was not reloaded", file=sys.stderr) - sys.exit(1) - """ - if __name__ == "__main__": - from .cli import cli + from .cli import cli cli() -- cgit v1.2.3-54-g00ecf