mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-03-25 08:55:50 +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
|
||||
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
|
||||
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
|
||||
if you use an empty string here.
|
||||
:param encoding: File encoding for items, both content and filename.
|
||||
|
|
|
|||
|
|
@ -22,8 +22,15 @@ class FilesystemStorage(Storage):
|
|||
storage_name = "filesystem"
|
||||
_repr_attributes = ("path",)
|
||||
|
||||
def __init__(self, path, fileext,
|
||||
encoding="utf-8", post_hook=None, fileignoreext=".tmp", **kwargs):
|
||||
def __init__(
|
||||
self,
|
||||
path,
|
||||
fileext,
|
||||
encoding="utf-8",
|
||||
post_hook=None,
|
||||
fileignoreext=".tmp",
|
||||
**kwargs
|
||||
):
|
||||
super().__init__(**kwargs)
|
||||
path = expand_path(path)
|
||||
checkdir(path, create=False)
|
||||
|
|
@ -82,8 +89,11 @@ class FilesystemStorage(Storage):
|
|||
def list(self):
|
||||
for fname in os.listdir(self.path):
|
||||
fpath = os.path.join(self.path, fname)
|
||||
if os.path.isfile(fpath) and fname.endswith(self.fileext) and (
|
||||
not fname.endswith(self.fileignoreext)):
|
||||
if (
|
||||
os.path.isfile(fpath)
|
||||
and fname.endswith(self.fileext)
|
||||
and (not fname.endswith(self.fileignoreext))
|
||||
):
|
||||
yield fname, get_etag_from_file(fpath)
|
||||
|
||||
def get(self, href):
|
||||
|
|
|
|||
Loading…
Reference in a new issue