Skip to content

Commit

Permalink
Clean up flake8 config and fix violations (long lines, unused imports…
Browse files Browse the repository at this point in the history
…, etc)
  • Loading branch information
dbarnett committed Aug 23, 2024
1 parent 3ea68b0 commit b4160a6
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
3 changes: 2 additions & 1 deletion gcalcli/argparsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,8 @@ def get_argument_parser():
sub.add_parser(
'search', parents=[details_parser, output_parser, search_parser],
help='search for events within an optional time period',
description='Provides case insensitive search for calendar events.')
description='Provides case insensitive search for calendar '
'events.')
sub.add_parser(
'edit', parents=[details_parser, output_parser, search_parser],
help='edit calendar events',
Expand Down
17 changes: 8 additions & 9 deletions gcalcli/gcal.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,15 @@
from typing import List
from unicodedata import east_asian_width

from googleapiclient.discovery import build
from googleapiclient.errors import HttpError
from dateutil.parser import parse
from dateutil.relativedelta import relativedelta
from dateutil.tz import tzlocal
import httplib2
from google_auth_oauthlib.flow import InstalledAppFlow
from googleapiclient.discovery import build
from googleapiclient.errors import HttpError
from google.auth.transport.requests import Request

from . import __program__, __version__, actions, utils
from . import actions, utils
from ._types import Cache, CalendarListEntry
from .actions import ACTIONS
from .conflicts import ShowConflicts
Expand Down Expand Up @@ -132,7 +130,6 @@ def _retry_with_backoff(self, method):
return None

def _google_auth(self):
from argparse import Namespace
if not self.credentials:
if self.options['config_folder']:
oauth_filepath = os.path.expanduser(
Expand All @@ -149,10 +146,12 @@ def _google_auth(self):
"installed": {
"client_id": self.options['client_id'],
"client_secret": self.options['client_secret'],
"auth_uri":"https://accounts.google.com/o/oauth2/auth",
"token_uri":"https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs",
"redirect_uris":["http://localhost"]
"auth_uri":
"https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url":
"https://www.googleapis.com/oauth2/v1/certs",
"redirect_uris": ["http://localhost"]
}
},
scopes=['https://www.googleapis.com/auth/calendar']
Expand Down
6 changes: 6 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
[flake8]
import-order-style = google
exclude =
.git,
__pycache__,
venv,
.tox,
.venv
6 changes: 0 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,3 @@ deps = pytest
commands=py.test -vv --cov=./gcalcli --pyargs tests {posargs}
coverage html
flake8

[flake8]
exclude=.git,__pycache__,venv,.tox,.venv
per-file-ignores=details.py:D102

# don't want to create a docstring for every implementation of a virtual base method

0 comments on commit b4160a6

Please sign in to comment.