~abentley/lp-dev-utils/ab-logging

« back to all changes in this revision

Viewing changes to lpscripts.py

  • Committer: Curtis Hovey
  • Date: 2011-05-22 14:36:00 UTC
  • Revision ID: sinzui.is@verizon.net-20110522143600-410qea58xd4lczg6
Updated scripts for field change

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/python2.4
 
1
#!/usr/bin/python2.6
2
2
 
3
3
__metaclass__ = type
4
4
__all__ = [
20
20
 
21
21
import _pythonpath
22
22
import launchpadlib.errors
23
 
from launchpadlib.launchpad import (
24
 
    EDGE_SERVICE_ROOT, Launchpad, STAGING_SERVICE_ROOT)
25
 
 
26
 
 
27
 
DEV_SERVICE_ROOT = 'https://api.launchpad.dev/beta/'
28
 
DOGFOOD_SERVICE_ROOT = 'https://api.dogfood.launchpad.net/beta/'
 
23
from launchpadlib.launchpad import Launchpad
 
24
 
 
25
EDGE_SERVICE_ROOT = 'https://api.staging.launchpad.net/'
 
26
STAGING_SERVICE_ROOT = 'https://api.staging.launchpad.net/'
 
27
DEV_SERVICE_ROOT = 'https://api.launchpad.dev/'
 
28
DOGFOOD_SERVICE_ROOT = 'https://api.dogfood.launchpad.net/'
29
29
SERVICE_ROOTS = dict(edge=EDGE_SERVICE_ROOT,
30
30
                     staging=STAGING_SERVICE_ROOT,
31
31
                     dev=DEV_SERVICE_ROOT,
37
37
    """Get a launchpad API instance for ``system_name``."""
38
38
    try:
39
39
        service_root = SERVICE_ROOTS[system_name.lower()]
40
 
        return Launchpad.login_with(app_name, service_root)
 
40
        return Launchpad.login_with(
 
41
            app_name, service_root='https://api.launchpad.net/',
 
42
            version='devel')
41
43
    except KeyError:
42
44
        print >> sys.stderr, "System '%s' not supported." % system_name
43
45
        print >> sys.stderr, "Use one of: ", SERVICE_ROOTS.keys()