1
# Author: Robert Collins <robert.collins@canonical.com>
3
# Copyright 2010 Canonical Ltd.
5
# This program is free software: you can redistribute it and/or modify it
6
# under the terms of the GNU General Public License version 3, as published
7
# by the Free Software Foundation.
9
# This program is distributed in the hope that it will be useful, but
10
# WITHOUT ANY WARRANTY; without even the implied warranties of
11
# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
12
# PURPOSE. See the GNU General Public License for more details.
14
# You should have received a copy of the GNU General Public License along
15
# with this program. If not, see <http://www.gnu.org/licenses/>.
17
from __future__ import with_statement
19
"""Configuration glue for lptools."""
28
from launchpadlib.launchpad import Launchpad
32
"""Ensure that dir exists."""
33
if not os.path.isdir(dir):
37
def get_launchpad(appname):
38
"""Get a login to launchpad for lptools caching in cachedir.
40
Note that caching is not multiple-process safe in launchpadlib,
41
and the appname parameter is used to create per-app cachedirs.
43
:param appname: The name of the app used to create per-app
46
return Launchpad.login_with("lptools-%s" % appname, "production")