summaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authorLukas Fleischer <lfleischer@calcurse.org>2021-04-03 13:21:43 -0400
committerLukas Fleischer <lfleischer@calcurse.org>2021-04-03 17:55:46 -0400
commitf1e84bd18bc6f9e0ce52b9f1dd08590e97d438a7 (patch)
treedf72cbbbca973e4e58da86e8d3e09c8f8caf4c4b /contrib
parent594bd62378b525de2d1551f156ef3804ddfe394f (diff)
downloadcalcurse-f1e84bd18bc6f9e0ce52b9f1dd08590e97d438a7.tar.gz
calcurse-f1e84bd18bc6f9e0ce52b9f1dd08590e97d438a7.zip
Fix flake8 and isort warnings
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/caldav/calcurse-caldav.py15
-rw-r--r--contrib/setup.cfg3
2 files changed, 12 insertions, 6 deletions
diff --git a/contrib/caldav/calcurse-caldav.py b/contrib/caldav/calcurse-caldav.py
index 2fbec37..1dfb5ae 100755
--- a/contrib/caldav/calcurse-caldav.py
+++ b/contrib/caldav/calcurse-caldav.py
@@ -3,9 +3,8 @@
import argparse
import base64
import configparser
-import httplib2
-import pathlib
import os
+import pathlib
import re
import subprocess
import sys
@@ -13,11 +12,14 @@ import textwrap
import urllib.parse
import xml.etree.ElementTree as etree
+import httplib2
+
# Optional libraries for OAuth2 authentication
try:
- from oauth2client.client import OAuth2WebServerFlow, HttpAccessTokenRefreshError
- from oauth2client.file import Storage
import webbrowser
+
+ from oauth2client.client import HttpAccessTokenRefreshError, OAuth2WebServerFlow
+ from oauth2client.file import Storage
except ModuleNotFoundError:
pass
@@ -58,7 +60,7 @@ class Config:
print('Loading configuration from ' + configfn + '...')
try:
config.read_file(open(fn))
- except FileNotFoundError as e:
+ except FileNotFoundError:
die('Configuration file not found: {}'.format(fn))
for sec in config.sections():
@@ -107,6 +109,7 @@ def check_dir(dir):
except FileExistsError:
die("{} is not a directory".format(dir))
+
def die_atnode(msg, node):
if debug:
msg += '\n\n'
@@ -793,7 +796,7 @@ try:
# Write the synchronization database.
save_syncdb(syncdbfn, syncdb)
- #Clear OAuth2 credentials if used
+ # Clear OAuth2 credentials if used.
if authmethod == 'oauth2':
conn.clear_credentials()
diff --git a/contrib/setup.cfg b/contrib/setup.cfg
new file mode 100644
index 0000000..0691fee
--- /dev/null
+++ b/contrib/setup.cfg
@@ -0,0 +1,3 @@
+[flake8]
+max-line-length = 100
+max-complexity = 16