Data Model version 2.1.2

Method: removeFrom


    Remove data from specified repository. Will remove from disk. NB This operation is marked as a query because this means it may be executed on a deleted object. It does have the lasting side effect of changing the contents of the repository.

guid: www.ccpn.ac.uk_Fogh_2007-04-23-16:25:49_00001__www.ccpn.ac.uk_Fogh_2007-10-03-14:53:27_00001__www.ccpn.ac.uk_Fogh_2006-09-14-16:28:57_00002
OpType: other
OpSubType: None
isQuery: True
isAbstract: False
Scope: instance_level
Code: # NB must be done by direct access
activeRepositories = self.activeRepositories
if (repository in activeRepositories and len(activeRepositories) <= 1
    and not self.isDeleted):
    raise ApiError("%s: cannot remove TopObject from last repository %s" % (self, repository))

from memops.format.xml import Util as xmlUtil
fileLocation = xmlUtil.findTopObjectPath(repository.url.getDataLocation(), self)
import os
try:
  os.remove(fileLocation)
except:
  print ("%s: could not remove %s" % (self, fileLocation))
  raise

if repository in activeRepositories:
  if repository is activeRepositories[0]:
    self.__dict__['isModified'] = True
  dataDict['activeRepositories'].remove(repository)
  Data Model Version 2.1.2
Go to Top  
  Autogenerated by  PyApiDocGen  revision 1.3   on  Thu Oct 2 16:09:05 2014    from data model package  memops.api.Implementation.TopObject   revision ?  
  Work done by the CCPN team.
www.ccpn.ac.uk