roijac wrote:
blob8108 wrote:
roijac wrote:
@blob, in the kurt manual you say sprite attributes aren't saved, maybe you should add x&y attrs to the kurt.Sprite object and redefine bounds on save, because this method worked for me
"Kurt manual"? Where do I say that?!
https://github.com/blob8108/kurt#notes--restrictions
Ah, I was referring specifically to the decompiler... If you're just manipulating Scratch files as Python objects, like kurt.Sprite, it saves everything exactly as it was loaded.
I'll look at adding x/y/width/height, though — might be a good idea.
Offline
roijac wrote:
http://i.imgur.com/8QHPX.png
.sb saving FTW?
Looks cool
Offline
roijac wrote:
http://i.imgur.com/8QHPX.png
.sb saving FTW?
If anything, I know what operating system you use. xD
Pretty awesome! Also, is M30W going to use the same syntax as the forum blocks? That will simplify the learning process for me.
Offline
roijac wrote:
i said ill do it until thursday
Do you mean by Thursday?
Magnie wrote:
Also, is M30W going to use the same syntax as the forum blocks? That will simplify the learning process for me.
I assume so. That's the format Kurt's compiler uses, and roijac was asking me about some forum-block-parsing-related functions...
Offline
Bug:
* File -> Open: choose Kurt's provided "game.sb"
* File -> Save: save anywhere
Traceback (most recent call last): File "/Users/tim/Code/m30w/trunk/core/GUI/menu.py", line 67, in OnSave save(dialog.GetPath()) File "/Users/tim/Code/m30w/trunk/core/save.py", line 37, in save return _kurt_save(fp) File "/Users/tim/Code/m30w/trunk/core/save.py", line 15, in _kurt_save file.save() File "/Library/Python/2.7/site-packages/kurt-1.4.4-py2.7.egg/kurt/files.py", line 95, in save bytes = self._save() File "/Library/Python/2.7/site-packages/kurt-1.4.4-py2.7.egg/kurt/files.py", line 171, in _save self.stage.normalize() File "/Library/Python/2.7/site-packages/kurt-1.4.4-py2.7.egg/kurt/user_objects.py", line 493, in normalize sprite.normalize() File "/Library/Python/2.7/site-packages/kurt-1.4.4-py2.7.egg/kurt/user_objects.py", line 406, in normalize ScriptableScratchMorph.normalize(self) File "/Library/Python/2.7/site-packages/kurt-1.4.4-py2.7.egg/kurt/user_objects.py", line 332, in normalize raise ValueError("%r does not have a costume" % self) ValueError: <Sprite(ScratchCat)> does not have a costume
I'm using OS X, as you probably know by now (or can guess from the file paths in the traceback).
I'm assuming this isn't a bug in kurt, as it *is* supposed to throw errors when you save ScriptableScratchMorphs without costumes. I still think using Kurt classes as your data model would be much easier — you could even package Kurt along with M30W! (:
Last edited by blob8108 (2012-10-24 13:34:25)
Offline
I also noticed that none of the icons seem to work, and double-clicking a sprite opens a new tab even if a tab for that sprite already exists...
Offline
blob8108 wrote:
Bug:
* File -> Open: choose Kurt's provided "game.sb"
* File -> Save: save anywhereCode:
Traceback (most recent call last): File "/Users/tim/Code/m30w/trunk/core/GUI/menu.py", line 67, in OnSave save(dialog.GetPath()) File "/Users/tim/Code/m30w/trunk/core/save.py", line 37, in save return _kurt_save(fp) File "/Users/tim/Code/m30w/trunk/core/save.py", line 15, in _kurt_save file.save() File "/Library/Python/2.7/site-packages/kurt-1.4.4-py2.7.egg/kurt/files.py", line 95, in save bytes = self._save() File "/Library/Python/2.7/site-packages/kurt-1.4.4-py2.7.egg/kurt/files.py", line 171, in _save self.stage.normalize() File "/Library/Python/2.7/site-packages/kurt-1.4.4-py2.7.egg/kurt/user_objects.py", line 493, in normalize sprite.normalize() File "/Library/Python/2.7/site-packages/kurt-1.4.4-py2.7.egg/kurt/user_objects.py", line 406, in normalize ScriptableScratchMorph.normalize(self) File "/Library/Python/2.7/site-packages/kurt-1.4.4-py2.7.egg/kurt/user_objects.py", line 332, in normalize raise ValueError("%r does not have a costume" % self) ValueError: <Sprite(ScratchCat)> does not have a costumeI'm using OS X, as you probably know by now (or can guess from the file paths in the traceback).
I'm assuming this isn't a bug in kurt, as it *is* supposed to throw errors when you save ScriptableScratchMorphs without costumes. I still think using Kurt classes as your data model would be much easier — you could even package Kurt along with M30W! (:
I don't know any Python, but I belive that roijac made an error with sprite.normalize()?
Offline
DigiTechs wrote:
I don't know any Python, but I belive that roijac made an error with sprite.normalize()?
Nah, he just hasn't set sprite costumes properly when saving, I think
Offline
blob8108 wrote:
DigiTechs wrote:
I don't know any Python, but I belive that roijac made an error with sprite.normalize()?
Nah, he just hasn't set sprite costumes properly when saving, I think
I normally code in Lua, which thankfully due to it's very flexable syntax helps me code. Also, if I get errors in Lua, I normally put the area in a ypcall (yield enabled protected call), which basically if it errors, it catches the error and doesn't break the script and allows yielding (basically just allows the script to wait a time in the ypcall) Lua usually shows me where, unless I missed an end or added too many end's. (<eof> error :C). It's a pitty that other programming languages such as Python don't have this..
Offline
DigiTechs wrote:
blob8108 wrote:
DigiTechs wrote:
I don't know any Python, but I belive that roijac made an error with sprite.normalize()?
Nah, he just hasn't set sprite costumes properly when saving, I think
I normally code in Lua, which thankfully due to it's very flexable syntax helps me code. Also, if I get errors in Lua, I normally put the area in a ypcall (yield enabled protected call), which basically if it errors, it catches the error and doesn't break the script and allows yielding (basically just allows the script to wait a time in the ypcall) Lua usually shows me where, unless I missed an end or added too many end's. (<eof> error :C). It's a pitty that other programming languages such as Python don't have this..
But it does tell you where the error is! See, right here:
ValueError: <Sprite(ScratchCat)> does not have a costume
Offline
blob8108 wrote:
DigiTechs wrote:
blob8108 wrote:
Nah, he just hasn't set sprite costumes properly when saving, I thinkI normally code in Lua, which thankfully due to it's very flexable syntax helps me code. Also, if I get errors in Lua, I normally put the area in a ypcall (yield enabled protected call), which basically if it errors, it catches the error and doesn't break the script and allows yielding (basically just allows the script to wait a time in the ypcall) Lua usually shows me where, unless I missed an end or added too many end's. (<eof> error :C). It's a pitty that other programming languages such as Python don't have this..
But it does tell you where the error is! See, right here:
Code:
ValueError: <Sprite(ScratchCat)> does not have a costume
I know, but I read it top down, so I belived that Python was just reading out errors that he had made in the code - that's why I said he got somthing wrong with sprite.normalise(), as that is how Lua shows it's errors.
Offline
That was like the dumbest error ever - I forgot to call the parent's method
Anyway, @blob8108, english is not everyone's first language, and I will continue to use my own classes
@DigTech, I didn't really understand how raising errors in lua really works, but the current error was in a function that malfunctioned ( ) and wasn't setting the sprite's costumes to it.
Offline
Error when saving (via Ctrl+S):
Traceback (most recent call last): File "/home/magnie/Documents/Repos/svn/m30w-svn/core/GUI/menu.py", line 67, in OnSave save(dialog.GetPath()) File "/home/magnie/Documents/Repos/svn/m30w-svn/core/save.py", line 37, in save return _kurt_save(fp) File "/home/magnie/Documents/Repos/svn/m30w-svn/core/save.py", line 13, in _kurt_save file.stage.sprites[:] = [sprite.to_kurt() for sprite in sprites.sprites[1:]] File "/home/magnie/Documents/Repos/svn/m30w-svn/core/sprites/sprite.py", line 62, in to_kurt self.set_kurt_attrs(morph) File "/home/magnie/Documents/Repos/svn/m30w-svn/core/sprites/base.py", line 58, in set_kurt_attrs sheet = kurt.parse_block_plugin(sheet) AttributeError: 'module' object has no attribute 'parse_block_plugin'
Out of curiosity, where did the menu strip thing go?
Offline
Magnie wrote:
Error when saving (via Ctrl+S):
Code:
Traceback (most recent call last): File "/home/magnie/Documents/Repos/svn/m30w-svn/core/GUI/menu.py", line 67, in OnSave save(dialog.GetPath()) File "/home/magnie/Documents/Repos/svn/m30w-svn/core/save.py", line 37, in save return _kurt_save(fp) File "/home/magnie/Documents/Repos/svn/m30w-svn/core/save.py", line 13, in _kurt_save file.stage.sprites[:] = [sprite.to_kurt() for sprite in sprites.sprites[1:]] File "/home/magnie/Documents/Repos/svn/m30w-svn/core/sprites/sprite.py", line 62, in to_kurt self.set_kurt_attrs(morph) File "/home/magnie/Documents/Repos/svn/m30w-svn/core/sprites/base.py", line 58, in set_kurt_attrs sheet = kurt.parse_block_plugin(sheet) AttributeError: 'module' object has no attribute 'parse_block_plugin'Out of curiosity, where did the menu strip thing go?
just install PLY and put it on path
menu strip thing?
Offline
roijac wrote:
Magnie wrote:
Error when saving (via Ctrl+S):
Code:
Traceback (most recent call last): File "/home/magnie/Documents/Repos/svn/m30w-svn/core/GUI/menu.py", line 67, in OnSave save(dialog.GetPath()) File "/home/magnie/Documents/Repos/svn/m30w-svn/core/save.py", line 37, in save return _kurt_save(fp) File "/home/magnie/Documents/Repos/svn/m30w-svn/core/save.py", line 13, in _kurt_save file.stage.sprites[:] = [sprite.to_kurt() for sprite in sprites.sprites[1:]] File "/home/magnie/Documents/Repos/svn/m30w-svn/core/sprites/sprite.py", line 62, in to_kurt self.set_kurt_attrs(morph) File "/home/magnie/Documents/Repos/svn/m30w-svn/core/sprites/base.py", line 58, in set_kurt_attrs sheet = kurt.parse_block_plugin(sheet) AttributeError: 'module' object has no attribute 'parse_block_plugin'Out of curiosity, where did the menu strip thing go?
just install PLY and put it on path
menu strip thing?
The File, Edit, Help menus.
Offline
Magnie wrote:
roijac wrote:
Magnie wrote:
Error when saving (via Ctrl+S):
Code:
Traceback (most recent call last): File "/home/magnie/Documents/Repos/svn/m30w-svn/core/GUI/menu.py", line 67, in OnSave save(dialog.GetPath()) File "/home/magnie/Documents/Repos/svn/m30w-svn/core/save.py", line 37, in save return _kurt_save(fp) File "/home/magnie/Documents/Repos/svn/m30w-svn/core/save.py", line 13, in _kurt_save file.stage.sprites[:] = [sprite.to_kurt() for sprite in sprites.sprites[1:]] File "/home/magnie/Documents/Repos/svn/m30w-svn/core/sprites/sprite.py", line 62, in to_kurt self.set_kurt_attrs(morph) File "/home/magnie/Documents/Repos/svn/m30w-svn/core/sprites/base.py", line 58, in set_kurt_attrs sheet = kurt.parse_block_plugin(sheet) AttributeError: 'module' object has no attribute 'parse_block_plugin'Out of curiosity, where did the menu strip thing go?
just install PLY and put it on path
menu strip thing?The File, Edit, Help menus.
You don't have your menus?
what UI do you use? unity?
Offline
roijac wrote:
Magnie wrote:
roijac wrote:
just install PLY and put it on path
menu strip thing?The File, Edit, Help menus.
You don't have your menus?
what UI do you use? unity?
I use a custom one I made. All the menus should be at the top of the program. I'm guessing...
Offline
Magnie wrote:
roijac wrote:
You don't have your menus?
what UI do you use? unity?I use a custom one I made. All the menus should be at the top of the program. I'm guessing...
I see the menus on OS X. If you're using a custom UI, could it be your code...?
Offline
Magnie wrote:
roijac wrote:
Magnie wrote:
The File, Edit, Help menus.
You don't have your menus?
what UI do you use? unity?I use a custom one I made. All the menus should be at the top of the program. I'm guessing...
http://i1147.photobucket.com/albums/o54 … 081948.png
how self-implemented is this code? you didn't write a whole windows manager yourself, I guess?
where are the menus normally?
@blob8108, ALL icons weren't working, or just the custom ones? at least the wx ones should work, otherwise it's not MY job to fix it
Last edited by roijac (2012-10-25 12:36:05)
Offline
roijac wrote:
@blob8108, ALL icons weren't working, or just the custom ones? at least the wx ones should work, otherwise it's not MY job to fix it
The icons at the bottom of the window: new, open, etc. They either don't work (not implemented) or crash in strange ways...
Last edited by blob8108 (2012-10-25 13:22:52)
Offline
blob8108 wrote:
roijac wrote:
@blob8108, ALL icons weren't working, or just the custom ones? at least the wx ones should work, otherwise it's not MY job to fix it
The icons at the bottom of the window: new, open, etc. They either don't work (not implemented) or crash in strange ways...
the icons that don't work aren't implemented, I guess that's clear, but what are the crashing?
Offline
Image editor:
Error in sys.excepthook: Traceback (most recent call last): File "/Users/tim/Code/m30w/trunk/core/GUI/main.py", line 49, in excepthook traceback.format_exception(type, obj, tb) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/traceback.py", line 141, in format_exception list = list + format_tb(tb, limit) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/traceback.py", line 76, in format_tb return format_list(extract_tb(tb, limit)) RuntimeError: maximum recursion depth exceeded Original exception was: Traceback (most recent call last): File "/Users/tim/Code/m30w/trunk/core/GUI/leftPanel.py", line 172, in OnPaint size = [i - 20 for i in self.GetSize()] # 10px padding TypeError: 'PySwigObject' object is not iterable Error in sys.excepthook: Traceback (most recent call last): File "/Users/tim/Code/m30w/trunk/core/GUI/main.py", line 49, in excepthook traceback.format_exception(type, obj, tb) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/traceback.py", line 141, in format_exception list = list + format_tb(tb, limit) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/traceback.py", line 76, in format_tb return format_list(extract_tb(tb, limit)) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/traceback.py", line 101, in extract_tb line = linecache.getline(filename, lineno, f.f_globals) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/linecache.py", line 14, in getline lines = getlines(filename, module_globals) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/linecache.py", line 40, in getlines return updatecache(filename, module_globals) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/linecache.py", line 127, in updatecache with open(fullname, 'rU') as fp: RuntimeError: maximum recursion depth exceeded Original exception was: Traceback (most recent call last): File "/Users/tim/Code/m30w/trunk/core/GUI/leftPanel.py", line 191, in OnPaint costume.FORMAT_BITMAP), File "/Users/tim/Code/m30w/trunk/core/costume.py", line 172, in get_resized_image resample=Image.ANTIALIAS), File "/Library/Python/2.7/site-packages/PIL/Image.py", line 1304, in resize return self._new(im) File "/Library/Python/2.7/site-packages/PIL/Image.py", line 461, in _new new = Image() RuntimeError: maximum recursion depth exceeded while calling a Python object Exception RuntimeError: 'maximum recursion depth exceeded' in ignored Error in sys.excepthook: Traceback (most recent call last): File "/Users/tim/Code/m30w/trunk/core/GUI/main.py", line 49, in excepthook traceback.format_exception(type, obj, tb) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/traceback.py", line 141, in format_exception list = list + format_tb(tb, limit) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/traceback.py", line 76, in format_tb return format_list(extract_tb(tb, limit)) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/traceback.py", line 100, in extract_tb linecache.checkcache(filename) RuntimeError: maximum recursion depth exceeded Original exception was: Traceback (most recent call last): File "/Users/tim/Code/m30w/trunk/core/GUI/leftPanel.py", line 172, in OnPaint size = [i - 20 for i in self.GetSize()] # 10px padding RuntimeError: maximum recursion depth exceeded Error in sys.excepthook: Traceback (most recent call last): File "/Users/tim/Code/m30w/trunk/core/GUI/main.py", line 49, in excepthook traceback.format_exception(type, obj, tb) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/traceback.py", line 141, in format_exception list = list + format_tb(tb, limit) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/traceback.py", line 76, in format_tb return format_list(extract_tb(tb, limit)) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/traceback.py", line 101, in extract_tb line = linecache.getline(filename, lineno, f.f_globals) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/linecache.py", line 14, in getline lines = getlines(filename, module_globals) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/linecache.py", line 40, in getlines return updatecache(filename, module_globals) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/linecache.py", line 128, in updatecache lines = fp.readlines() RuntimeError: maximum recursion depth exceeded while calling a Python object Original exception was: Traceback (most recent call last): File "/Users/tim/Code/m30w/trunk/core/GUI/leftPanel.py", line 191, in OnPaint costume.FORMAT_BITMAP), File "/Users/tim/Code/m30w/trunk/core/costume.py", line 172, in get_resized_image resample=Image.ANTIALIAS), File "/Library/Python/2.7/site-packages/PIL/Image.py", line 1304, in resize return self._new(im) File "/Library/Python/2.7/site-packages/PIL/Image.py", line 461, in _new new = Image() RuntimeError: maximum recursion depth exceeded
New:
Traceback (most recent call last): File "/Users/tim/Code/m30w/trunk/core/GUI/spritePanel.py", line 220, in OnNew sprites.new() File "/Users/tim/Code/m30w/trunk/core/sprites/__init__.py", line 24, in new add(Sprite('new_sprite %s' % i)) File "/Users/tim/Code/m30w/trunk/core/sprites/__init__.py", line 17, in add runtime.spritePanel.UpdateList(len(sprites)) File "/Users/tim/Code/m30w/trunk/core/GUI/spritePanel.py", line 198, in UpdateList self.listBook.SetSelection(select) File "/usr/local/lib/wxPython-unicode-2.8.12.1/lib/python2.7/site-packages/wx-2.8-mac-unicode/wx/_controls.py", line 3006, in SetSelection return _controls_.BookCtrlBase_SetSelection(*args, **kwargs) wx._core.PyAssertionError: C++ assertion "n < GetPageCount()" failed at /BUILD/wxPython-src-2.8.12.1/src/common/bookctrl.cpp(452) in DoSetSelection(): invalid page index in wxBookCtrlBase::DoSetSelection()
Last edited by blob8108 (2012-10-25 14:09:25)
Offline