neither text nor html interface does extract milestones

Bug #202204 reported by Daniel Holbach
2
Affects Status Importance Assigned to Milestone
python-launchpad-bugs
Fix Released
Medium
Markus Korn

Bug Description

>>> import launchpadbugs.connector as Connector
>>> Bug = Connector.ConnectBug(method="Text")
/usr/lib/python2.5/site-packages/launchpadbugs/text_bug.py:22: FutureWarning: text_bug API not stable yet
  warnings.warn("text_bug API not stable yet", FutureWarning)
>>> b = Bug(95168)
>>> for a in b.infotable:
... print a.milestone
...
None
None
>>>

Revision history for this message
Markus Korn (thekorn) wrote :

The text interface seemed to change a bit, as you can see here (in the "assignee"-row):

task: update-manager (Ubuntu)
status: Confirmed
date-created: Fri, 23 Mar 2007 20:25:32 -0000
date-confirmed: Fri, 23 Mar 2007 20:26:25 -0000
reporter: Michael Vogt (mvo)
importance: Wishlist
component: main
assignee:
milestone: later

it is possible to have a key without a value (In the past there was simply no such a key if there is no value)

Fixing the parser is a little tough, but I'm working on it.

Markus

Changed in python-launchpad-bugs:
assignee: nobody → thekorn
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Daniel Holbach (dholbach) wrote :

I looked a bit at the parser. Could we use email.message_from_string(block_that starts_with_task_or_bug) ?

Revision history for this message
Markus Korn (thekorn) wrote :

The reason why i did not use email.message_from_string() in the past was that this text view was not totally standard-conform, this might have been changed now, i will check this later. I it is now, we should rewrite this using the email module as it is a lot more easy and maintainable.

Anyway, I attached a fix against the current version of py-lp-bugs (tested for a small number of bugs, so....)

Markus

Revision history for this message
Daniel Holbach (dholbach) wrote :

Perfect... looks good to commit :-)

Revision history for this message
Markus Korn (thekorn) wrote :

ok, especially the first part can not be parsed with email.message_from_string(), don't know why
But it looks like this parts (bug data + tasks) can be parsed with ConfigParser blockwise, we should chage this in the future.

Markus

Revision history for this message
Markus Korn (thekorn) wrote :

------------------------------------------------------------
revno: 80
committer: Markus Korn <email address hidden>
branch nick: main
timestamp: Fri 2008-03-14 18:35:37 +0100
message:
  launchpadbugs/text_bug.py: fixed parsing of milestones (LP: #202204)
------------------------------------------------------------

Changed in python-launchpad-bugs:
status: Confirmed → Fix Committed
Revision history for this message
Markus Korn (thekorn) wrote :

reopen this as the committed patch only fixes the text interface, not the html one.
In the html mode this is a matter of authorization, if you are allowed to change the milestone than 'task.milestone' works as expected, if not this always returns 'None'.

I'm trying to find a xpath-expression to solve this

Markus

Changed in python-launchpad-bugs:
status: Fix Committed → In Progress
Revision history for this message
Markus Korn (thekorn) wrote :

------------------------------------------------------------
revno: 83
committer: Markus Korn <email address hidden>
branch nick: main
timestamp: Mon 2008-03-17 19:34:55 +0100
message:
  * launchpadbugs/html_bug.py: fixed parsing of milestones in the html
    mode if a user is not logged in (LP: #202204)
------------------------------------------------------------

Changed in python-launchpad-bugs:
status: In Progress → Fix Committed
Revision history for this message
Brian Murray (brian-murray) wrote :

This bug is Fix Released in the current bzr branch for python-launchpad-bugs. However, it happens to return incorrect information with the Hardy version of the package when parsing via the html interface. I don't think this is worthy of an SRU since the default parsing method is the text interface.

Changed in python-launchpad-bugs:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.