Rev3122, Auto ignore database file
This commit is contained in:
parent
c519239d87
commit
9d511ba165
3 changed files with 10 additions and 1 deletions
|
@ -10,7 +10,7 @@ class Config(object):
|
||||||
|
|
||||||
def __init__(self, argv):
|
def __init__(self, argv):
|
||||||
self.version = "0.6.0"
|
self.version = "0.6.0"
|
||||||
self.rev = 3120
|
self.rev = 3122
|
||||||
self.argv = argv
|
self.argv = argv
|
||||||
self.action = None
|
self.action = None
|
||||||
self.config_file = "zeronet.conf"
|
self.config_file = "zeronet.conf"
|
||||||
|
|
|
@ -524,6 +524,8 @@ class ContentManager(object):
|
||||||
elif not self.isValidRelativePath(file_relative_path):
|
elif not self.isValidRelativePath(file_relative_path):
|
||||||
ignored = True
|
ignored = True
|
||||||
self.log.error("- [ERROR] Invalid filename: %s" % file_relative_path)
|
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):
|
elif optional_pattern and SafeRe.match(optional_pattern, file_relative_path):
|
||||||
optional = True
|
optional = True
|
||||||
|
|
||||||
|
|
|
@ -34,6 +34,13 @@ class SiteStorage(object):
|
||||||
else:
|
else:
|
||||||
raise Exception("Directory not exists: %s" % self.directory)
|
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
|
# Load db from dbschema.json
|
||||||
def openDb(self, check=True):
|
def openDb(self, check=True):
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in a new issue