Fix flake8 and isort warnings
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
This commit is contained in:
parent
594bd62378
commit
f1e84bd18b
@ -3,9 +3,8 @@
|
|||||||
import argparse
|
import argparse
|
||||||
import base64
|
import base64
|
||||||
import configparser
|
import configparser
|
||||||
import httplib2
|
|
||||||
import pathlib
|
|
||||||
import os
|
import os
|
||||||
|
import pathlib
|
||||||
import re
|
import re
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
@ -13,11 +12,14 @@ import textwrap
|
|||||||
import urllib.parse
|
import urllib.parse
|
||||||
import xml.etree.ElementTree as etree
|
import xml.etree.ElementTree as etree
|
||||||
|
|
||||||
|
import httplib2
|
||||||
|
|
||||||
# Optional libraries for OAuth2 authentication
|
# Optional libraries for OAuth2 authentication
|
||||||
try:
|
try:
|
||||||
from oauth2client.client import OAuth2WebServerFlow, HttpAccessTokenRefreshError
|
|
||||||
from oauth2client.file import Storage
|
|
||||||
import webbrowser
|
import webbrowser
|
||||||
|
|
||||||
|
from oauth2client.client import HttpAccessTokenRefreshError, OAuth2WebServerFlow
|
||||||
|
from oauth2client.file import Storage
|
||||||
except ModuleNotFoundError:
|
except ModuleNotFoundError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@ -58,7 +60,7 @@ class Config:
|
|||||||
print('Loading configuration from ' + configfn + '...')
|
print('Loading configuration from ' + configfn + '...')
|
||||||
try:
|
try:
|
||||||
config.read_file(open(fn))
|
config.read_file(open(fn))
|
||||||
except FileNotFoundError as e:
|
except FileNotFoundError:
|
||||||
die('Configuration file not found: {}'.format(fn))
|
die('Configuration file not found: {}'.format(fn))
|
||||||
|
|
||||||
for sec in config.sections():
|
for sec in config.sections():
|
||||||
@ -107,6 +109,7 @@ def check_dir(dir):
|
|||||||
except FileExistsError:
|
except FileExistsError:
|
||||||
die("{} is not a directory".format(dir))
|
die("{} is not a directory".format(dir))
|
||||||
|
|
||||||
|
|
||||||
def die_atnode(msg, node):
|
def die_atnode(msg, node):
|
||||||
if debug:
|
if debug:
|
||||||
msg += '\n\n'
|
msg += '\n\n'
|
||||||
@ -793,7 +796,7 @@ try:
|
|||||||
# Write the synchronization database.
|
# Write the synchronization database.
|
||||||
save_syncdb(syncdbfn, syncdb)
|
save_syncdb(syncdbfn, syncdb)
|
||||||
|
|
||||||
#Clear OAuth2 credentials if used
|
# Clear OAuth2 credentials if used.
|
||||||
if authmethod == 'oauth2':
|
if authmethod == 'oauth2':
|
||||||
conn.clear_credentials()
|
conn.clear_credentials()
|
||||||
|
|
||||||
|
3
contrib/setup.cfg
Normal file
3
contrib/setup.cfg
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
[flake8]
|
||||||
|
max-line-length = 100
|
||||||
|
max-complexity = 16
|
Loading…
x
Reference in New Issue
Block a user