l.b.i.b.IBug(ICanBeMentored, IPrivacy, IHasLinkedBranches) : interface documentation

Part of lp.bugs.interfaces.bug View In Hierarchy

Known subclasses: lp.bugs.interfaces.bug.IBugAddForm

Known implementations: lp.bugs.model.bug.Bug, lp.bugs.scripts.tests.test_bugnotification.MockBug

The core bug entry.
Int ownerID Undocumented
TextLine displayname Undocumented
Attribute initial_message The message that was specified when creating the bug
Attribute affected_pillars The "pillars", products or distributions, affected by this bug.
Bool has_cves Undocumented
Attribute cve_links Links between this bug and CVE entries.
Attribute questions List of questions related to this bug.
Attribute specifications List of related specifications.
Bool is_complete True or False depending on whether this bug is considered completely addressed. A bug in Launchpad is completely addressed when there are no tasks that are still open for the bug.
Bool permits_expiration Expiration is permitted when the bug is not valid anywhere, a message was sent to the bug reporter, and the bug is associated with pillars that have enabled bug expiration.
Datetime heat_last_updated Undocumented
Attribute bug_messages The bug messages related to this object.
Attribute comment_count The number of comments on this bug, not including the initial comment.
Attribute followup_subject The likely subject of the next message.
Attribute has_patches Does this bug have any patches?
Attribute latest_patch The most recent patch of this bug.
Attribute official_tags The official bug tags relevant to this bug.
Method newMessage Create a new message, and link it to this object.
Method subscribe Subscribe person to the bug.
Method unsubscribe Remove this person's subscription to this bug.
Method unsubscribeFromDupes Remove this person's subscription from all dupes of this bug.
Method isSubscribed Is person subscribed to this bug?
Method isSubscribedToDupes Is person directly subscribed to dupes of this bug?
Method getDirectSubscriptions A sequence of IBugSubscriptions directly linked to this bug.
Method getDirectSubscribers A list of IPersons that are directly subscribed to this bug.
Method getIndirectSubscribers Return IPersons that are indirectly subscribed to this bug.
Method getAlsoNotifiedSubscribers Return IPersons in the "Also notified" subscriber list.
Method getSubscriptionsFromDuplicates Return IBugSubscriptions subscribed from dupes of this bug.
Method getSubscribersFromDuplicates Return IPersons subscribed from dupes of this bug.
Method getSubscribersForPerson Find the persons or teams by which person is subscribed.
Method getBugNotificationRecipients Return a complete INotificationRecipientSet instance.
Method addChangeNotification Add a bug change notification.
Method addCommentNotification Add a bug comment notification.
Method addChange Record a change to the bug.
Method expireNotifications Expire any pending notifications that have not been emailed.
Method addWatch Create a new watch for this bug on the given remote bug and bug
Method removeWatch Remove a bug watch from the bug.
Method addTask Create a new bug task on this bug.
Method hasBranch Is this branch linked to this bug?
Method addAttachment Attach a file to this bug.
Method linkAttachment Link an ILibraryFileAlias to this bug.
Method linkCVE Ensure that this CVE is linked to this bug.
Method linkCVEAndReturnNothing Ensure that this CVE is linked to this bug.
Method unlinkCVE Ensure that any links between this bug and the given CVE are
Method findCvesInText Find any CVE references in the given text, make sure they exist
Method canBeAQuestion Return True of False if a question can be created from this bug.
Method convertToQuestion Create and return a Question from this Bug.
Method getQuestionCreatedFromBug Return the question created from this Bug, or None.
Method linkMessage Add a comment to this bug.
Method getMessageChunks Return MessageChunks corresponding to comments made on this bug
Method getNullBugTask Create an INullBugTask and return it for the given parameters.
Method addNomination Nominate a bug for an IDistroSeries or IProductSeries.
Method canBeNominatedFor Can this bug nominated for this target?
Method getNominationFor Return the IBugNomination for the target.
Method getNominations Return a list of all IBugNominations for this bug.
Method getBugWatch Return the BugWatch that has the given bugtracker and remote bug.
Method setStatus Set the status of the bugtask related to the specified target.
Method setPrivate Set bug privacy.
Method setSecurityRelated Set bug security.
Method getBugTask Return the bugtask with the specified target.
Method getBugTasksByPackageName Return a mapping from ISourcePackageName to its bug tasks.
Method isUserAffected Is :user: marked as affected by this bug?
Method markUserAffected Mark :user: as affected by this bug.
Method markAsDuplicate Mark this bug as a duplicate of another.
Method setCommentVisibility Set the visible attribute on a bug comment. This is restricted
Method userCanView Return True if user can see this IBug, false otherwise.
Method linkHWSubmission Link a HWSubmission to this bug.
Method unlinkHWSubmission Remove a link to a HWSubmission.
Method getHWSubmissions Return HWDB submissions linked to this bug.
Method setHeat Set the heat for the bug.
Method updateHeat Update the heat for the bug.
Method isExpirable Is this bug eligible for expiration and was it last updated

