This branch adds a separate portlet to show patches on a bug page; the portlet does no longer show them (bug 344054).
The implementation is quite straightfoward, I think:
- the template lib/lp/bugs/templates/bug-portlet-attachments.pt now creates two portlets instead of one
- class Bug has two new properties returning the list of patches and non-patch attachmentsm respectively
- doc test for the new properties
- changed pagetest.
test: ./bin/test -vv -f lp.bugs bugattachments
= Launchpad lint =
Checking for conflicts. and issues in doctests and templates.
Running jslint, xmllint, pyflakes, and pylint.
Using normal rules.
lib/lp/bugs/interfaces/bug.py
49: [F0401] Unable to import 'lazr.restful.declarations' (No module named restful)
55: [F0401] Unable to import 'lazr.restful.fields' (No module named restful)
56: [F0401] Unable to import 'lazr.restful.interface' (No module named restful)
476: [C0322, IBug.addAttachment] Operator not preceded by a space
comment=Text(), filename=TextLine(), is_patch=Bool(),
^
content_type=TextLine(), description=Text())
@export_factory_operation(IBugAttachment, [])
def addAttachment(owner, data, comment, filename, is_patch=False,
content_type=None, description=None):
611: [C0322, IBug.getNominations] Operator not preceded by a space
nominations=List(
^
title=_("Nominations to search through."),
value_type=Reference(schema=Interface), # IBugNomination
required=False))
@operation_returns_collection_of(Interface) # IBugNomination
@export_read_operation()
def getNominations(target=None, nominations=None):
691: [C0322, IBug.markUserAffected] Operator not preceded by a space
required=False, default=True))
^
@call_with(user=REQUEST_USER)
@export_write_operation()
def markUserAffected(user, affected=True):
706: [C0322, IBug.setCommentVisibility] Operator not preceded by a space
required=True),
^
visible=Bool(title=_('Show this comment?'), required=True))
@call_with(user=REQUEST_USER)
@export_write_operation()
def setCommentVisibility(user, comment_number, visible):
718: [C0322, IBug.linkHWSubmission] Operator not preceded by a space
Interface, title=_('A HWDB submission'), required=True))
^
@export_write_operation()
def linkHWSubmission(submission):
725: [C0322, IBug.unlinkHWSubmission] Operator not preceded by a space
Interface, title=_('A HWDB submission'), required=True))
^
@export_write_operation()
def unlinkHWSubmission(submission):
lib/lp/bugs/model/bug.py
25: [F0401] Unable to import 'email.Utils' (No module named Utils)
38: [F0401] Unable to import 'lazr.lifecycle.event' (No module named lifecycle)
40: [F0401] Unable to import 'lazr.lifecycle.snapshot' (No module named lifecycle)
This branch adds a separate portlet to show patches on a bug page; the portlet does no longer show them (bug 344054).
The implementation is quite straightfoward, I think:
- the template lib/lp/ bugs/templates/ bug-portlet- attachments. pt now creates two portlets instead of one
- class Bug has two new properties returning the list of patches and non-patch attachmentsm respectively
- doc test for the new properties
- changed pagetest.
test: ./bin/test -vv -f lp.bugs bugattachments
= Launchpad lint =
Checking for conflicts. and issues in doctests and templates.
Running jslint, xmllint, pyflakes, and pylint.
Using normal rules.
Linting changed files: bugs/configure. zcml bugs/doc/ bugattachments. txt bugs/interfaces /bug.py bugs/model/ bug.py bugs/stories/ bugattachments/ 20-edit- bug-attachment. txt bugs/templates/ bug-portlet- attachments. pt
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
== Pylint notices ==
lib/lp/ bugs/interfaces /bug.py declarations' (No module named restful) fields' (No module named restful) interface' (No module named restful) TextLine( ), is_patch=Bool(), type=TextLine( ), description=Text()) factory_ operation( IBugAttachment, []) owner, data, comment, filename, is_patch=False, type=None, description=None): ions] Operator not preceded by a space =List( _("Nominations to search through."), type=Reference( schema= Interface) , # IBugNomination False)) returns_ collection_ of(Interface) # IBugNomination read_operation( ) target= None, nominations=None): fected] Operator not preceded by a space with(user= REQUEST_ USER) write_operation () d(user, affected=True): Visibility] Operator not preceded by a space Bool(title= _('Show this comment?'), required=True)) with(user= REQUEST_ USER) write_operation () ility(user, comment_number, visible): ission] Operator not preceded by a space write_operation () n(submission) : bmission] Operator not preceded by a space write_operation () ion(submission) :
49: [F0401] Unable to import 'lazr.restful.
55: [F0401] Unable to import 'lazr.restful.
56: [F0401] Unable to import 'lazr.restful.
476: [C0322, IBug.addAttachment] Operator not preceded by a space
comment=Text(), filename=
^
content_
@export_
def addAttachment(
content_
611: [C0322, IBug.getNominat
nominations
^
title=
value_
required=
@operation_
@export_
def getNominations(
691: [C0322, IBug.markUserAf
required=False, default=True))
^
@call_
@export_
def markUserAffecte
706: [C0322, IBug.setComment
required=True),
^
visible=
@call_
@export_
def setCommentVisib
718: [C0322, IBug.linkHWSubm
Interface, title=_('A HWDB submission'), required=True))
^
@export_
def linkHWSubmissio
725: [C0322, IBug.unlinkHWSu
Interface, title=_('A HWDB submission'), required=True))
^
@export_
def unlinkHWSubmiss
lib/lp/ bugs/model/ bug.py .event' (No module named lifecycle) .snapshot' (No module named lifecycle)
25: [F0401] Unable to import 'email.Utils' (No module named Utils)
38: [F0401] Unable to import 'lazr.lifecycle
40: [F0401] Unable to import 'lazr.lifecycle