mirror of
https://github.com/olivierkes/manuskript.git
synced 2024-05-17 11:22:28 +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 = {}
|
||||
for dirpath, dirnames, filenames in os.walk(path):
|
||||
p = dirpath.replace(path, "")
|
||||
# Skip directories that begin with a period
|
||||
if p[:1] == ".":
|
||||
continue
|
||||
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 "")
|
||||
if f[-4:] in [".xml", "opml"]:
|
||||
with open(os.path.join(dirpath, f), "rb") as fo:
|
||||
|
|
Loading…
Reference in a new issue