Inherited from ICanBeMentored:

Method canMentor True if this user could now offer mentoring on this piece of
Method isMentor True if the user is offering mentoring for this piece of work.
Method offerMentoring Record that the user is willing to mentor anyone who is trying to
Method retractMentoring Remove the offer of mentoring for this work by this user.

Inherited from IHasMentoringOffers (via ICanBeMentored):

Attribute mentoring_offers The list of mentoring offers related to this object.

Inherited from IPrivacy:

Bool private Private objects are visible to members or subscribers.

Inherited from IHasLinkedBranches:

Method linkBranch Associate a branch with this bug.
Method unlinkBranch Unlink a branch from this bug.
ownerID =
Undocumented
displayname =
Undocumented
initial_message =
The message that was specified when creating the bug
affected_pillars =
The "pillars", products or distributions, affected by this bug.
has_cves =
Undocumented
cve_links =
Links between this bug and CVE entries.
questions =
List of questions related to this bug.
specifications =
List of related specifications.
is_complete =
True or False depending on whether this bug is considered completely addressed. A bug in Launchpad is completely addressed when there are no tasks that are still open for the bug.
permits_expiration =
Expiration is permitted when the bug is not valid anywhere, a message was sent to the bug reporter, and the bug is associated with pillars that have enabled bug expiration.
heat_last_updated =
Undocumented
bug_messages =
The bug messages related to this object.
comment_count =
The number of comments on this bug, not including the initial comment.
followup_subject =
The likely subject of the next message.
has_patches =
Does this bug have any patches?
latest_patch =
The most recent patch of this bug.
official_tags =
The official bug tags relevant to this bug.
@operation_parameters(optional_message_subject_field(), copy_field(IMessage['content']))
@call_with(REQUEST_USER)
@export_factory_operation(IMessage, )
def newMessage(owner, subject, content):
Create a new message, and link it to this object.
@operation_parameters(Reference(IPerson, _('Person'), True))
@call_with(REQUEST_USER, False)
@export_write_operation()
def subscribe(person, subscribed_by, suppress_notify=True):
Subscribe person to the bug.
Parameterspersonthe subscriber.
subscribed_bythe person who created the subscription.
suppress_notifya flag to suppress notify call.
Returnsan IBugSubscription.
@operation_parameters(Reference(IPerson, _('Person'), False))
@call_with(REQUEST_USER)
@export_write_operation()
def unsubscribe(person, unsubscribed_by):
Remove this person's subscription to this bug.
@operation_parameters(Reference(IPerson, _('Person'), False))
@call_with(REQUEST_USER)
@export_write_operation()
def unsubscribeFromDupes(person, unsubscribed_by):
Remove this person's subscription from all dupes of this bug.
def isSubscribed(person):
Is person subscribed to this bug?

Returns True if the user is explicitly subscribed to this bug (no matter what the type of subscription), otherwise False.

