Commit 6980a891 authored by Marco Mariani's avatar Marco Mariani

runner: replaced + with %

parent f21b532e
...@@ -53,12 +53,9 @@ class FileBrowser(object): ...@@ -53,12 +53,9 @@ class FileBrowser(object):
ext = "unknow" ext = "unknow"
else: else:
ext = str.lower(ext) ext = str.lower(ext)
html += 'gsfiles.push(new gsItem("1", "' + f + '", "' + \ html += 'gsfiles.push(new gsItem("1", "%s", "%s", "%s", "%s", "%s", "%s"));' % (f, ff, size, md5sum, ext, mdate)
ff + '", "' + str(size) + '", "' + md5sum + \
'", "' + ext + '", "' + mdate + '"));'
else: else:
html += 'gsdirs.push(new gsItem("2", "' + f + '", "' + \ html += 'gsdirs.push(new gsItem("2", "%s", "%s", "0", "%s", "dir", "%s"));' % (f, ff, md5sum, mdate)
ff + '", "0", "' + md5sum + '", "dir", "' + mdate + '"));'
return html return html
def makeDirectory(self, dir, filename): def makeDirectory(self, dir, filename):
......
...@@ -607,10 +607,9 @@ def newSoftware(folder, config, session): ...@@ -607,10 +607,9 @@ def newSoftware(folder, config, session):
session['title'] = getProjectTitle(config) session['title'] = getProjectTitle(config)
code = 1 code = 1
else: else:
json = "Bad folder or Directory '" + folder + \ json = "Bad folder or Directory '%s' already exist, please enter a new name for your software" % folder
"' already exist, please enter a new name for your software"
except Exception as e: except Exception as e:
json = "Can not create your software, please try again! : " + str(e) json = "Can not create your software, please try again! : %s " % e
if os.path.exists(folderPath): if os.path.exists(folderPath):
shutil.rmtree(folderPath) shutil.rmtree(folderPath)
return jsonify(code=code, result=json) return jsonify(code=code, result=json)
...@@ -813,4 +812,4 @@ def readParameters(path): ...@@ -813,4 +812,4 @@ def readParameters(path):
except Exception, e: except Exception, e:
return str(e) return str(e)
else: else:
return "No such file or directory: " + path return "No such file or directory: %s" % path
...@@ -349,8 +349,7 @@ def editCurrentProject(): ...@@ -349,8 +349,7 @@ def editCurrentProject():
def createFile(): def createFile():
path = realpath(app.config, request.form['file'], False) path = realpath(app.config, request.form['file'], False)
if not path: if not path:
return jsonify(code=0, result="Error when creating your " + return jsonify(code=0, result="Error when creating your %s: Permission Denied" % request.form['type'])
request.form['type'] + ": Permission Denied")
try: try:
if request.form['type'] == "file": if request.form['type'] == "file":
open(path, 'w') open(path, 'w')
...@@ -554,7 +553,7 @@ def saveParameterXml(): ...@@ -554,7 +553,7 @@ def saveParameterXml():
except Exception as e: except Exception as e:
return jsonify( return jsonify(
code=0, code=0,
result="An error occurred while applying your settings!<br/>" + str(e)) result="An error occurred while applying your settings!<br/>%s" % e)
return jsonify(code=1, result="") return jsonify(code=1, result="")
...@@ -571,8 +570,7 @@ def getSoftwareType(): ...@@ -571,8 +570,7 @@ def getSoftwareType():
def getParameterXml(request): def getParameterXml(request):
param_path = os.path.join(app.config['etc_dir'], ".parameter.xml") param_path = os.path.join(app.config['etc_dir'], ".parameter.xml")
if not os.path.exists(param_path): if not os.path.exists(param_path):
default = '<?xml version="1.0" encoding="utf-8"?>\n' default = '<?xml version="1.0" encoding="utf-8"?>\n<instance>\n</instance>'
default += '<instance>\n</instance>'
return jsonify(code=1, result=default) return jsonify(code=1, result=default)
if request == "xml": if request == "xml":
parameters = open(param_path, 'r').read() parameters = open(param_path, 'r').read()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment