Applied pep8 recommendations on all source files.

parent c3c37b5d
#!/usr/bin/python #!/usr/bin/python
def init_readline(): def init_readline():
import os import os
try: try:
...@@ -17,8 +18,8 @@ def init_readline(): ...@@ -17,8 +18,8 @@ def init_readline():
import atexit import atexit
atexit.register(readline.write_history_file, histfile) atexit.register(readline.write_history_file, histfile)
from src.parser import main
if __name__ == '__main__': if __name__ == '__main__':
from src.parser import main
init_readline() init_readline()
main() main()
...@@ -91,7 +91,6 @@ class ExpressionBase(object): ...@@ -91,7 +91,6 @@ class ExpressionBase(object):
return s_root < o_root or s_exp < o_exp or s_coeff < o_coeff return s_root < o_root or s_exp < o_exp or s_coeff < o_coeff
def is_leaf(self): def is_leaf(self):
return self.type != TYPE_OPERATOR return self.type != TYPE_OPERATOR
......
...@@ -55,7 +55,7 @@ class TestCalc(unittest.TestCase): ...@@ -55,7 +55,7 @@ class TestCalc(unittest.TestCase):
L('c')), L('d'))), L('c')), L('d'))),
('ab(c)d', N('*', N('*', N('*', L('a'), L('b')), ('ab(c)d', N('*', N('*', N('*', L('a'), L('b')),
L('c')), L('d'))), L('c')), L('d'))),
('ab*(c)*d', N('*', N('*', N('*', L('a'), L('b')), ('ab*(c)*d', N('*', N('*', N('*', L('a'), L('b')),
L('c')), L('d'))), L('c')), L('d'))),
('ab*(c)^d', N('*', N('*', L('a'), L('b')), ('ab*(c)^d', N('*', N('*', L('a'), L('b')),
N('^', L('c'), L('d')))), N('^', L('c'), L('d')))),
......
...@@ -65,7 +65,6 @@ class TestRulesPoly(unittest.TestCase): ...@@ -65,7 +65,6 @@ class TestRulesPoly(unittest.TestCase):
[P(root, combine_polynomes, ((a1, (l1, a1[0], l2)), [P(root, combine_polynomes, ((a1, (l1, a1[0], l2)),
(a2, (l1, a2[0], l2))))]) (a2, (l1, a2[0], l2))))])
def test_basic_subexpressions(self): def test_basic_subexpressions(self):
a_b, c, d, l1, l5, l7 = tree('a+b,c,d,1,5,7') a_b, c, d, l1, l5, l7 = tree('a+b,c,d,1,5,7')
left, right = root = tree('(a+b)^d + (a+b)^d') left, right = root = tree('(a+b)^d + (a+b)^d')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment