mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-04-27 14:57:41 +00:00
Fixing docs/config.rst and code formatting
This commit is contained in:
parent
9a1582cc0f
commit
b9f5d88af9
2 changed files with 15 additions and 5 deletions
|
|
@ -422,7 +422,7 @@ Local
|
||||||
:param fileext: The file extension to use (e.g. ``.txt``). Contained in the
|
:param fileext: The file extension to use (e.g. ``.txt``). Contained in the
|
||||||
href, so if you change the file extension after a sync, this will
|
href, so if you change the file extension after a sync, this will
|
||||||
trigger a re-download of everything (but *should* not cause data-loss
|
trigger a re-download of everything (but *should* not cause data-loss
|
||||||
of any kind). To be compatible with the ``vset to the empty string`` format you have
|
of any kind). To be compatible with the ``vset`` format you have
|
||||||
to either use ``.vcf`` or ``.ics``. Note that metasync won't work
|
to either use ``.vcf`` or ``.ics``. Note that metasync won't work
|
||||||
if you use an empty string here.
|
if you use an empty string here.
|
||||||
:param encoding: File encoding for items, both content and filename.
|
:param encoding: File encoding for items, both content and filename.
|
||||||
|
|
|
||||||
|
|
@ -22,8 +22,15 @@ class FilesystemStorage(Storage):
|
||||||
storage_name = "filesystem"
|
storage_name = "filesystem"
|
||||||
_repr_attributes = ("path",)
|
_repr_attributes = ("path",)
|
||||||
|
|
||||||
def __init__(self, path, fileext,
|
def __init__(
|
||||||
encoding="utf-8", post_hook=None, fileignoreext=".tmp", **kwargs):
|
self,
|
||||||
|
path,
|
||||||
|
fileext,
|
||||||
|
encoding="utf-8",
|
||||||
|
post_hook=None,
|
||||||
|
fileignoreext=".tmp",
|
||||||
|
**kwargs
|
||||||
|
):
|
||||||
super().__init__(**kwargs)
|
super().__init__(**kwargs)
|
||||||
path = expand_path(path)
|
path = expand_path(path)
|
||||||
checkdir(path, create=False)
|
checkdir(path, create=False)
|
||||||
|
|
@ -82,8 +89,11 @@ class FilesystemStorage(Storage):
|
||||||
def list(self):
|
def list(self):
|
||||||
for fname in os.listdir(self.path):
|
for fname in os.listdir(self.path):
|
||||||
fpath = os.path.join(self.path, fname)
|
fpath = os.path.join(self.path, fname)
|
||||||
if os.path.isfile(fpath) and fname.endswith(self.fileext) and (
|
if (
|
||||||
not fname.endswith(self.fileignoreext)):
|
os.path.isfile(fpath)
|
||||||
|
and fname.endswith(self.fileext)
|
||||||
|
and (not fname.endswith(self.fileignoreext))
|
||||||
|
):
|
||||||
yield fname, get_etag_from_file(fpath)
|
yield fname, get_etag_from_file(fpath)
|
||||||
|
|
||||||
def get(self, href):
|
def get(self, href):
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue