[Mumps2Py:] [9] lint removal |
[ Thread Index |
Date Index
| More lists.mumps2py.org/discuss Archives
]
Revision: 9
Author: pgallot
Date: 2008-01-17 18:07:47 +0000 (Thu, 17 Jan 2008)
Log Message:
-----------
lint removal
Modified Paths:
--------------
trunk/mumps2py/tok2python.py
Modified: trunk/mumps2py/tok2python.py
===================================================================
--- trunk/mumps2py/tok2python.py 2008-01-17 17:56:48 UTC (rev 8)
+++ trunk/mumps2py/tok2python.py 2008-01-17 18:07:47 UTC (rev 9)
@@ -98,7 +98,7 @@
translate_expr(translation, token.params[0]),
translate_expr_sub_one(translation, token.params[1]))
else:
- raise TranslationError(translation,token,
+ raise TranslationError(translation, token,
"incorrect number of parameters")
return extract_str
@@ -139,7 +139,7 @@
else:
left_str = translate_expr(translation, first_token)
while expr_list:
- not_str=""
+ not_str = ""
binop_token = expr_list.pop(0)
if binop_token.is_not():
not_str = "not "
@@ -150,8 +150,9 @@
right_str = trans_unary_expr(right_token, expr_list.pop(0))
else:
right_str = translate_expr(translation, right_token)
- left_str = "%s(%s %s %s)" % (not_str,left_str, trans_binary_op(binop_token),
- right_str)
+ left_str = "%s(%s %s %s)" % (not_str, left_str,
+ trans_binary_op(binop_token),
+ right_str)
return left_str
expr_transl_dict = {
@@ -171,14 +172,16 @@
"token type translation not implemented")
def translate_expr_plus_one(translation, token):
+ """ add one to the expression being translated """
if token.is_int():
- return str(int(token.val,10) + 1)
+ return str(int(token.val, 10) + 1)
else:
return translate_expr(translation,token) + "+1"
def translate_expr_sub_one(translation, token):
+ """ subtract one from the expression being translated """
if token.is_int():
- return str(int(token.val,10) - 1)
+ return str(int(token.val, 10) - 1)
else:
return translate_expr(translation,token) + "-1"