From 57b40a7dcba0eeb3753049ed074d06f64a373e33 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 30 Oct 2014 15:07:02 +0100 Subject: [PATCH] update browser --- client/gui/browser.py | 9 ++++++--- webservice/bam/application/__init__.py | 4 ++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/client/gui/browser.py b/client/gui/browser.py index d93b47a..bbd8e5c 100755 --- a/client/gui/browser.py +++ b/client/gui/browser.py @@ -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 diff --git a/webservice/bam/application/__init__.py b/webservice/bam/application/__init__.py index 98e3938..ee34d42 100644 --- a/webservice/bam/application/__init__.py +++ b/webservice/bam/application/__init__.py @@ -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')