mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-04-27 14:57:41 +00:00
Create directory automatically
This commit is contained in:
parent
7f38102936
commit
cc56a05b7c
2 changed files with 3 additions and 2 deletions
|
|
@ -187,7 +187,7 @@ Service to hardcode those into opensource software
|
||||||
|
|
||||||
The ``token_file`` parameter should be a filepath where vdirsyncer can later
|
The ``token_file`` parameter should be a filepath where vdirsyncer can later
|
||||||
store authentication-related data. You do not need to create the file itself
|
store authentication-related data. You do not need to create the file itself
|
||||||
(or write anything to it), only the folder around it.
|
or write anything to it.
|
||||||
|
|
||||||
You can select which calendars to sync on `CalDav settings page
|
You can select which calendars to sync on `CalDav settings page
|
||||||
<https://calendar.google.com/calendar/syncselect>`_.
|
<https://calendar.google.com/calendar/syncselect>`_.
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ from click_threading import get_ui_worker
|
||||||
|
|
||||||
from . import base, dav
|
from . import base, dav
|
||||||
from .. import exceptions
|
from .. import exceptions
|
||||||
from ..utils import expand_path, open_graphical_browser
|
from ..utils import checkdir, expand_path, open_graphical_browser
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
@ -58,6 +58,7 @@ class GoogleSession(dav.DAVSession):
|
||||||
)
|
)
|
||||||
|
|
||||||
def _save_token(token):
|
def _save_token(token):
|
||||||
|
checkdir(os.path.dirname(token_file), create=True)
|
||||||
with atomic_write(token_file, mode='w', overwrite=True) as f:
|
with atomic_write(token_file, mode='w', overwrite=True) as f:
|
||||||
json.dump(token, f)
|
json.dump(token, f)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue