else
This commit is contained in:
parent
74aee1822e
commit
4b7416874f
2 changed files with 3 additions and 1 deletions
|
@ -436,6 +436,7 @@ class TreeNode:
|
||||||
assert '\\' not in identifier
|
assert '\\' not in identifier
|
||||||
self.identifier = identifier
|
self.identifier = identifier
|
||||||
self.data = data
|
self.data = data
|
||||||
|
self.parent = None
|
||||||
self.children = {}
|
self.children = {}
|
||||||
|
|
||||||
def __eq__(self, other):
|
def __eq__(self, other):
|
||||||
|
@ -551,6 +552,7 @@ def build_file_tree(databasename):
|
||||||
# Create a new node for the directory, path[0]
|
# Create a new node for the directory, path[0]
|
||||||
# path[1:] is assigned to that node to be divided next.
|
# path[1:] is assigned to that node to be divided next.
|
||||||
child_identifier = path.pop(0)
|
child_identifier = path.pop(0)
|
||||||
|
child_identifier = child_identifier.replace(':', '#')
|
||||||
|
|
||||||
child = node.children.get(child_identifier, None)
|
child = node.children.get(child_identifier, None)
|
||||||
if not child:
|
if not child:
|
||||||
|
|
|
@ -253,6 +253,7 @@ class RequestHandler(http.server.BaseHTTPRequestHandler):
|
||||||
return
|
return
|
||||||
|
|
||||||
status_code = 200
|
status_code = 200
|
||||||
|
self.send_response(status_code)
|
||||||
|
|
||||||
if path.is_dir:
|
if path.is_dir:
|
||||||
mime = 'text/html'
|
mime = 'text/html'
|
||||||
|
@ -263,7 +264,6 @@ class RequestHandler(http.server.BaseHTTPRequestHandler):
|
||||||
if mime is not None:
|
if mime is not None:
|
||||||
self.send_header('Content-type', mime)
|
self.send_header('Content-type', mime)
|
||||||
|
|
||||||
self.send_response(status_code)
|
|
||||||
self.end_headers()
|
self.end_headers()
|
||||||
|
|
||||||
def send_path_validation_error(self, path):
|
def send_path_validation_error(self, path):
|
||||||
|
|
Loading…
Reference in a new issue