~doctormo/python-snippets/lp-merge-request-example

« back to all changes in this revision

Viewing changes to launchpadlib/helloworld.py

  • Committer: Jono Bacon
  • Date: 2010-01-12 18:38:28 UTC
  • mfrom: (12.1.1 launchpadlib)
  • Revision ID: jono@ubuntu.com-20100112183828-9wdutnsi2ohe38sk
Our first liblaunchpad examples! Thanks Markus!

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/env python
 
2
#
 
3
# [SNIPPET_NAME: launchpadlib Hello-World]
 
4
# [SNIPPET_CATEGORIES: launchpadlib]
 
5
# [SNIPPET_DESCRIPTION: Get launchpad username via launchpadlib]
 
6
# [SNIPPET_AUTHOR: Markus Korn <thekorn@gmx.de>]
 
7
# [SNIPPET_LICENSE: GPL]
 
8
 
 
9
# For more Examples see https://help.launchpad.net/API/Examples
 
10
 
 
11
from launchpadlib.launchpad import Launchpad, STAGING_SERVICE_ROOT
 
12
 
 
13
# connect to the staging service of launchpad
 
14
launchpad = Launchpad.login_with("python-snippets", STAGING_SERVICE_ROOT)
 
15
# print username
 
16
print 'Hello, %s!' % launchpad.me.display_name