mirror of
https://github.com/olivierkes/manuskript.git
synced 2024-06-14 00:44:34 +12:00
Merge pull request #302 from gedakc/issue-281-hidden-file-crash-open-project
Skip loading directory and file names that begin with a period
This commit is contained in:
commit
30a49a44d4
|
@ -647,7 +647,13 @@ def loadProject(project, zip=None):
|
||||||
files = {}
|
files = {}
|
||||||
for dirpath, dirnames, filenames in os.walk(path):
|
for dirpath, dirnames, filenames in os.walk(path):
|
||||||
p = dirpath.replace(path, "")
|
p = dirpath.replace(path, "")
|
||||||
|
# Skip directories that begin with a period
|
||||||
|
if p[:1] == ".":
|
||||||
|
continue
|
||||||
for f in filenames:
|
for f in filenames:
|
||||||
|
# Skip filenames that begin with a period
|
||||||
|
if f[:1] == ".":
|
||||||
|
continue
|
||||||
# mode = "r" + ("b" if f[-4:] in [".xml", "opml"] else "")
|
# mode = "r" + ("b" if f[-4:] in [".xml", "opml"] else "")
|
||||||
if f[-4:] in [".xml", "opml"]:
|
if f[-4:] in [".xml", "opml"]:
|
||||||
with open(os.path.join(dirpath, f), "rb") as fo:
|
with open(os.path.join(dirpath, f), "rb") as fo:
|
||||||
|
|
Loading…
Reference in a new issue