If person is None, the return value is always False.

def isSubscribedToDupes(person):
Is person directly subscribed to dupes of this bug?

Returns True if the user is directly subscribed to at least one duplicate of this bug, otherwise False.

def getDirectSubscriptions():
A sequence of IBugSubscriptions directly linked to this bug.
def getDirectSubscribers():
A list of IPersons that are directly subscribed to this bug.

Direct subscribers have an entry in the BugSubscription table.

def getIndirectSubscribers():
Return IPersons that are indirectly subscribed to this bug.

Indirect subscribers get bugmail, but don't have an entry in the BugSubscription table. This includes bug contacts, subscribers from dupes, etc.

def getAlsoNotifiedSubscribers():
Return IPersons in the "Also notified" subscriber list.

This includes bug contacts and assignees, but not subscribers from duplicates.

def getSubscriptionsFromDuplicates():
Return IBugSubscriptions subscribed from dupes of this bug.
def getSubscribersFromDuplicates():
Return IPersons subscribed from dupes of this bug.
def getSubscribersForPerson(person):
Find the persons or teams by which person is subscribed.

This call should be quite cheap to make and performs a single query.

ReturnsAn IResultSet.
def getBugNotificationRecipients(duplicateof=None, old_bug=None, include_master_dupe_subscribers=False):
Return a complete INotificationRecipientSet instance.

The INotificationRecipientSet instance will contain details of all recipients for bug notifications sent by this bug; this includes email addresses and textual and header-ready rationales. See canonical.launchpad.interfaces.BugNotificationRecipients for details of this implementation. If this bug is a dupe, set include_master_dupe_subscribers to True to include the master bug's subscribers as recipients.

def addChangeNotification(text, person, recipients=None, when=None):
Add a bug change notification.
def addCommentNotification(message, recipients=None):
Add a bug comment notification.
def addChange(change, recipients=None):
Record a change to the bug.

:param change: An `IBugChange` instance from which to take the
    change data.
:param recipients: A set of `IBugNotificationRecipient`s to whom
    to send notifications about this change. If None is passed
    the default list of recipients for the bug will be used.
def expireNotifications():
Expire any pending notifications that have not been emailed.

This will mark any notifications related to this bug as having been emailed. The intent is to prevent large quantities of bug mail being generated during bulk imports or changes.

@call_with(REQUEST_USER)
@rename_parameters_as('bug_tracker', 'remote_bug')
@export_factory_operation(IBugWatch, 'bugtracker''remotebug')
def addWatch(bugtracker, remotebug, owner):
Create a new watch for this bug on the given remote bug and bug tracker, owned by the person given as the owner.
def removeWatch(bug_watch, owner):
Remove a bug watch from the bug.
@call_with(REQUEST_USER)
@operation_parameters(copy_field(IBugTask['target']))
@export_factory_operation(IBugTask, )
def addTask(owner, target):
Create a new bug task on this bug.
def hasBranch(branch):
Is this branch linked to this bug?
@call_with(REQUEST_USER)
@operation_parameters(Bytes(attachment_size_constraint), Text(), TextLine(), Bool(), TextLine(), Text())
@export_factory_operation(IBugAttachment, )
def addAttachment(owner, data, comment, filename, is_patch=False, content_type=None, description=None):
Attach a file to this bug.
Unknown Field: ownerAn IPerson.
Unknown Field: dataA file-like object, or a str.
Unknown Field: descriptionA brief description of the attachment.
Unknown Field: commentAn IMessage or string.
Unknown Field: filenameA string.
Unknown Field: is_patchA boolean.
def linkAttachment(owner, file_alias, comment, is_patch=False, description=None):
Link an ILibraryFileAlias to this bug.

This method should only be called by addAttachment() and FileBugViewBase.submit_bug_action, otherwise we may get inconsistent settings of bug.private and file_alias.restricted.

