Merge lp:~bjornt/lp2kanban/launchpadlib-dir into lp:~launchpad/lp2kanban/trunk

Proposed by Björn Tillenius
Status: Merged
Approved by: Björn Tillenius
Approved revision: 79
Merged at revision: 80
Proposed branch: lp:~bjornt/lp2kanban/launchpadlib-dir
Merge into: lp:~launchpad/lp2kanban/trunk
Diff against target: 40 lines (+11/-2)
2 files modified
examples/config.ini (+6/-0)
src/lp2kanban/bugs2cards.py (+5/-2)
To merge this branch: bzr merge lp:~bjornt/lp2kanban/launchpadlib-dir
Reviewer Review Type Date Requested Status
Brad Crittenden (community) code Approve
Review via email: mp+157382@code.launchpad.net

Description of the change

Make it possible to specify which launchpadlib dir to use.

This is needed if multiple copies of lp2kanban is running,
since the launchpadlib cache tends to get corrupted after
a while, if multiple process are using the same cache.

To post a comment you must log in.
Revision history for this message
Brad Crittenden (bac) wrote :

Good idea. Thanks

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'examples/config.ini'
--- examples/config.ini 2013-04-04 09:20:18 +0000
+++ examples/config.ini 2013-04-05 14:30:03 +0000
@@ -8,6 +8,12 @@
8# Defaults are common values overridable in each of the boards definition.8# Defaults are common values overridable in each of the boards definition.
9[DEFAULT]9[DEFAULT]
10lp_server = production10lp_server = production
11
12# Which launchpadlib directory to use. Specify this if you have multiple
13# copies of lp2kanban with different configs running, since things will
14# eventually break if multiple processes use the same launchpadlib cache.
15#launchpadlib_dir = launchpadlib
16
11# Should all cards with external IDs be synced or not. Set to 'on' if17# Should all cards with external IDs be synced or not. Set to 'on' if
12# you want them synced automatically (and use "(no-sync)" as the marker18# you want them synced automatically (and use "(no-sync)" as the marker
13# for cards you don't want synced).19# for cards you don't want synced).
1420
=== modified file 'src/lp2kanban/bugs2cards.py'
--- src/lp2kanban/bugs2cards.py 2013-04-04 09:20:18 +0000
+++ src/lp2kanban/bugs2cards.py 2013-04-05 14:30:03 +0000
@@ -400,14 +400,17 @@
400 is used.400 is used.
401 """401 """
402 credentials_file = config.get('credentials_file')402 credentials_file = config.get('credentials_file')
403 launchpadlib_dir = config.get('launchpadlib_dir')
403 if credentials_file and os.path.exists(credentials_file):404 if credentials_file and os.path.exists(credentials_file):
404 lp = Launchpad.login_with(405 lp = Launchpad.login_with(
405 'lp2kanban', config['lp_server'], version="devel",406 'lp2kanban', config['lp_server'], version="devel",
406 credentials_file=credentials_file)407 credentials_file=credentials_file,
408 launchpadlib_dir=launchpadlib_dir)
407 print " Logged in as", lp.me.name409 print " Logged in as", lp.me.name
408 else:410 else:
409 lp = Launchpad.login_anonymously(411 lp = Launchpad.login_anonymously(
410 'lp2kanban', config['lp_server'], version="devel")412 'lp2kanban', config['lp_server'], version="devel",
413 launchapdlib_dir=launchpadlib_dir)
411 print (" Accessing Launchpad anonymously. "414 print (" Accessing Launchpad anonymously. "
412 "Private bugs will not be synced.")415 "Private bugs will not be synced.")
413 return lp416 return lp

Subscribers

People subscribed via source and target branches