how to invoke destructors?

Asked by Jelmer Vernooij

The IBranch interface now supports a destructor (named destroySelfBreakReferences), but there doesn't seem to be any way to call this method from launchpadlib. The Launchpad tests confirm that calling DELETE on branch URLs works.

Another method that was added to the IBranch interface in the same patch named canBeDeleted() shows up and can be called without problems.

How should I call this destructor?

Question information

Language:
English Edit question
Status:
Solved
For:
launchpadlib Edit question
Assignee:
No assignee Edit question
Solved by:
Leonard Richardson
Solved:
Last query:
Last reply:
Revision history for this message
Best Leonard Richardson (leonardr) said :
#1

It looks like I never implemented support for entry destructors in lazr.restfulclient. I don't see any tests in lazr.restfulclient that invoke DELETE on any resource other than a hosted file. This is a bug.

As a workaround, something like this code should work:

self._root._browser.delete(self.self_link)

Revision history for this message
Jelmer Vernooij (jelmer) said :
#2

Thanks Leonard Richardson, that solved my question.

Revision history for this message
Jelmer Vernooij (jelmer) said :
#3

Thanks, that worked. I've also filed a bug since it would still be nice if this was more easily accessible.