Merge lp:~ossug-hychen/laika/getbzrlogin into lp:laika

Proposed by Hsin-Yi, Chen (hychen)
Status: Merged
Merged at revision: 18
Proposed branch: lp:~ossug-hychen/laika/getbzrlogin
Merge into: lp:laika
Diff against target: 30 lines (+10/-2)
1 file modified
laika (+10/-2)
To merge this branch: bzr merge lp:~ossug-hychen/laika/getbzrlogin
Reviewer Review Type Date Requested Status
Alex Chiang Approve
Review via email: mp+83372@code.launchpad.net

Description of the change

the os username may not launchpad id , and we can took the launchpad id from bzr

To post a comment you must log in.
Revision history for this message
Alex Chiang (achiang) wrote :

Looks good, thanks Tyson!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'laika'
--- laika 2011-08-08 17:25:11 +0000
+++ laika 2011-11-25 08:11:24 +0000
@@ -218,8 +218,16 @@
218 laika_config = ConfigParser.ConfigParser()218 laika_config = ConfigParser.ConfigParser()
219 laika_config.read(os.path.expanduser("~/.laikarc"))219 laika_config.read(os.path.expanduser("~/.laikarc"))
220220
221 def get_bzrlplogin():
222 path = os.path.expanduser('~/.bazaar/bazaar.conf')
223 if not os.path.exists(path):
224 return None
225 else:
226 cfg = ConfigParser.ConfigParser()
227 cfg.read(os.path.expanduser('~/.bazaar/bazaar.conf'))
228 return cfg.get('DEFAULT', 'launchpad_username')
221 def default_user():229 def default_user():
222 return os.getenv("USER")230 return get_bzrlplogin() or os.getenv("USER")
223 def default_window():231 def default_window():
224 return 8232 return 8
225 def default_bugpattern():233 def default_bugpattern():
@@ -230,7 +238,7 @@
230 for opt in opts:238 for opt in opts:
231 try:239 try:
232 config[opt] = laika_config.get(FORMAT, opt)240 config[opt] = laika_config.get(FORMAT, opt)
233 except: 241 except:
234 config[opt] = locals()["default_%s" % opt]()242 config[opt] = locals()["default_%s" % opt]()
235243
236 return config244 return config

Subscribers

People subscribed via source and target branches