rev278, Allow clone sites that does not have domain, Publishing without peers is a success, File size 0 on non exists files, Benchmark TLS1
This commit is contained in:
parent
3bd1c119eb
commit
417c6eb96f
6 changed files with 12 additions and 6 deletions
|
@ -327,7 +327,8 @@ class Site:
|
|||
# Copy root content.json
|
||||
if not new_site.storage.isFile("content.json") and not overwrite: # Content.json not exist yet, create a new one from source site
|
||||
content_json = self.storage.loadJson("content.json")
|
||||
del content_json["domain"]
|
||||
if "domain" in content_json:
|
||||
del content_json["domain"]
|
||||
content_json["title"] = "my"+content_json["title"]
|
||||
content_json["cloned_from"] = self.address
|
||||
if address_index: content_json["address_index"] = address_index # Site owner's BIP32 index
|
||||
|
|
|
@ -179,7 +179,11 @@ class SiteStorage:
|
|||
|
||||
# Get file size
|
||||
def getSize(self, inner_path):
|
||||
return os.path.getsize(self.getPath(inner_path))
|
||||
path = self.getPath(inner_path)
|
||||
if os.path.isfile(path):
|
||||
return os.path.getsize(path)
|
||||
else:
|
||||
return 0
|
||||
|
||||
|
||||
# File exist
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue