[IMP] Add data models and make API more Pythonic#4
Conversation
701a944 to
3753138
Compare
Current coverage is 100% (diff: 100%)@@ master #4 diff @@
===================================
Files 2 13 +11
Lines 48 130 +82
Methods 0 0
Messages 0 0
Branches 2 5 +3
===================================
+ Hits 48 130 +82
Misses 0 0
Partials 0 0
|
18c1c0b to
d5f1823
Compare
d5f1823 to
bde6051
Compare
|
Rebased, this is ready for review |
7611c68 to
92471a6
Compare
tedsalmon
left a comment
There was a problem hiding this comment.
Overall, looks good to me! One minor issue and one suggestion in this review.
Thanks! 👍
cfssl/models/config_mixer.py
Outdated
There was a problem hiding this comment.
Man it'll be nice once I finish with our MQT so we get Lint on non-Odoo
cfssl/models/policy_use.py
Outdated
There was a problem hiding this comment.
I'm not sure if this is something you want to do, but you could remove a lot of code in this class and others by requiring these options to be sent in as keyword args.
class PolicyUse(object):
def __init__(self, *args, **kwargs):
self.__dict__.update(**kwargs)
a = PolicyUse(name='some_name', code='some_code')
print a.code
Output is:
some_code
There was a problem hiding this comment.
I went this direction because everything is explicitly required. The whole point of these classes is to provide a data structure for usage, getting lazy when creating that structure just moves us back into what we had.
92471a6 to
91033b1
Compare
|
Updated, squashed, merged |
This is a WIP refactoring and is also dependent on: