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
Kazuhiko Shiozaki
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):
...
@@ -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):
...
...
slapos/runner/utils.py
View file @
6980a891
...
@@ -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
slapos/runner/views.py
View file @
6980a891
...
@@ -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
()
...
...
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