Commit 07edee91 authored by dbarbera's avatar dbarbera
Browse files

flake8 fixes

parent 4e95bdd8
...@@ -589,7 +589,6 @@ def _call_external_function(output): ...@@ -589,7 +589,6 @@ def _call_external_function(output):
def _task_assign(task): def _task_assign(task):
''' A list of assignments in a task symbol ''' ''' A list of assignments in a task symbol '''
code, local_decl = [], [] code, local_decl = [], []
ada_string = ''
if task.comment: if task.comment:
code.extend(traceability(task.comment)) code.extend(traceability(task.comment))
for expr in task.elems: for expr in task.elems:
...@@ -850,8 +849,6 @@ def _prim_substring(prim): ...@@ -850,8 +849,6 @@ def _prim_substring(prim):
stmts.extend(receiver_stms) stmts.extend(receiver_stms)
local_decl.extend(receiver_decl) local_decl.extend(receiver_decl)
receiver_ty_name = receiver.exprType.ReferencedTypeName.replace('-', '_')
r1_stmts, r1_string, r1_local = expression(prim.value[1]['substring'][0]) r1_stmts, r1_string, r1_local = expression(prim.value[1]['substring'][0])
r2_stmts, r2_string, r2_local = expression(prim.value[1]['substring'][1]) r2_stmts, r2_string, r2_local = expression(prim.value[1]['substring'][1])
...@@ -923,6 +920,7 @@ def _basic_operators(expr): ...@@ -923,6 +920,7 @@ def _basic_operators(expr):
local_decl.extend(right_local) local_decl.extend(right_local)
return code, unicode(ada_string), local_decl return code, unicode(ada_string), local_decl
@expression.register(ogAST.ExprAssign) @expression.register(ogAST.ExprAssign)
def _assign_expression(expr): def _assign_expression(expr):
''' Assignment: almost the same a basic operators, except for strings ''' ''' Assignment: almost the same a basic operators, except for strings '''
...@@ -949,6 +947,7 @@ def _assign_expression(expr): ...@@ -949,6 +947,7 @@ def _assign_expression(expr):
local_decl.extend(right_local) local_decl.extend(right_local)
return code, '', local_decl return code, '', local_decl
@expression.register(ogAST.ExprOr) @expression.register(ogAST.ExprOr)
@expression.register(ogAST.ExprAnd) @expression.register(ogAST.ExprAnd)
@expression.register(ogAST.ExprXor) @expression.register(ogAST.ExprXor)
...@@ -1598,7 +1597,6 @@ def string_payload(prim, ada_string): ...@@ -1598,7 +1597,6 @@ def string_payload(prim, ada_string):
prim_basic = find_basic_type(prim.exprType) prim_basic = find_basic_type(prim.exprType)
payload = '' payload = ''
if prim_basic.kind in ('SequenceOfType', 'OctetStringType'): if prim_basic.kind in ('SequenceOfType', 'OctetStringType'):
range_string = ''
if int(prim_basic.Min) != int(prim_basic.Max): if int(prim_basic.Min) != int(prim_basic.Max):
payload = u'.Data(1..{}.Length)'.format(ada_string) payload = u'.Data(1..{}.Length)'.format(ada_string)
else: else:
...@@ -1606,7 +1604,6 @@ def string_payload(prim, ada_string): ...@@ -1606,7 +1604,6 @@ def string_payload(prim, ada_string):
return payload return payload
def find_basic_type(a_type): def find_basic_type(a_type):
''' Return the ASN.1 basic type of a_type ''' ''' Return the ASN.1 basic type of a_type '''
basic_type = a_type basic_type = a_type
......
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