-
Notifications
You must be signed in to change notification settings - Fork 25
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
Added todict() method to Command #67
base: master
Are you sure you want to change the base?
Conversation
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.
Please make your PR compatible with PEP8.
sievelib/commands.py
Outdated
|
||
""" | ||
|
||
j=OrderedDict() |
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.
Could you respect PEP8 please?
sievelib/commands.py
Outdated
j=OrderedDict() | ||
comms=[] | ||
|
||
if isinstance(self,TestCommand): |
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.
Same here.
sievelib/commands.py
Outdated
if self.children: | ||
j.update({"children": []}) | ||
for child in self.children: | ||
#target.write(("*" * (indentlevel+10))+'{"'+argname+'": "'+str(arg)+'"},\n') |
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.
Can you remove this comment?
Codecov Report
@@ Coverage Diff @@
## master #67 +/- ##
==========================================
- Coverage 84.07% 81.94% -2.13%
==========================================
Files 10 10
Lines 1683 1734 +51
==========================================
+ Hits 1415 1421 +6
- Misses 268 313 +45
Continue to review full report at Codecov.
|
Modified and checked against http://pep8online.com/ |
Can you add some unit tests please? BTW, I think you should be interested by this method: https://github.com/tonioo/sievelib/blob/master/sievelib/commands.py#L269. |
I have no idea how to do it, sorry. |
But it would be a good idea, since I already discovered a bug :) |
I'm going to add an attribute name mapping layer that will change the keys of the arguments |
Adds a method to represent the sieve filters as dicts
usage example: