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

runner: replaced + with %

parent f21b532e
......@@ -53,12 +53,9 @@ class FileBrowser(object):
ext = "unknow"
else:
ext = str.lower(ext)
html += 'gsfiles.push(new gsItem("1", "' + f + '", "' + \
ff + '", "' + str(size) + '", "' + md5sum + \
'", "' + ext + '", "' + mdate + '"));'
html += 'gsfiles.push(new gsItem("1", "%s", "%s", "%s", "%s", "%s", "%s"));' % (f, ff, size, md5sum, ext, mdate)
else:
html += 'gsdirs.push(new gsItem("2", "' + f + '", "' + \
ff + '", "0", "' + md5sum + '", "dir", "' + mdate + '"));'
html += 'gsdirs.push(new gsItem("2", "%s", "%s", "0", "%s", "dir", "%s"));' % (f, ff, md5sum, mdate)
return html
def makeDirectory(self, dir, filename):
......
......@@ -607,10 +607,9 @@ def newSoftware(folder, config, session):
session['title'] = getProjectTitle(config)
code = 1
else:
json = "Bad folder or Directory '" + folder + \
"' already exist, please enter a new name for your software"
json = "Bad folder or Directory '%s' already exist, please enter a new name for your software" % folder
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):
shutil.rmtree(folderPath)
return jsonify(code=code, result=json)
......@@ -813,4 +812,4 @@ def readParameters(path):
except Exception, e:
return str(e)
else:
return "No such file or directory: " + path
return "No such file or directory: %s" % path
......@@ -349,8 +349,7 @@ def editCurrentProject():
def createFile():
path = realpath(app.config, request.form['file'], False)
if not path:
return jsonify(code=0, result="Error when creating your " +
request.form['type'] + ": Permission Denied")
return jsonify(code=0, result="Error when creating your %s: Permission Denied" % request.form['type'])
try:
if request.form['type'] == "file":
open(path, 'w')
......@@ -554,7 +553,7 @@ def saveParameterXml():
except Exception as e:
return jsonify(
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="")
......@@ -571,8 +570,7 @@ def getSoftwareType():
def getParameterXml(request):
param_path = os.path.join(app.config['etc_dir'], ".parameter.xml")
if not os.path.exists(param_path):
default = '<?xml version="1.0" encoding="utf-8"?>\n'
default += '<instance>\n</instance>'
default = '<?xml version="1.0" encoding="utf-8"?>\n<instance>\n</instance>'
return jsonify(code=1, result=default)
if request == "xml":
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