mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-04-27 14:57:41 +00:00
Bugfixes for Google storage
Bugfixes for Google storage
This commit is contained in:
commit
020f67ec26
2 changed files with 12 additions and 6 deletions
|
|
@ -5,7 +5,7 @@ import logging
|
||||||
|
|
||||||
import click
|
import click
|
||||||
|
|
||||||
from . import dav
|
from . import base, dav
|
||||||
from .. import exceptions, utils
|
from .. import exceptions, utils
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
@ -35,6 +35,8 @@ class GoogleSession(dav.DavSession):
|
||||||
self.useragent = client_id
|
self.useragent = client_id
|
||||||
self._settings = {}
|
self._settings = {}
|
||||||
|
|
||||||
|
token_file = utils.expand_path(token_file)
|
||||||
|
|
||||||
if not have_oauth2:
|
if not have_oauth2:
|
||||||
raise exceptions.UserError('requests-oauthlib not installed')
|
raise exceptions.UserError('requests-oauthlib not installed')
|
||||||
|
|
||||||
|
|
@ -119,7 +121,7 @@ class GoogleCalendarStorage(dav.CaldavStorage):
|
||||||
|
|
||||||
def __init__(self, token_file, client_id=None, client_secret=None,
|
def __init__(self, token_file, client_id=None, client_secret=None,
|
||||||
start_date=None, end_date=None, item_types=(), **kwargs):
|
start_date=None, end_date=None, item_types=(), **kwargs):
|
||||||
super(GoogleContactsStorage, self).__init__(
|
super(GoogleCalendarStorage, self).__init__(
|
||||||
token_file=token_file, client_id=client_id,
|
token_file=token_file, client_id=client_id,
|
||||||
client_secret=client_secret, start_date=start_date,
|
client_secret=client_secret, start_date=start_date,
|
||||||
end_date=end_date, item_types=item_types,
|
end_date=end_date, item_types=item_types,
|
||||||
|
|
@ -129,7 +131,7 @@ class GoogleCalendarStorage(dav.CaldavStorage):
|
||||||
# This is ugly: We define/override the entire signature computed for the
|
# This is ugly: We define/override the entire signature computed for the
|
||||||
# docs here because the current way we autogenerate those docs are too
|
# docs here because the current way we autogenerate those docs are too
|
||||||
# simple for our advanced argspec juggling in `vdirsyncer.storage.dav`.
|
# simple for our advanced argspec juggling in `vdirsyncer.storage.dav`.
|
||||||
__init__._traverse_superclass = False
|
__init__._traverse_superclass = base.Storage
|
||||||
|
|
||||||
|
|
||||||
class GoogleContactsStorage(dav.CarddavStorage):
|
class GoogleContactsStorage(dav.CarddavStorage):
|
||||||
|
|
|
||||||
|
|
@ -87,9 +87,13 @@ def get_storage_init_specs(cls, stop_at=object):
|
||||||
return ()
|
return ()
|
||||||
|
|
||||||
spec = getargspec_ish(cls.__init__)
|
spec = getargspec_ish(cls.__init__)
|
||||||
if getattr(cls.__init__, '_traverse_superclass', True):
|
traverse_superclass = getattr(cls.__init__, '_traverse_superclass', True)
|
||||||
supercls = next(getattr(x.__init__, '__objclass__', x)
|
if traverse_superclass:
|
||||||
for x in cls.__mro__[1:])
|
if traverse_superclass is True: # noqa
|
||||||
|
supercls = next(getattr(x.__init__, '__objclass__', x)
|
||||||
|
for x in cls.__mro__[1:])
|
||||||
|
else:
|
||||||
|
supercls = traverse_superclass
|
||||||
superspecs = get_storage_init_specs(supercls, stop_at=stop_at)
|
superspecs = get_storage_init_specs(supercls, stop_at=stop_at)
|
||||||
else:
|
else:
|
||||||
superspecs = ()
|
superspecs = ()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue