Commit 15659d56 authored by Fabien Morin's avatar Fabien Morin

add a method to check if bt path exists


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@29730 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 0b1c3a03
......@@ -355,6 +355,19 @@ class TemplateTool (BaseTool):
finally:
shutil.rmtree(svn_checkout_tmp_dir)
def assertBtPathExists(self, url):
"""
Check if bt is present on the system
"""
urltype, name = splittype(url)
# Windows compatibility
if WIN:
if os.path.isdir(os.path.normpath(url)) or \
os.path.isfile(os.path.normpath(url)):
urltype = 'file'
name = os.path.normpath(url)
return os.path.exists(os.path.normpath(name))
security.declareProtected( 'Import/Export objects', 'download' )
def download(self, url, id=None, REQUEST=None):
"""
......
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