From bfa47d1ae0ab1c5f99cd2f2b0945eea3fecb0253 Mon Sep 17 00:00:00 2001 From: nico Date: Wed, 10 Jun 2020 12:40:19 +0200 Subject: [PATCH] syntax and pep8 what have I become - a pep8 monster --- cleanup.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cleanup.py b/cleanup.py index 63947bd..1654497 100755 --- a/cleanup.py +++ b/cleanup.py @@ -1,7 +1,8 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- -import logging import datetime +import logging + from control import EjabberdCtl @@ -11,7 +12,7 @@ class EjabberdCleanup(EjabberdCtl): self.ignore_hosts = [] self.ignore_usernames = [] self.dry = False - self.skip_by_roster_roster = True + self.skip_by_roster = True self.delete_not_login = True self.offline_since_days = None @@ -46,7 +47,6 @@ class EjabberdCleanup(EjabberdCtl): if lastdate != None and lastdate-datetime.datetime.now() > datetime.timedelta(days=self.offline_since_days): self.delete_user(host, user, f"last seen @ {lastdate}") return - def run(self): for host in self.fetch_vhosts(): @@ -58,8 +58,8 @@ class EjabberdCleanup(EjabberdCtl): continue self.run_user(host, user) + if __name__ == "__main__": - import json from config import Config # load config