cleanup: make flake8 happy again

* remove wildcard import
* remove unnecessary imports
* various smaller whitespace cleanups
This commit is contained in:
nico 2021-04-06 11:23:09 +02:00
parent c9e689b3f3
commit eda0a709c9
Signed by: mightyBroccoli
GPG Key ID: 1F6495B44DABCE6E
3 changed files with 5 additions and 26 deletions

View File

@ -3,12 +3,3 @@
# version # version
__version__ = "0.1" __version__ = "0.1"
# modules
from .bl_process import ProcessBlocklist
# main
from .main import Blimp
# utils
from .misc import *

View File

@ -4,7 +4,7 @@ import sys
from ruamel.yaml import YAML, scalarstring from ruamel.yaml import YAML, scalarstring
from .misc import * from .misc import local_file_present
class ProcessBlocklist: class ProcessBlocklist:

View File

@ -1,11 +1,13 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from pathlib import Path
import requests import requests
from appdirs import user_cache_dir from appdirs import user_cache_dir
from .bl_process import ProcessBlocklist from .bl_process import ProcessBlocklist
from .misc import * from .misc import local_file_present
class Blimp: class Blimp:
@ -89,20 +91,6 @@ class Blimp:
# blacklist processing # blacklist processing
ProcessBlocklist.process(self.blacklist, self.outfile, self.dryrun) 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__": if __name__ == "__main__":
from .cli import cli from .cli import cli