Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
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
amrani
erp5
Commits
5c872d99
Commit
5c872d99
authored
Jan 17, 2017
by
Ayush Tiwari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bt5_prototype: Follow the naming guileline for parameters
parent
39c5c1a4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
product/ERP5/Tool/TemplateTool.py
product/ERP5/Tool/TemplateTool.py
+6
-6
No files found.
product/ERP5/Tool/TemplateTool.py
View file @
5c872d99
...
...
@@ -266,7 +266,7 @@ class TemplateTool (BaseTool):
return
REQUEST
.
RESPONSE
.
redirect
(
ret_url
)
security
.
declareProtected
(
'Import/Export objects'
,
'export'
)
def
export
(
self
,
business_template
,
REQUEST
=
None
,
RESPONSE
=
None
,
is
P
ackage
=
False
):
def
export
(
self
,
business_template
,
REQUEST
=
None
,
RESPONSE
=
None
,
is
_p
ackage
=
False
):
"""
Export the Business Template as a bt5 file and offer the user to
download it.
...
...
@@ -275,7 +275,7 @@ class TemplateTool (BaseTool):
try
:
if
RESPONSE
is
not
None
:
RESPONSE
.
setHeader
(
'Content-type'
,
'tar/x-gzip'
)
if
not
is
P
ackage
:
if
not
is
_p
ackage
:
RESPONSE
.
setHeader
(
'Content-Disposition'
,
'inline;filename=%s-%s.bt5'
%
(
business_template
.
getTitle
(),
business_template
.
getVersion
()))
else
:
...
...
@@ -325,10 +325,10 @@ class TemplateTool (BaseTool):
REQUEST
.
RESPONSE
.
redirect
(
"%s?portal_status_message=%s"
%
(
ret_url
,
psm
))
def
_download_local
(
self
,
path
,
bt_id
,
is
P
ackage
=
False
):
def
_download_local
(
self
,
path
,
bt_id
,
is
_p
ackage
=
False
):
"""Download Business Template from local directory or file
"""
if
is
P
ackage
:
if
is
_p
ackage
:
bp
=
self
.
newContent
(
bt_id
,
'Business Package'
)
bp
.
importFile
(
path
)
return
bp
...
...
@@ -362,7 +362,7 @@ class TemplateTool (BaseTool):
shutil.rmtree(svn_checkout_tmp_dir)
security.declareProtected( '
Import
/
Export
objects
', '
download
' )
def download(self, url, id=None, REQUEST=None, is
P
ackage=False):
def download(self, url, id=None, REQUEST=None, is
_p
ackage=False):
"""
Download Business Template from url, can be file or local directory
"""
...
...
@@ -386,7 +386,7 @@ class TemplateTool (BaseTool):
return self[self._setObject(id, bt)]
bt = self._download_url(url, id)
else:
bt = self._download_local(os.path.normpath(name), id, is
P
ackage)
bt = self._download_local(os.path.normpath(name), id, is
_p
ackage)
bt.build(no_action=True)
return bt
...
...
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