Merge lp://qastaging/~mars/tarmac/add-branch-config-get into lp://qastaging/tarmac
Proposed by
Māris Fogels
Status: | Merged |
---|---|
Approved by: | Paul Hummer |
Approved revision: | 384 |
Merged at revision: | 384 |
Proposed branch: | lp://qastaging/~mars/tarmac/add-branch-config-get |
Merge into: | lp://qastaging/tarmac |
Diff against target: |
42 lines (+27/-0) 2 files modified
tarmac/config.py (+7/-0) tarmac/tests/test_config.py (+20/-0) |
To merge this branch: | bzr merge lp://qastaging/~mars/tarmac/add-branch-config-get |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Paul Hummer | Approve | ||
Review via email:
|
Commit message
Add get method to BranchConfig object
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
To post a comment you must log in.