Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.toolbox
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Klaus Wölfel
slapos.toolbox
Commits
6980a891
Commit
6980a891
authored
Jul 26, 2013
by
Marco Mariani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
runner: replaced + with %
parent
f21b532e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
14 deletions
+8
-14
slapos/runner/fileBrowser.py
slapos/runner/fileBrowser.py
+2
-5
slapos/runner/utils.py
slapos/runner/utils.py
+3
-4
slapos/runner/views.py
slapos/runner/views.py
+3
-5
No files found.
slapos/runner/fileBrowser.py
View file @
6980a891
...
...
@@ -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):
...
...
slapos/runner/utils.py
View file @
6980a891
...
...
@@ -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
slapos/runner/views.py
View file @
6980a891
...
...
@@ -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
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment