Some flake8 issues with the fetchmail script
This commit is contained in:
@@ -23,6 +23,7 @@ poll "{host}" proto {protocol} port {port}
|
||||
sslproto 'AUTO'
|
||||
"""
|
||||
|
||||
|
||||
def escape_rc_string(arg):
|
||||
return arg.replace("\\", "\\\\").replace('"', '\\"')
|
||||
|
||||
@@ -66,11 +67,11 @@ def run(connection, cursor, keep, debug):
|
||||
# No mail is not an error
|
||||
if not error_message.startswith("fetchmail: No mail"):
|
||||
print(error_message)
|
||||
|
||||
user_info = "for %s at %s" % (user_email, host)
|
||||
# Number of messages seen is not a error as well
|
||||
if "messages" in error_message and "(seen " in error_message and \
|
||||
user_info in error_message:
|
||||
if ("messages" in error_message and
|
||||
"(seen " in error_message and
|
||||
user_info in error_message):
|
||||
print(error_message)
|
||||
finally:
|
||||
cursor.execute("""
|
||||
@@ -80,7 +81,6 @@ def run(connection, cursor, keep, debug):
|
||||
connection.commit()
|
||||
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
debug = os.environ.get("DEBUG", None) == "True"
|
||||
keep = os.environ.get("FETCHMAIL_KEEP", None) == "True"
|
||||
@@ -91,4 +91,3 @@ if __name__ == "__main__":
|
||||
run(connection, cursor, keep, debug)
|
||||
cursor.close()
|
||||
time.sleep(int(os.environ.get("FETCHMAIL_DELAY", 60)))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user