-
Notifications
You must be signed in to change notification settings - Fork 3
[IMP] Add data models and make API more Pythonic #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Imported but not used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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: