[Erp5-report] r29730 - /erp5/trunk/products/ERP5/Tool/TemplateTool.py

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Oct 16 09:26:32 CEST 2009


Author: fabien
Date: Fri Oct 16 09:26:31 2009
New Revision: 29730

URL: http://svn.erp5.org?rev=29730&view=rev
Log:
add a method to check if bt path exists

Modified:
    erp5/trunk/products/ERP5/Tool/TemplateTool.py

Modified: erp5/trunk/products/ERP5/Tool/TemplateTool.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Tool/TemplateTool.py?rev=29730&r1=29729&r2=29730&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Tool/TemplateTool.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Tool/TemplateTool.py [utf8] Fri Oct 16 09:26:31 2009
@@ -354,6 +354,19 @@
         return self._download_local(svn_checkout_dir, bt_id)
       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):




More information about the Erp5-report mailing list