def destroySelf(self): """Delete this mirror from the database. Only mirrors which have never been probed can be deleted. """ assert self.last_probe_record is None, ( "This mirror has been probed and thus can't be removed.") SQLBase.destroySelf(self)
def _create(self, id, **kw): bus = kw.get("bus") if bus is None: raise TypeError("HWVendorID() did not get expected keyword " "argument bus") vendor_id_for_bus = kw.get("vendor_id_for_bus") if vendor_id_for_bus is None: raise TypeError("HWVendorID() did not get expected keyword " "argument vendor_id_for_bus") if not isValidVendorID(bus, vendor_id_for_bus): raise ParameterError("%s is not a valid vendor ID for %s" % (repr(vendor_id_for_bus), bus.title)) SQLBase._create(self, id, **kw)
def _create(self, id, **kw): bus_vendor = kw.get("bus_vendor") if bus_vendor is None: raise TypeError("HWDevice() did not get expected keyword " "argument bus_vendor") bus_product_id = kw.get("bus_product_id") if bus_product_id is None: raise TypeError("HWDevice() did not get expected keyword " "argument bus_product_id") if not isValidProductID(bus_vendor.bus, bus_product_id): raise ParameterError("%s is not a valid product ID for %s" % (repr(bus_product_id), bus_vendor.bus.title)) SQLBase._create(self, id, **kw)
def destroySelf(self): """Remove this record and associated job/specific_job.""" job = self.job specific_job = self.specific_job builder = self.builder SQLBase.destroySelf(self) specific_job.cleanUp() job.destroySelf() if builder is not None: del get_property_cache(builder).currentjob self._clear_specific_job_cache()
def destroySelf(self): """See `IBugWatch`.""" if (len(self.bugtasks) > 0 or not self.getImportedBugMessages().is_empty()): raise BugWatchDeletionError( "Can't delete bug watches linked to tasks or comments.") # Remove any BugWatchActivity entries for this bug watch. self.activity.remove() # XXX 2010-09-29 gmb bug=647103 # We flush the store to make sure that errors bubble up and # are caught by the OOPS machinery. SQLBase.destroySelf(self) store = Store.of(self) store.flush()
def _create(self, id, **kw): bus_vendor = kw.get('bus_vendor') if bus_vendor is None: raise TypeError('HWDevice() did not get expected keyword ' 'argument bus_vendor') bus_product_id = kw.get('bus_product_id') if bus_product_id is None: raise TypeError('HWDevice() did not get expected keyword ' 'argument bus_product_id') if not isValidProductID(bus_vendor.bus, bus_product_id): raise ParameterError( '%s is not a valid product ID for %s' % (repr(bus_product_id), bus_vendor.bus.title)) SQLBase._create(self, id, **kw)
def _create(self, id, **kw): bus = kw.get('bus') if bus is None: raise TypeError('HWVendorID() did not get expected keyword ' 'argument bus') vendor_id_for_bus = kw.get('vendor_id_for_bus') if vendor_id_for_bus is None: raise TypeError('HWVendorID() did not get expected keyword ' 'argument vendor_id_for_bus') if not isValidVendorID(bus, vendor_id_for_bus): raise ParameterError( '%s is not a valid vendor ID for %s' % (repr(vendor_id_for_bus), bus.title)) SQLBase._create(self, id, **kw)
def _init(self, *args, **kw): """Provide the right interface for URL traversal.""" SQLBase._init(self, *args, **kw) # Provide the additional marker interface depending on what type # of archive this is. See also the browser:url declarations in # zcml/archivepermission.zcml. if self.permission == ArchivePermissionType.UPLOAD: alsoProvides(self, IArchiveUploader) elif self.permission == ArchivePermissionType.QUEUE_ADMIN: alsoProvides(self, IArchiveQueueAdmin) else: raise AssertionError( "Unknown permission type %s" % self.permission)
def _init(self, *args, **kw): """Provide the right interface for URL traversal.""" SQLBase._init(self, *args, **kw) # Provide the additional marker interface depending on what type # of archive this is. See also the browser:url declarations in # zcml/archivepermission.zcml. if self.permission == ArchivePermissionType.UPLOAD: alsoProvides(self, IArchiveUploader) elif self.permission == ArchivePermissionType.QUEUE_ADMIN: alsoProvides(self, IArchiveQueueAdmin) else: raise AssertionError("Unknown permission type %s" % self.permission)
def __init__(self, branch, job_type, metadata, **job_args): """Constructor. Extra keyword parameters are used to construct the underlying Job object. :param branch: The database branch this job relates to. :param job_type: The BranchJobType of this job. :param metadata: The type-specific variables, as a JSON-compatible dict. """ json_data = simplejson.dumps(metadata) SQLBase.__init__( self, job=Job(**job_args), branch=branch, job_type=job_type, _json_data=json_data)
def destroySelf(self): """See `IProductRelease`.""" assert self._files.count() == 0, ( "You can't delete a product release which has files associated " "with it.") SQLBase.destroySelf(self)
def destroySelf(self): """See `IBranchJob`.""" SQLBase.destroySelf(self) self.job.destroySelf()