Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Set" block not supported #42

Open
raulperula opened this issue Aug 4, 2017 · 4 comments
Open

"Set" block not supported #42

raulperula opened this issue Aug 4, 2017 · 4 comments

Comments

@raulperula
Copy link
Contributor

Hi,

I am trying to set the value of a variable but Kurt is throwing an exception telling that this kind of block is not supported in Scratch 2.0.

This is the code:

selection_001

And this is the exception:

Traceback (most recent call last):
  File "scratch2python.py", line 105, in <module>
    p = kurt.Project.load(open_path + sys.argv[1])
  File "/home/raul/workspace/gsoc2017/kurt/kurt/__init__.py", line 282, in load
    project.convert(plugin)
  File "/home/raul/workspace/gsoc2017/kurt/kurt/__init__.py", line 344, in convert
    return list(self._normalize())
  File "/home/raul/workspace/gsoc2017/kurt/kurt/__init__.py", line 517, in _normalize
    script.blocks = map(convert_block, script.blocks)
  File "/home/raul/workspace/gsoc2017/kurt/kurt/__init__.py", line 508, in convert_block
    arg = map(convert_block, arg)
  File "/home/raul/workspace/gsoc2017/kurt/kurt/__init__.py", line 489, in convert_block
    pbt = block.type.convert(self._plugin)
  File "/home/raul/workspace/gsoc2017/kurt/kurt/__init__.py", line 1665, in convert
    raise err
kurt.BlockNotSupported: Scratch 2.0 doesn't have <kurt.BlockType(u"set  to ''" shape='stack')>. Caused by: kurt.Block('setVar:to:', u'laser_data', 
    kurt.Block('Scratch2Robot/laser/frontal'),
)

The "set" blocks are valid in Scratch 2.0 (more info) but Kurt is not loading this kind of blocks for some reason.

@CosmicWebServices
Copy link

It may be the block in the set...

@tjvr
Copy link
Owner

tjvr commented Aug 4, 2017

It may be the block in the set...

This seems likely!

@raulperula
Copy link
Contributor Author

Do you have any idea where we could look for a solution in the code?

raulperula added a commit to raulperula/kurt that referenced this issue Aug 8, 2017
…and extra (extensions) commands for a better auto-generation of the file
@raulperula
Copy link
Contributor Author

I have solved the problem. It was due to the auto-generated "commands_src" that did not include that kind of blocks (I do not know exactly why).

I have implemented a solution separating the auto-generated file and the "extras" file that contains the extensions and the two commands related to variables.

Once you add the changes from the pull request I could do another with this solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants