update browser

This commit is contained in:
2014-10-30 15:07:02 +01:00
parent 26b429783e
commit 57b40a7dcb
2 changed files with 8 additions and 5 deletions

View File

@@ -75,11 +75,14 @@ class PathHandle:
@staticmethod
def download_from_server(path, idname, file_type, local_filename=None):
import requests
payload = {"filepath": "/".join(path) + "/" + idname}
payload = {
"filepath": "/".join(path) + "/" + idname,
"command": "checkout",
}
r = requests.get(PathHandle.request_url(file_type), params=payload, auth=("bam", "bam"), stream=True)
local_filename = payload['filepath'].split('/')[-1]
if file_type == "file_deps":
if file_type == "file":
local_filename += ".zip"
with open(local_filename, 'wb') as f:
@@ -149,7 +152,7 @@ class Application(tk.Frame):
self.repopulate()
def exec_path_blendfile(idname):
self.path_handle.download_from_server(self.path_handle.path, idname, "file_deps")
self.path_handle.download_from_server(self.path_handle.path, idname, "file")
self.repopulate()
js = self.path_handle.json

View File

@@ -176,8 +176,8 @@ class FileAPI(Resource):
import packer
print("AAA", filepath)
print("NNN", filepath_zip)
print(" Source path:", filepath)
print(" Zip path:", filepath_zip)
try:
packer.pack(filepath.encode('utf-8'), filepath_zip[-1].encode('utf-8'), mode='ZIP')