Unknown Field: ownerAn IPerson.
Unknown Field: file_aliasThe ILibraryFileAlias to link to this bug.
Unknown Field: descriptionA brief description of the attachment.
Unknown Field: commentAn IMessage or string.
Unknown Field: is_patchA boolean.
def linkCVE(cve, user):
Ensure that this CVE is linked to this bug.
@call_with(REQUEST_USER)
@operation_parameters(Reference(ICve, _('CVE'), True))
@export_operation_as('linkCVE')
@export_write_operation()
def linkCVEAndReturnNothing(cve, user):
Ensure that this CVE is linked to this bug.
@call_with(REQUEST_USER)
@operation_parameters(Reference(ICve, _('CVE'), True))
@export_write_operation()
def unlinkCVE(cve, user):
Ensure that any links between this bug and the given CVE are removed.
def findCvesInText(text, user):
Find any CVE references in the given text, make sure they exist in the database, and are linked to this bug.

The user is the one linking to the CVE.

def canBeAQuestion():
Return True of False if a question can be created from this bug.

A Question can be created from a bug if:
1. There is only one bugtask with a status of New, Incomplete,
   Confirmed, or Wont Fix. Any other bugtasks must be Invalid.
2. The bugtask's target uses Launchpad to track bugs.
3. The bug was not made into a question previously.
def convertToQuestion(person, comment=None):
Create and return a Question from this Bug.

Bugs that are also in external bug trackers cannot be converted to questions. This is also true for bugs that are being developed.

The IQuestionTarget is provided by the IBugTask that is not Invalid and is not a conjoined slave. Only one question can be made from a bug.

An AssertionError is raised if the bug has zero or many BugTasks that can provide a QuestionTarget. It will also be raised if a question was previously created from the bug.

Unknown Field: personThe IPerson creating a question from this bug
Unknown Field: commentA string. An explanation of why the bug is a question.
def getQuestionCreatedFromBug():
Return the question created from this Bug, or None.
def linkMessage(message, bugwatch=None, user=None, remote_comment_id=None):
Add a comment to this bug.
ParametersmessageThe IMessage to be used as a comment.
bugwatchThe IBugWatch of the bug this comment was imported from, if it's an imported comment.
userThe IPerson adding the comment.
remote_comment_idThe id this comment has in the remote bug tracker, if it's an imported comment.
def getMessageChunks():
Return MessageChunks corresponding to comments made on this bug
def getNullBugTask(product=None, productseries=None, sourcepackagename=None, distribution=None, distroseries=None):
Create an INullBugTask and return it for the given parameters.
@operation_parameters(Reference(Interface, _('Target')))
@call_with(REQUEST_USER)
@export_factory_operation(Interface, )
def addNomination(owner, target):
Nominate a bug for an IDistroSeries or IProductSeries.

This method creates and returns a BugNomination. (See lp.bugs.model.bugnomination.BugNomination.)

Unknown Field: ownerAn IPerson.
Unknown Field: targetAn IDistroSeries or IProductSeries.
@operation_parameters(Reference(Interface, _('Target')))
@export_read_operation()
def canBeNominatedFor(target):
Can this bug nominated for this target?

Returns True or False.

Unknown Field: nomination_targetAn IDistroSeries or IProductSeries.
@operation_parameters(Reference(Interface, _('Target')))
@operation_returns_entry(Interface)
@export_read_operation()
def getNominationFor(target):
Return the IBugNomination for the target.

If no nomination is found, a NotFoundError is raised.

Parametersnomination_targetAn IDistroSeries or IProductSeries.
@operation_parameters(Reference(Interface, _('Target'), False), List(_('Nominations to search through.'), Reference(Interface), False))
@operation_returns_collection_of(Interface)
@export_read_operation()
def getNominations(target=None, nominations=None):
Return a list of all IBugNominations for this bug.

The list is ordered by IBugNominations.target.bugtargetdisplayname.

