* manage-credentials: Use common.py's mkdir function to create as many

subdirectories as necessary for the credentials directory (LP: #317317).
This commit is contained in:
Jonathan Davies 2009-01-15 12:30:07 +00:00
parent ecacc76da1
commit 5ee60209fe
2 changed files with 4 additions and 2 deletions

3
debian/changelog vendored
View File

@ -1,6 +1,7 @@
ubuntu-dev-tools (0.55) UNRELEASED; urgency=low ubuntu-dev-tools (0.55) UNRELEASED; urgency=low
* Changes go here. * manage-credentials: Use common.py's mkdir function to create as many
subdirectories as necessary for the credentials directory (LP: #317317).
-- Jonathan Davies <jpds@ubuntu.com> Wed, 14 Jan 2009 19:51:07 +0000 -- Jonathan Davies <jpds@ubuntu.com> Wed, 14 Jan 2009 19:51:07 +0000

View File

@ -24,6 +24,7 @@ import sys
from optparse import OptionParser, make_option from optparse import OptionParser, make_option
from common import Credentials, Launchpad, translate_service from common import Credentials, Launchpad, translate_service
from common import LEVEL, translate_api_web, approve_application from common import LEVEL, translate_api_web, approve_application
from common import mkdir
class CmdOptions(OptionParser): class CmdOptions(OptionParser):
@ -103,7 +104,7 @@ def create_credentials(options):
f = file(options.output, "w") f = file(options.output, "w")
else: else:
if not os.path.isdir(os.path.expanduser("~/.cache/lp_credentials")): if not os.path.isdir(os.path.expanduser("~/.cache/lp_credentials")):
os.mkdir(os.path.expanduser("~/.cache/lp_credentials/")) mkdir(os.path.expanduser("~/.cache/lp_credentials/"))
filepath = os.path.expanduser("~/.cache/lp_credentials/%s-%s.txt" % \ filepath = os.path.expanduser("~/.cache/lp_credentials/%s-%s.txt" % \
(options.consumer, str(options.level).lower())) (options.consumer, str(options.level).lower()))
f = file(filepath, "w") f = file(filepath, "w")