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
1=== modified file 'examples/config.ini'
2--- examples/config.ini 2013-04-04 09:20:18 +0000
3+++ examples/config.ini 2013-04-05 14:30:03 +0000
4@@ -8,6 +8,12 @@
5 # Defaults are common values overridable in each of the boards definition.
6 [DEFAULT]
7 lp_server = production
8+
9+# Which launchpadlib directory to use. Specify this if you have multiple
10+# copies of lp2kanban with different configs running, since things will
11+# eventually break if multiple processes use the same launchpadlib cache.
12+#launchpadlib_dir = launchpadlib
13+
14 # Should all cards with external IDs be synced or not. Set to 'on' if
15 # you want them synced automatically (and use "(no-sync)" as the marker
16 # for cards you don't want synced).
17
18=== modified file 'src/lp2kanban/bugs2cards.py'
19--- src/lp2kanban/bugs2cards.py 2013-04-04 09:20:18 +0000
20+++ src/lp2kanban/bugs2cards.py 2013-04-05 14:30:03 +0000
21@@ -400,14 +400,17 @@
22 is used.
23 """
24 credentials_file = config.get('credentials_file')
25+ launchpadlib_dir = config.get('launchpadlib_dir')
26 if credentials_file and os.path.exists(credentials_file):
27 lp = Launchpad.login_with(
28 'lp2kanban', config['lp_server'], version="devel",
29- credentials_file=credentials_file)
30+ credentials_file=credentials_file,
31+ launchpadlib_dir=launchpadlib_dir)
32 print " Logged in as", lp.me.name
33 else:
34 lp = Launchpad.login_anonymously(
35- 'lp2kanban', config['lp_server'], version="devel")
36+ 'lp2kanban', config['lp_server'], version="devel",
37+ launchapdlib_dir=launchpadlib_dir)
38 print (" Accessing Launchpad anonymously. "
39 "Private bugs will not be synced.")
40 return lp

Subscribers

People subscribed via source and target branches