@@ -0,0 +1,1884 @@
+import os.path%0Aimport imp%0Afrom cgi import parse_qs, escape%0A%0AresponseHeader = %5B('Content-Type', 'text/plain')%5D%0A%0AbaseUrl = %25REQUIRED%25 URL TO THE BASE DIRECTORY OF FILES%0AbaseFile = %25REQUIRED%25 LOCAL PATH TO THE BASE DIRECTORY OF FILES%0AbaseRequest = %25REQUIRED%25 LOCAL PATH TO THE DIRECTORY OF REQUESTS%0A%0Adef find_file(identifier, file_version, application_version):%0A    file = identifier + %22_v%22 + application_version + %22_v%22 + file_version%0A%0A    if os.path.isfile(baseFile + file):%0A        # If the direct file exists, it lists all necessary files line by line%0A        with open(baseFile + file, %22r%22) as f:%0A            return True, f.read()%0A    elif os.path.isfile(baseRequest + file + '.py'):%0A        # If the direct file doesn't exist, we look for a python script that%0A        # will generate the returns string dynamically%0A        module = imp.load_source('files', baseRequest + file + '.py')%0A        return True, module.files()%0A    else:%0A        # If neither exists, an unknown file was requested%0A        return False, %22Could not find identifier '%22 + file + %22'%22%0A%0Adef application(environ, start_response):%0A    parameters = parse_qs(environ.get('QUERY_STRING', ''))%0A%0A    if 'identifier' in parameters:%0A        file = escape(parameters%5B'identifier'%5D%5B0%5D)%0A    else:%0A        start_response('400 Bad Request', responseHeader)%0A        return %5B'No identifier provided'%5D%0A%0A    if 'file_version' in parameters:%0A        file_version = escape(parameters%5B'file_version'%5D%5B0%5D)%0A    else:%0A        file_version = %221%22%0A%0A    if 'application_version' in parameters:%0A        application_version = escape(parameters%5B'application_version'%5D%5B0%5D)%0A    else:%0A        application_version = %221%22%0A%0A    status_ok, url = find_file(file, file_version, application_version)%0A%0A    if (status_ok):%0A        start_response('200 OK', responseHeader)%0A    else:%0A        start_response('400 Bad Request', responseHeader)%0A%0A    return %5Burl%5D

Add server request script used for the DownloadManager