ParameterstargetAn IProduct or IDistribution. Only nominations for this target are returned.
nominationsThe list of nominations to search through. If none is given, the bug's nominations are looked through. This can be useful when having to call this method multiple times, to avoid getting the list of nominations each time.
def getBugWatch(bugtracker, remote_bug):
Return the BugWatch that has the given bugtracker and remote bug.

Return None if this bug doesn't have such a bug watch.

def setStatus(target, status, user):
Set the status of the bugtask related to the specified target.

If a bug task was edited, emit a lazr.lifecycle.interfaces.IObjectModifiedEvent and return the edited bugtask.

Return None if no bugtask was edited.

Unknown Field: targetThe target of the bugtask that should be modified.
Unknown Field: statusThe status the bugtask should be set to.
Unknown Field: userThe IPerson doing the change.
@mutator_for(private)
@operation_parameters(copy_field(private))
@call_with(REQUEST_USER)
@export_write_operation()
def setPrivate(private, who):
Set bug privacy.

Return True if a change is made, False otherwise.

Unknown Field: privateTrue/False.
Unknown Field: whoThe IPerson who is making the change.
@mutator_for(security_related)
@operation_parameters(copy_field(security_related))
@export_write_operation()
def setSecurityRelated(security_related):
Set bug security.

This may also cause the security contact to be subscribed if one is registered and if the bug is not private.

Return True if a change is made, False otherwise.

Unknown Field: security_relatedTrue/False.
def getBugTask(target):
Return the bugtask with the specified target.

Return None if no such bugtask is found.

def getBugTasksByPackageName(bugtasks):
Return a mapping from ISourcePackageName to its bug tasks.

This mapping is suitable to pass as the bugtasks_by_package cache to getConjoinedMaster().

The mapping is from a ISourcePackageName to all the bug tasks that are targeted to such a package name, no matter which distribution or distro series it is.

All the tasks that don't have a package will be available under None.

@call_with(REQUEST_USER)
@export_write_operation()
def isUserAffected(user):
Is :user: marked as affected by this bug?
@operation_parameters(Bool(_('Does this bug affect you?'), False, True))
@call_with(REQUEST_USER)
@export_write_operation()
def markUserAffected(user, affected=True):
Mark :user: as affected by this bug.
@mutator_for(duplicateof)
@operation_parameters(copy_field(duplicateof))
@export_write_operation()
def markAsDuplicate(duplicate_of):
Mark this bug as a duplicate of another.
@operation_parameters(Int(_('The number of the comment in the list of messages.'), True), Bool(_('Show this comment?'), True))
@call_with(REQUEST_USER)
@export_write_operation()
def setCommentVisibility(user, comment_number, visible):
Set the visible attribute on a bug comment. This is restricted to Launchpad admins, and will return a HTTP Error 401: Unauthorized error for non-admin callers.
def userCanView(user):
Return True if user can see this IBug, false otherwise.
@operation_parameters(Reference(Interface, _('A HWDB submission'), True))
@export_write_operation()
def linkHWSubmission(submission):
Link a HWSubmission to this bug.
@operation_parameters(Reference(Interface, _('A HWDB submission'), True))
@export_write_operation()
def unlinkHWSubmission(submission):
Remove a link to a HWSubmission.
@call_with(REQUEST_USER)
@operation_returns_collection_of(Interface)
@export_read_operation()
def getHWSubmissions(user=None):
Return HWDB submissions linked to this bug.

Only those submissions are returned which the user can access. Public submissions are always included; private submisisons only if the user is the owner or an admin.

ParametersuserThe user making the request.
ReturnsA sequence of HWDB submissions linked to this bug.
def setHeat(heat, timestamp=None):
Set the heat for the bug.
def updateHeat():
Update the heat for the bug.
@operation_parameters(Int(_('Number of days of inactivity for which to check.'), False))
@export_read_operation()
def isExpirable(days_old=None):
Is this bug eligible for expiration and was it last updated more than X days ago?

If days_old is None the default number of days without activity is used.

Returns True or False.

API Documentation for Launchpad, generated by pydoctor at 2010-09-27 00:00:11.