Commit e04bff9d authored by Maxime Perrotin's avatar Maxime Perrotin

Merge branch 'master' of https://github.com/esa/opengeode

parents 7bd5c0c9 ca4b6567
......@@ -74,7 +74,12 @@ import traceback
import os
import stat
from itertools import chain, product
from singledispatch import singledispatch
try:
# python2
from singledispatch import singledispatch
except ModuleNotFoundError:
# python3
from functools import singledispatch
import ogAST
import Helper
......
......@@ -286,7 +286,7 @@ if __name__ == '__main__':
ast = parse_asn1('dataview-uniq.asn',
ast_version=ASN1.NoParameterizedTypes,
flags=[ASN1.AstOnly])
print ast.types.keys()
print(ast.types.keys())
sys.exit(0)
except TypeError as err:
print(str(err))
......
......@@ -15,7 +15,12 @@
import logging
import os
from singledispatch import singledispatch
try:
# python2
from singledispatch import singledispatch
except ModuleNotFoundError:
# python3
from functools import singledispatch
import Helper
import ogAST
......
......@@ -28,10 +28,15 @@
import operator
import logging
from itertools import chain, ifilterfalse
from itertools import chain
from collections import defaultdict
from singledispatch import singledispatch
try:
# python2
from singledispatch import singledispatch
except ModuleNotFoundError:
# python3
from functools import singledispatch
import ogAST
......@@ -50,15 +55,6 @@ def statenames(context, sep=u'\u00dc'):
if not s.endswith(u'START'))
#def non_composite_statenames(context, sep=u'\u00dc'):
# ''' Return a list of statenames excluding parents of state compositions '''
# composites = []
# for each in context.composite_states:
# if not isinstance(each, ofAST.StateAggregation):
#
# return ifilterfalse(lambda x: , statenames(context, sep))
def rec_findstates(context, prefix=''):
''' In case of state compositions/aggregations, find substates '''
for each in context.composite_states:
......
......@@ -252,7 +252,7 @@ class Lander(object):
self.animation.setDuration(abs(self.rocket.y()) * 500)
self.animation.start()
else:
print 'GAME OVER'
print('GAME OVER')
def quit_scene(self):
''' Redefinition of the quit_scene: Stop the game and the music '''
......
......@@ -19,7 +19,12 @@
import logging
from singledispatch import singledispatch
try:
# python2
from singledispatch import singledispatch
except ModuleNotFoundError:
# python3
from functools import singledispatch
from llvm import core as lc
from llvm import ee as le
......
......@@ -18,7 +18,12 @@
import logging
from collections import deque
from itertools import chain
from singledispatch import singledispatch
try:
# python2
from singledispatch import singledispatch
except ModuleNotFoundError:
# python3
from functools import singledispatch
import genericSymbols, sdlSymbols, Connectors
......
......@@ -22,8 +22,13 @@
import logging
from singledispatch import singledispatch
try:
# python2
from singledispatch import singledispatch
except ModuleNotFoundError:
# python3
from functools import singledispatch
import ogAST
import Helper
......
......@@ -295,7 +295,7 @@ class Symbol(QObject, QGraphicsPathItem, object):
def __str__(self):
''' Print the text inside the symbol '''
import traceback
print traceback.print_stack()
print (traceback.print_stack())
raise TypeError('Use unicode() not str()')
def __unicode__(self):
......
......@@ -124,7 +124,11 @@ class ExprLe(Expression):
class ExprDiv(Expression):
operand = '/'
op = operator.div
try:
op = operator.div
except AttributeError:
# for Python3:
op = operator.truediv
class ExprMod(Expression):
......
......@@ -1287,7 +1287,7 @@ def fix_expression_types(expr, context): # type: -> [warnings]
return warnings
if not expr.right.is_raw and not expr.left.is_raw:
unknown = [uk_expr for uk_expr in expr.right, expr.left
unknown = [uk_expr for uk_expr in (expr.right, expr.left)
if uk_expr.exprType == UNKNOWN_TYPE]
if unknown:
#print traceback.print_stack()
......@@ -3449,10 +3449,10 @@ def process_definition(root, parent=None, context=None):
process.processName = child.text
try:
# Retrieve process interface (PI/RI)
async, procedures, err = get_interfaces(parent, child.text)
process.input_signals.extend([sig for sig in async
asyncI, procedures, err = get_interfaces(parent, child.text)
process.input_signals.extend([sig for sig in asyncI
if sig['direction'] == 'in'])
process.output_signals.extend([sig for sig in async
process.output_signals.extend([sig for sig in asyncI
if sig['direction'] == 'out'])
process.procedures.extend(procedures)
perr.extend(err)
......@@ -5341,4 +5341,4 @@ def parser_init(filename=None, string=None):
if __name__ == '__main__':
print 'This module is not callable'
print ('This module is not callable')
......@@ -2727,7 +2727,7 @@ class OG_MainWindow(QtGui.QMainWindow, object):
item_types = self.datadict.topLevelItem(0)
item_types.takeChildren() # remove old children
for name, sort in sorted(ast.dataview.viewitems(),
key=lambda (name, sort): name):
key=lambda name, sort: name):
new_item = QtGui.QTreeWidgetItem(item_types,
[name.replace('-', '_'),
'view'])
......
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