loggoing strings
This commit is contained in:
@@ -7,6 +7,7 @@ import subprocess
|
|||||||
import socket
|
import socket
|
||||||
from tornado.web import HTTPError
|
from tornado.web import HTTPError
|
||||||
from tornado import gen
|
from tornado import gen
|
||||||
|
from tornado.escape import url_unescape
|
||||||
import re
|
import re
|
||||||
import bbctrl
|
import bbctrl
|
||||||
from urllib.request import urlopen
|
from urllib.request import urlopen
|
||||||
@@ -614,6 +615,7 @@ class MacrosDownloadHandler(bbctrl.APIHandler):
|
|||||||
def get(self,filename):
|
def get(self,filename):
|
||||||
if not filename:
|
if not filename:
|
||||||
raise HTTPError(400, 'Missing filename')
|
raise HTTPError(400, 'Missing filename')
|
||||||
|
filename = filename[1:]
|
||||||
files = filename.split(',')
|
files = filename.split(',')
|
||||||
self.get_log('Macros Download').info('files ' + ",".join(files))
|
self.get_log('Macros Download').info('files ' + ",".join(files))
|
||||||
|
|
||||||
@@ -621,8 +623,10 @@ class MacrosDownloadHandler(bbctrl.APIHandler):
|
|||||||
zip_file = zipfile.ZipFile(buffer, mode="w")
|
zip_file = zipfile.ZipFile(buffer, mode="w")
|
||||||
|
|
||||||
for filename in files:
|
for filename in files:
|
||||||
filepath = self.get_upload(filename).encode('utf8')
|
filename = os.path.basename(url_unescape(filename))
|
||||||
filename = os.path.basename(filepath)
|
self.get_log('Macros Download').info('filename ' + filename)
|
||||||
|
filepath = self.get_upload(filename)
|
||||||
|
self.get_log('Macros Download').info('filepath: ' + filepath)
|
||||||
zip_file.write(filepath, filename)
|
zip_file.write(filepath, filename)
|
||||||
zip_file.close()
|
zip_file.close()
|
||||||
buffer.seek(0)
|
buffer.seek(0)
|
||||||
|
|||||||
Reference in New Issue
Block a user