mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-03-25 08:55:50 +00:00
Deduplicate HTTP storage args
This commit is contained in:
parent
d27e5b8329
commit
e3bc764515
2 changed files with 14 additions and 17 deletions
|
|
@ -14,7 +14,8 @@ from requests import session as requests_session
|
|||
from requests.exceptions import HTTPError
|
||||
|
||||
from .base import Item, Storage
|
||||
from .http import USERAGENT, prepare_auth, prepare_verify
|
||||
from .http import HTTP_STORAGE_PARAMETERS, USERAGENT, prepare_auth, \
|
||||
prepare_verify
|
||||
from .. import exceptions, log, utils
|
||||
|
||||
|
||||
|
|
@ -250,18 +251,9 @@ class DavSession(object):
|
|||
|
||||
class DavStorage(Storage):
|
||||
|
||||
'''
|
||||
__doc__ = '''
|
||||
:param url: Base URL or an URL to a collection.
|
||||
:param username: Username for authentication.
|
||||
:param password: Password for authentication.
|
||||
:param verify: Verify SSL certificate, default True. This can also be a
|
||||
local path to a self-signed SSL certificate.
|
||||
:param verify_fingerprint: Optional. SHA1 or MD5 fingerprint of the
|
||||
expected server certificate.
|
||||
:param auth: Optional. Either ``basic``, ``digest`` or ``guess``. Default
|
||||
``guess``. If you know yours, consider setting it explicitly for
|
||||
performance.
|
||||
:param useragent: Default ``vdirsyncer``.
|
||||
''' + HTTP_STORAGE_PARAMETERS + '''
|
||||
:param unsafe_href_chars: Replace the given characters when generating
|
||||
hrefs. Defaults to ``'@'``.
|
||||
|
||||
|
|
|
|||
|
|
@ -44,11 +44,7 @@ def prepare_verify(verify):
|
|||
return verify
|
||||
|
||||
|
||||
class HttpStorage(Storage):
|
||||
'''
|
||||
Use a simple ``.ics`` file (or similar) from the web.
|
||||
|
||||
:param url: URL to the ``.ics`` file.
|
||||
HTTP_STORAGE_PARAMETERS = '''
|
||||
:param username: Username for authentication.
|
||||
:param password: Password for authentication.
|
||||
:param verify: Verify SSL certificate, default True. This can also be a
|
||||
|
|
@ -59,6 +55,15 @@ class HttpStorage(Storage):
|
|||
``guess``. If you know yours, consider setting it explicitly for
|
||||
performance.
|
||||
:param useragent: Default ``vdirsyncer``.
|
||||
'''
|
||||
|
||||
|
||||
class HttpStorage(Storage):
|
||||
__doc__ = '''
|
||||
Use a simple ``.ics`` file (or similar) from the web.
|
||||
|
||||
:param url: URL to the ``.ics`` file.
|
||||
''' + HTTP_STORAGE_PARAMETERS + '''
|
||||
|
||||
A simple example::
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue