Skip to content

Commit

Permalink
Rev3122, Auto ignore database file
Browse files Browse the repository at this point in the history
  • Loading branch information
shortcutme committed Oct 22, 2017
1 parent c519239 commit 9d511ba
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Config.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class Config(object):

def __init__(self, argv):
self.version = "0.6.0"
self.rev = 3120
self.rev = 3122
self.argv = argv
self.action = None
self.config_file = "zeronet.conf"
Expand Down
2 changes: 2 additions & 0 deletions src/Content/ContentManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,8 @@ def hashFiles(self, dir_inner_path, ignore_pattern=None, optional_pattern=None):
elif not self.isValidRelativePath(file_relative_path):
ignored = True
self.log.error("- [ERROR] Invalid filename: %s" % file_relative_path)
elif dir_inner_path == "" and file_relative_path == self.site.storage.getDbFile():
ignored = True
elif optional_pattern and SafeRe.match(optional_pattern, file_relative_path):
optional = True

Expand Down
7 changes: 7 additions & 0 deletions src/Site/SiteStorage.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ def __init__(self, site, allow_create=True):
else:
raise Exception("Directory not exists: %s" % self.directory)

def getDbFile(self):
if self.isFile("dbschema.json"):
schema = self.loadJson("dbschema.json")
return schema["db_file"]
else:
return False

# Load db from dbschema.json
def openDb(self, check=True):
try:
Expand Down

0 comments on commit 9d511ba

Please sign in to comment.