Merge lp:~mars/tarmac/add-branch-config-get into lp:~launchpad/tarmac/lp-tarmac
Status: | Merged |
---|---|
Approved by: | Māris Fogels |
Approved revision: | 384 |
Merged at revision: | 388 |
Proposed branch: | lp:~mars/tarmac/add-branch-config-get |
Merge into: | lp:~launchpad/tarmac/lp-tarmac |
Diff against target: |
125 lines (+65/-5) 4 files modified
tarmac/config.py (+7/-0) tarmac/plugins/allowedcontributors.py (+23/-3) tarmac/plugins/tests/test_allowedcontributors.py (+15/-2) tarmac/tests/test_config.py (+20/-0) |
To merge this branch: | bzr merge lp:~mars/tarmac/add-branch-config-get |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Māris Fogels (community) | Approve | ||
Review via email: mp+43856@code.launchpad.net |
Commit message
Adds a get() method to the BranchConfig object and fixes allowedcontribu
Description of the change
Hello,
This branch adds a get() method to the BranchConfig object. This makes tests for keys in a BranchConfig easier to write. You no longer have to mess around with hasattr() and conditional statements for optional BranchConfig keys (for example, to conditionally activate a plugin based on a branch config key's presence).
The implementation is currently a simple wrapper for getattr(). Later we may want to proxy a proper dict object, but that raises the problem of clashes between the dict method names and the config object key names. It is not something we need yet.
Thanks,
Maris
Self-approved for the Launchpad Tarmac trial and landing on the lp-tarmac fork.