@@ -443,6 +443,10 @@ def _create_catrobat_sprite_stub(name=None):
443
443
return catformula .Formula (traverser ._converted_helper_brick_or_formula_element ([formula_left_child , formula_right_child ], ">" ))
444
444
445
445
def _create_user_brick (context , scratch_function_header , param_values , declare = False ):
446
+ # TODO: remove the next line of code as soon as user bricks are supported by Catrobat
447
+ # TODO: also check the other TODOs related to this issue (overall three different places in converter.py)
448
+ # TODO: refactor this function; maybe split the function into definition of user brick script and usage of the brick
449
+ return catbricks .NoteBrick ("Sorry, we currently do not support user bricks in Catrobat!" )
446
450
param_labels = context .user_script_declared_labels_map [scratch_function_header ]
447
451
assert context is not None and isinstance (context , SpriteContext )
448
452
assert not param_labels or len (param_labels ) == len (param_values )
@@ -1071,6 +1075,10 @@ def _catrobat_sprite_from(self, scratch_object):
1071
1075
for scratch_script in scratch_object .scripts :
1072
1076
cat_instance = self ._catrobat_script_from (scratch_script , sprite , self ._catrobat_project ,
1073
1077
sprite_context )
1078
+ # TODO: remove this if and replace "elif" with "if" as soon as user bricks are supported by Catrobat
1079
+ # TODO: also check the other TODOs related to this issue (overall three different places in converter.py)
1080
+ if isinstance (cat_instance , catbricks .NoteBrick ):
1081
+ continue
1074
1082
if not isinstance (cat_instance , catbricks .UserBrick ):
1075
1083
assert isinstance (cat_instance , catbase .Script )
1076
1084
sprite .addScript (cat_instance )
@@ -1278,7 +1286,11 @@ def _catrobat_script_from(cls, scratch_script, sprite, catrobat_project, context
1278
1286
ignored_blocks += 1
1279
1287
continue
1280
1288
try :
1281
- if not isinstance (cat_instance , catbricks .UserBrick ):
1289
+ # TODO: remove this if and replace "elif" with "if" as soon as user bricks are supported by Catrobat
1290
+ # TODO: also check the other TODOs related to this issue (overall three different places in converter.py)
1291
+ if isinstance (cat_instance , catbricks .NoteBrick ):
1292
+ continue
1293
+ elif not isinstance (cat_instance , catbricks .UserBrick ):
1282
1294
assert isinstance (cat_instance , catbase .Script )
1283
1295
cat_instance .brickList .add (brick )
1284
1296
else :
0 commit comments