[zdict.py] code refactoring and test cases
It seams that there is some global vars. Could we avoid this? or is it a necessary evil?
And, i want to introduce this coding style: https://en.wikibooks.org/wiki/Computer_Programming/Coding_Style/Minimize_nesting Please comment
I will keep updating the working list here:
- reduce nesting
- [x]
main() - [x]
MetaInteractivePrompt
- [x]
- test case
- [x]
main()
- [x]
- Remove global vars
- [ ]
zdict.py
- [ ]
- Remove dependency of
args(avoid just passargsfromzdict.py)- [x]
DictBase.lookup
- [x]
I'm ok with this coding style.
I used global vars for args and dictionary_map because almost every function in zdict.py need these two vars.
If u don't want to use global, just pass these two vars as arguments to those functions which needed them.
I'm ok with that, I was too lazy to add these two arguments. lol
Thanks for comment.
I will work on removing the global vars.
@M157q global vars are really hard to remove.... The appear every where.. @wdv4758h suggests that we need to refactor the flow control of zdict.py

- [ ]
zdict/__main__.py - [ ]
zdict/dictionaries/moe.py - [ ]
zdict/dictionaries/spanish.py - [ ]
zdict/dictionaries/template.py- as a template for dictionaries unit testing
- [ ]
zdict/dictionaries/urban.py - [ ]
zdict/dictionaries/yahoo.py - [ ]
zdict/dictionary.py - [ ]
zdict/easter_eggs.py - [ ]
zdict/exceptions.py - [ ]
zdict/utils.py - [ ]
zdict/zdict.py
@iblis17 I'm thinking about just leaving this issue for refactoring only.
I'm going to create another issue for the unit-testings part.
So, you can make this issue turn into a PR base on issue-48 branch for code review.
What do you think?