mirror of
https://github.com/barronwaffles/dwc_network_server_emulator.git
synced 2026-08-24 03:25:43 -05:00
[WIP] NAS: Moved action='contents' in dlc
This commit is contained in:
@@ -258,11 +258,8 @@ class NasHTTPServerHandler(BaseHTTPServer.BaseHTTPRequestHandler):
|
||||
ret = dlc.download_list(dlc_path, post)
|
||||
|
||||
if action == "contents":
|
||||
# Get only the base filename just in case there is a path
|
||||
# involved somewhere in the filename string.
|
||||
ret = dlc.download_contents(dlc_path, post)
|
||||
dlc_contenttype = True
|
||||
contents = os.path.basename(post["contents"])
|
||||
ret = dlc.safeloadfi(dlcpath, contents)
|
||||
|
||||
self.send_response(200)
|
||||
|
||||
|
||||
10
other/dlc.py
10
other/dlc.py
@@ -206,3 +206,13 @@ def download_list(dlc_path, post):
|
||||
attr1, attr2, attr3,
|
||||
num, offset
|
||||
)
|
||||
|
||||
|
||||
def download_contents(dlc_path, post):
|
||||
"""Handle download contents request.
|
||||
|
||||
Get only the base filename just in case there is a path involved
|
||||
somewhere in the filename string.
|
||||
"""
|
||||
contents = os.path.basename(post["contents"])
|
||||
return safeloadfi(dlc_path, contents)
|
||||
|
||||
Reference in New Issue
Block a user