#!/usr/bin/env python
#
# Tutorial:
#    We've seen how to get the basic information from a bug getting more
#    information isn't much different. It usually just involves additional
#    objects that some of the bug properties return.
#

from lpltk.service                   import LaunchpadService

# LpltkHelloWorld
#
class LpltkHelloWorld():
    # __init__
    #
    def __init__(self):
        return

    # main
    #
    def main(self):
        try:
            lp  = LaunchpadService()
            bug = lp.get_bug(1)

            # The title just returns a simple string.
            #
            title = bug.title

            # Getting the origninal bug submitter means going through a "person"
            # object wich we get via the bug.owner property.
            #
            submitter = bug.owner.display_name

            # Getting a list of all the tags that are currently applied to a bug
            # comes from the bug.tags property.
            #
            tags = bug.tags

            # Important dates related to a bug:
            #   bug.date_created      - Date the bug was first entered into Launchpad
            #   bug.date_last_updated - When the bug was last updated (status, tags, etc.)
            #   bug.date_last_message - When the last comment was added to the bug.
            #
            created = bug.date_created
            updated = bug.date_last_updated
            date_last_message = bug.date_last_message

        # Handle the user presses <ctrl-C>.
        #
        except KeyboardInterrupt:
            pass

        return

if __name__ == '__main__':
    app = LpltkHelloWorld()
    app.main()

# vi:set ts=4 sw=4 expandtab:

