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
|
||||
self.identifier = identifier
|
||||
self.data = data
|
||||
self.parent = None
|
||||
self.children = {}
|
||||
|
||||
def __eq__(self, other):
|
||||
|
@ -551,6 +552,7 @@ def build_file_tree(databasename):
|
|||
# Create a new node for the directory, path[0]
|
||||
# path[1:] is assigned to that node to be divided next.
|
||||
child_identifier = path.pop(0)
|
||||
child_identifier = child_identifier.replace(':', '#')
|
||||
|
||||
child = node.children.get(child_identifier, None)
|
||||
if not child:
|
||||
|
|
|
@ -253,6 +253,7 @@ class RequestHandler(http.server.BaseHTTPRequestHandler):
|
|||
return
|
||||
|
||||
status_code = 200
|
||||
self.send_response(status_code)
|
||||
|
||||
if path.is_dir:
|
||||
mime = 'text/html'
|
||||
|
@ -263,7 +264,6 @@ class RequestHandler(http.server.BaseHTTPRequestHandler):
|
|||
if mime is not None:
|
||||
self.send_header('Content-type', mime)
|
||||
|
||||
self.send_response(status_code)
|
||||
self.end_headers()
|
||||
|
||||
def send_path_validation_error(self, path):
|
||||
|
|
Loading…
Reference in a new issue