cleanup: make flake8 happy again
* remove wildcard import * remove unnecessary imports * various smaller whitespace cleanups
This commit is contained in:
parent
c9e689b3f3
commit
eda0a709c9
|
@ -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 *
|
|
||||||
|
|
|
@ -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:
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue