update browser
This commit is contained in:
@@ -75,11 +75,14 @@ class PathHandle:
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def download_from_server(path, idname, file_type, local_filename=None):
|
def download_from_server(path, idname, file_type, local_filename=None):
|
||||||
import requests
|
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)
|
r = requests.get(PathHandle.request_url(file_type), params=payload, auth=("bam", "bam"), stream=True)
|
||||||
local_filename = payload['filepath'].split('/')[-1]
|
local_filename = payload['filepath'].split('/')[-1]
|
||||||
|
|
||||||
if file_type == "file_deps":
|
if file_type == "file":
|
||||||
local_filename += ".zip"
|
local_filename += ".zip"
|
||||||
|
|
||||||
with open(local_filename, 'wb') as f:
|
with open(local_filename, 'wb') as f:
|
||||||
@@ -149,7 +152,7 @@ class Application(tk.Frame):
|
|||||||
self.repopulate()
|
self.repopulate()
|
||||||
|
|
||||||
def exec_path_blendfile(idname):
|
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()
|
self.repopulate()
|
||||||
|
|
||||||
js = self.path_handle.json
|
js = self.path_handle.json
|
||||||
|
@@ -176,8 +176,8 @@ class FileAPI(Resource):
|
|||||||
|
|
||||||
import packer
|
import packer
|
||||||
|
|
||||||
print("AAA", filepath)
|
print(" Source path:", filepath)
|
||||||
print("NNN", filepath_zip)
|
print(" Zip path:", filepath_zip)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
packer.pack(filepath.encode('utf-8'), filepath_zip[-1].encode('utf-8'), mode='ZIP')
|
packer.pack(filepath.encode('utf-8'), filepath_zip[-1].encode('utf-8'), mode='ZIP')
|
||||||
|
Reference in New Issue
Block a user