浏览代码

Applied pep8 recommendations on all source files.

Sander Mathijs van Veen 14 年之前
父节点
当前提交
7f237bf19d
共有 4 个文件被更改,包括 3 次插入4 次删除
  1. 2 1
      main.py
  2. 0 1
      src/node.py
  3. 1 1
      tests/test_calc.py
  4. 0 1
      tests/test_rules_poly.py

+ 2 - 1
main.py

@@ -1,5 +1,6 @@
 #!/usr/bin/python
 
+
 def init_readline():
     import os
     try:
@@ -17,8 +18,8 @@ def init_readline():
     import atexit
     atexit.register(readline.write_history_file, histfile)
 
-from src.parser import main
 
 if __name__ == '__main__':
+    from src.parser import main
     init_readline()
     main()

+ 0 - 1
src/node.py

@@ -91,7 +91,6 @@ class ExpressionBase(object):
 
         return s_root < o_root or s_exp < o_exp or s_coeff < o_coeff
 
-
     def is_leaf(self):
         return self.type != TYPE_OPERATOR
 

+ 1 - 1
tests/test_calc.py

@@ -55,7 +55,7 @@ class TestCalc(unittest.TestCase):
                                            L('c')), L('d'))),
                        ('ab(c)d', N('*', N('*', N('*', L('a'), L('b')),
                                            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'))),
                        ('ab*(c)^d', N('*', N('*', L('a'), L('b')),
                                            N('^', L('c'), L('d')))),

+ 0 - 1
tests/test_rules_poly.py

@@ -65,7 +65,6 @@ class TestRulesPoly(unittest.TestCase):
                 [P(root, combine_polynomes, ((a1, (l1, a1[0], l2)),
                                              (a2, (l1, a2[0], l2))))])
 
-
     def test_basic_subexpressions(self):
         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')