Commit 5c872d99 authored by Ayush Tiwari's avatar Ayush Tiwari

bt5_prototype: Follow the naming guileline for parameters

parent 39c5c1a4
...@@ -266,7 +266,7 @@ class TemplateTool (BaseTool): ...@@ -266,7 +266,7 @@ class TemplateTool (BaseTool):
return REQUEST.RESPONSE.redirect( ret_url ) return REQUEST.RESPONSE.redirect( ret_url )
security.declareProtected( 'Import/Export objects', 'export' ) security.declareProtected( 'Import/Export objects', 'export' )
def export(self, business_template, REQUEST=None, RESPONSE=None, isPackage=False): def export(self, business_template, REQUEST=None, RESPONSE=None, is_package=False):
""" """
Export the Business Template as a bt5 file and offer the user to Export the Business Template as a bt5 file and offer the user to
download it. download it.
...@@ -275,7 +275,7 @@ class TemplateTool (BaseTool): ...@@ -275,7 +275,7 @@ class TemplateTool (BaseTool):
try: try:
if RESPONSE is not None: if RESPONSE is not None:
RESPONSE.setHeader('Content-type','tar/x-gzip') RESPONSE.setHeader('Content-type','tar/x-gzip')
if not isPackage: if not is_package:
RESPONSE.setHeader('Content-Disposition', 'inline;filename=%s-%s.bt5' RESPONSE.setHeader('Content-Disposition', 'inline;filename=%s-%s.bt5'
% (business_template.getTitle(), business_template.getVersion())) % (business_template.getTitle(), business_template.getVersion()))
else: else:
...@@ -325,10 +325,10 @@ class TemplateTool (BaseTool): ...@@ -325,10 +325,10 @@ class TemplateTool (BaseTool):
REQUEST.RESPONSE.redirect("%s?portal_status_message=%s" REQUEST.RESPONSE.redirect("%s?portal_status_message=%s"
% (ret_url, psm)) % (ret_url, psm))
def _download_local(self, path, bt_id, isPackage=False): def _download_local(self, path, bt_id, is_package=False):
"""Download Business Template from local directory or file """Download Business Template from local directory or file
""" """
if isPackage: if is_package:
bp = self.newContent(bt_id, 'Business Package') bp = self.newContent(bt_id, 'Business Package')
bp.importFile(path) bp.importFile(path)
return bp return bp
...@@ -362,7 +362,7 @@ class TemplateTool (BaseTool): ...@@ -362,7 +362,7 @@ class TemplateTool (BaseTool):
shutil.rmtree(svn_checkout_tmp_dir) shutil.rmtree(svn_checkout_tmp_dir)
security.declareProtected( 'Import/Export objects', 'download' ) security.declareProtected( 'Import/Export objects', 'download' )
def download(self, url, id=None, REQUEST=None, isPackage=False): def download(self, url, id=None, REQUEST=None, is_package=False):
""" """
Download Business Template from url, can be file or local directory Download Business Template from url, can be file or local directory
""" """
...@@ -386,7 +386,7 @@ class TemplateTool (BaseTool): ...@@ -386,7 +386,7 @@ class TemplateTool (BaseTool):
return self[self._setObject(id, bt)] return self[self._setObject(id, bt)]
bt = self._download_url(url, id) bt = self._download_url(url, id)
else: else:
bt = self._download_local(os.path.normpath(name), id, isPackage) bt = self._download_local(os.path.normpath(name), id, is_package)
bt.build(no_action=True) bt.build(no_action=True)
return bt return bt
......
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