buildframework/helium/sf/python/pythoncore/lib/ccm/__init__.py
branchhelium-9.0
changeset 618 df88fead2976
parent 587 85df38eb4012
--- a/buildframework/helium/sf/python/pythoncore/lib/ccm/__init__.py	Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/python/pythoncore/lib/ccm/__init__.py	Thu Jul 22 17:08:43 2010 +0300
@@ -1201,7 +1201,7 @@
         result = self._session.execute("finduse \"%s\"" % self, FinduseResult(self))
         return result.output
     
-    def delete(self, recurse=False):
+    def delete(self, recurse=False, scope=None):
         """ Delete a synergy project. """
         args = ""
         if recurse:
@@ -1209,8 +1209,10 @@
         parg = ""
         if self.type == "project":
             parg = "-project"
+        if scope:
+            args = args + ' -scope "' + scope + '"'
         result = self._session.execute("delete %s %s \"%s\"" % (args, parg, self))
-        if result.status != 0 and result.status != None:
+        if (result.status != 0 and result.status != None) or (result.output.strip().startswith('Cannot use')):
             raise CCMException("An error occurred while deleting object %s (error status: %s)\n%s" % (self, result.status, result.output), result)
         return result