This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#126 2012-10-25 15:32:55

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: M30W New Official Topic

python doesn't like macs indeed O.O

the one below is an easy fix and I'll commit it tomorrow or so, but I have no idea how to either reproduce the ones above nor how to fix them  sad
the only thing I could understand is that python on mac has got something with imaginary nested objects or something like this. I'm using the libraries exactly how they should be used, and they just raise me RecursionErrors in return D:

Offline

 

#127 2012-10-25 17:59:18

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: M30W New Official Topic

roijac wrote:

Magnie wrote:

roijac wrote:


You don't have your menus?  yikes
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

sad

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  smile

I just stuffed different programs together into a bash script that starts when logging in with the Desktop Environment. Technically my DE shouldn't make a difference on how the menus show up.

The menus are normally at the top like where Firefox's menus are (and any other programs).

Offline

 

#128 2012-10-26 07:06:13

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: M30W New Official Topic

you should check another wxwidgets/wxpython programs, audacity, for example. anyway, ive no idea what i could do to fix it  hmm

Offline

 

#129 2012-11-11 14:31:49

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: M30W New Official Topic

made some big changes - anyone please test regressions!

Offline

 

#130 2012-11-11 17:24:41

blob8108
Scratcher
Registered: 2007-06-25
Posts: 1000+

Re: M30W New Official Topic

Still can't open costumes viewer list thing  tongue

http://i.imgur.com/xLvHg.png

Code:

Original exception was:
Traceback (most recent call last):
  File "/Users/tim/Code/m30w/trunk/core/GUI/leftPanel.py", line 190, in OnPaint
    costume.FORMAT_BITMAP),
  File "/Users/tim/Code/m30w/trunk/core/costume.py", line 173, 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

And you seem to create a new kurt.ScratchProjectFile object when saving, for some reason:

Code:

Traceback (most recent call last):
  File "/Users/tim/Code/m30w/trunk/core/GUI/menu.py", line 66, in OnSaveAs
    save_as(dialog.GetPath())
  File "/Users/tim/Code/m30w/trunk/core/IO.py", line 13, in save_as
    save()
  File "/Users/tim/Code/m30w/trunk/core/IO.py", line 7, in save
    runtime.project.save()
  File "/Users/tim/Code/m30w/trunk/core/project.py", line 88, in save
    self.to_kurt().save()
  File "/Users/tim/Code/m30w/trunk/core/project.py", line 54, in to_kurt
    morph = kurt.ScratchProjectFile(self.path)
  File "/Library/Python/2.7/site-packages/kurt-1.4.4-py2.7.egg/kurt/files.py", line 148, in __init__
    BinaryFile.__init__(self, *args, **kwargs)
  File "/Library/Python/2.7/site-packages/kurt-1.4.4-py2.7.egg/kurt/files.py", line 55, in __init__
    self.load()
  File "/Library/Python/2.7/site-packages/kurt-1.4.4-py2.7.egg/kurt/files.py", line 71, in load
    f = open(self.path, "rb")
IOError: [Errno 2] No such file or directory: u'/Users/tim/Downloads/pynxc/scratch_examples/tim2.sb'

If you're going to do that, you can pass load=False as an argument to ScratchProjectFile:

    morph = kurt.ScratchProjectFile(self.path, load=False)

This will create the File object without trying to load it — this way it won't touch the disk at all until you .save().

Hope that helps!  smile


Things I've made: kurt | scratchblocks2 | this cake

Offline

 

#131 2012-11-12 10:03:31

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: M30W New Official Topic

blob8108 wrote:

Still can't open costumes viewer list thing  tongue

Odd, I can. I've also got the same error as you as well.  hmm

I also have some errors, Ctrl+S results with this error, I'm assuming this is because I never originally saved with a name:

Code:

M30W encountered an error:
Traceback (most recent call last):

  File "/home/magnie/Documents/Repos/svn/m30w-svn/core/GUI/menu.py", line 56, in OnSave
    save()

  File "/home/magnie/Documents/Repos/svn/m30w-svn/core/IO.py", line 7, in save
    runtime.project.save()

  File "/home/magnie/Documents/Repos/svn/m30w-svn/core/project.py", line 81, in save
    if self.path.endswith('.sb2'):

AttributeError: 'NoneType' object has no attribute 'endswith'

Do You want to abort?

And a theme warning:

Code:

(python:28016): Gtk-WARNING **: Unable to locate theme engine in module_path: "oxygen-gtk",

Can someone post a screenshot of their menus of M30W?

Offline

 

#132 2012-11-12 11:54:26

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: M30W New Official Topic

k, fixed the saving/loading issues

@magnie, the warnings are warnings only, they're absolutely ok,
I don't know whats up with your menus. could you try audacity and SPE and tell me if they also are affected (both wx apps)

@blob, I don't know what's up with PIL, but it looks like it generates errors because it feels like. could you try and see if this code works? (put a .png in the folder)

Code:

from PIL import Image
img = Image.open('pic.png')
img.load()

new_img = img.resize((100, 300))
new_img.show()
img.thumbnail(150, 150)
img.show()

Last edited by roijac (2012-11-12 11:54:35)

Offline

 

#133 2012-11-12 14:20:09

blob8108
Scratcher
Registered: 2007-06-25
Posts: 1000+

Re: M30W New Official Topic

roijac wrote:

@blob, I don't know what's up with PIL, but it looks like it generates errors because it feels like. could you try and see if this code works? ...

Seems to work...

Code:

In [1]: from PIL import Image

In [2]: img = Image.open('img.png')

In [3]: img.load()
Out[3]: <PixelAccess at 0x10fe3bb10>

In [4]: new_img = img.resize((100, 300))

In [5]: new_img.show()

In [6]: img.thumbnail(150, 150)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-6-b9993c6cae64> in <module>()
----> 1 img.thumbnail(150, 150)

/Library/Python/2.7/site-packages/PIL/Image.pyc in thumbnail(self, size, resample)
   1548         # preserve aspect ratio
   1549         x, y = self.size
-> 1550         if x > size[0]: y = max(y * size[0] / x, 1); x = size[0]
   1551         if y > size[1]: x = max(x * size[1] / y, 1); y = size[1]
   1552         size = x, y

TypeError: 'int' object is not subscriptable

In [7]: img.thumbnail((150, 150))

In [8]: img.show()

In [9]: img.thumbnail((10, 10))

In [10]: img.show()

http://i.imgur.com/XUw8a.png

Interesting, thumbnail() won't expand images to larger size (original image is 16x16)


Things I've made: kurt | scratchblocks2 | this cake

Offline

 

#134 2012-11-12 15:35:54

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: M30W New Official Topic

weird  hmm
could you try to line by line debug it with pdb? put a pdb.settrace() somewhere in the get_resized_image or something?

Offline

 

#135 2012-11-12 16:11:33

blob8108
Scratcher
Registered: 2007-06-25
Posts: 1000+

Re: M30W New Official Topic

Nah, it seems to be throwing out "RuntimeError: maximum recursion depth exceeded while calling a Python object" errors all over the place. Even when I try to set_trace():

Code:

Original exception was:
Traceback (most recent call last):
  File "/Users/tim/Code/m30w/trunk/core/GUI/leftPanel.py", line 190, in OnPaint
    costume.FORMAT_BITMAP),
  File "/Users/tim/Code/m30w/trunk/core/costume.py", line 172, in get_resized_image
    import pdb; pdb.set_trace()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pdb.py", line 1251, in set_trace
    Pdb().set_trace(sys._getframe().f_back)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pdb.py", line 62, in __init__
    bdb.Bdb.__init__(self, skip=skip)
RuntimeError: maximum recursion depth exceeded while calling a Python object

Things I've made: kurt | scratchblocks2 | this cake

Offline

 

#136 2012-11-12 16:37:29

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: M30W New Official Topic

thats really not nice  hmm
cannot reproduce, you're all alone now O.O

Offline

 

#137 2012-11-12 23:08:45

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: M30W New Official Topic

Eh, I found a workaround it seems. The bug also seems to be known already: https://bugs.launchpad.net/ubuntu/+sour … bug/662077. That's quite annoying.

Offline

 

#138 2012-11-15 14:35:23

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: M30W New Official Topic

So, we're getting into first alpha release, so it'd be nice if anyone could test a bit in Windows and see if he finds any bugs.
If none are found, I'll start packaging.

Offline

 

#139 2012-11-15 19:19:18

bendad
Scratcher
Registered: 2008-06-14
Posts: 100+

Re: M30W New Official Topic

Greetings! It would be nice to add the M30W website
http://m30w.redpanda157.net
to the page.
Also, may I ask you add me to the list as website manager/admin?


Hi!  big_smile
Good to see you. (Even if I don't know you  wink  )

Offline

 

#140 2012-11-16 01:58:52

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: M30W New Official Topic

did you look at the forums in the last time? O.O
also, there isn't very much on the site, the main discussion is here, and you weren't active for a long time, so i thought id be better to just stay on SF and scratch.

Offline

 

#141 2012-11-16 02:47:48

Gravitation
New Scratcher
Registered: 2012-09-26
Posts: 500+

Re: M30W New Official Topic

I have it installed, looks great!

Offline

 

#142 2012-11-16 07:01:10

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: M30W New Official Topic

smile
linux/windows?

Last edited by roijac (2012-11-16 07:24:59)

Offline

 

#143 2012-11-16 08:39:08

Gravitation
New Scratcher
Registered: 2012-09-26
Posts: 500+

Re: M30W New Official Topic

roijac wrote:

smile
linux/windows?

Windows. It works perfectly, I didn't find any bugs.  smile

Offline

 

#144 2012-11-16 10:30:58

blob8108
Scratcher
Registered: 2007-06-25
Posts: 1000+

Re: M30W New Official Topic

I just spent about an hour trying to debug the mysterious paint editor crash on OS X.

After ripping out your sys.excepthook (it confuses the stack trace and doesn't print the output to the console, which is more useful — at least have both), playing with the sys.recursionlimit and generally poking the code furiously, I think I have the solution:

* remove the line self.ClearBackground() from ResourceViewer.OnPaint in core/GUI/leftPanel.py.

Explanation:

By playing with sys.recursionlimit, and printing every time the function ran, I convinced myself that the function was being called recursively. I then figured out that once you get the first error, wx subsequently cries every time you do anything — a bunch of assertions fail — raising more errors like

"wx._core.PyAssertionError: C++ assertion "cgContext" failed at /BUILD/wxPython-src-2.8.12.1/src/mac/carbon/window.cpp(2707) in MacPaintBorders()

You have to ignore all subsequent tracebacks and only look at the first one. I then determined by trial and error that self.ClearBackground() seems to be calling OnPaint() somehow, causing the infinite recursion.

Last edited by blob8108 (2012-11-16 15:57:14)


Things I've made: kurt | scratchblocks2 | this cake

Offline

 

#145 2012-11-16 15:57:35

blob8108
Scratcher
Registered: 2007-06-25
Posts: 1000+

Re: M30W New Official Topic

How do you plan on dealing with script positions? Are you just going to leave them all overlapping at (20, 20)?


Things I've made: kurt | scratchblocks2 | this cake

Offline

 

#146 2012-11-18 13:14:49

MrFlash67
Scratcher
Registered: 2012-08-08
Posts: 500+

Re: M30W New Official Topic

Could someone please give me detailed instructions to installing on a Mac?


Who would win, SOPA or PIPA?

Offline

 

#147 2012-11-18 13:53:52

Gravitation
New Scratcher
Registered: 2012-09-26
Posts: 500+

Re: M30W New Official Topic

MrFlash67 wrote:

Could someone please give me detailed instructions to installing on a Mac?

Well, I don't have a Mac (epic ihaveamac contradiction) but here are some general instructions:

Download Kurt by going here: https://github.com/blob8108/kurt/archive/master.zip
Extract the archive.
Open a command prompt (that's what it's called in Windows; it's the command line thing) and go to the location where you put the files from the archive. Run the following command:

python setup.py install

(You must have Python 2.7 installed for this. Get it at python.org)

You've installed Kurt! Congrats! Now for the other dependencies. You'll need wxPython (you can get it at http://www.wxpython.org/) and PIL (you can get it at http://www.pythonware.com/products/pil/). The installation is really easy; it's automatic.

Okay, now, you have all but 1 dependency. You have to get Subversion. Download it at http://subversion.apache.org/packages.html and choose a version. Any version will do as long as it's for your OS.

Now, for the actual downloading of the program; Create a folder where you would like to download M30W. Open a command prompt (again, command line) and go to the folder that you just created. Run this command:

svn checkout https://svn.code.sf.net/p/m30w/svn/

They'll ask for a username and password. Enter your Sourceforge login information. Have none? Open another tab, go to sourceforge.net, and register. Now enter your login info.

Wait for the download to finish. When it does, a folder called "svn" will be in the folder that you created earlier. Go into it. Keep going until you find M30W.py and run it. Enjoy!

This may not work as I don't have a Mac. Also, to go into a folder in the command line thing, use "cd foldername". Just replace foldername with the name of the folder. To go back, type "cd ..". This is how it works on Windows, anyway; not sure about Mac.

Offline

 

#148 2012-11-18 14:01:57

MrFlash67
Scratcher
Registered: 2012-08-08
Posts: 500+

Re: M30W New Official Topic

Gravitation wrote:

MrFlash67 wrote:

Could someone please give me detailed instructions to installing on a Mac?

WallOtext

Can't I just download it from http://m30w.gershmer.net/downloads.htm?

Last edited by MrFlash67 (2012-11-18 17:09:57)


Who would win, SOPA or PIPA?

Offline

 

#149 2012-11-18 14:14:17

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: M30W New Official Topic

I commited the fix and disabled GUI error catching with --debug flag, if you have problems with it you can use it.
About the scripts pos, it would be a nice feature to have something like this in Script:

Code:

class Script(object):
    ...
    @property
    def heigth(self):
        return sum([block.height for block in self.blocks])
...
class Block(object):
    ...
    @property
    def height(self):
        return BORDERS_HEIGHT + max([arg.height for arg in self.args if isinstance(arg, Block)] + [BLOCK_HEIGHT_WITHOUT_BORDERS])

What do you say?

@MrFlash67, I hope the instructions Gravitation gave are good enough. If you have problems, blob8108 managed to run M30W on a Mac already.
@Gravitation, thanks a lot for the guide, I linked to it from the 1st post  smile

Offline

 

#150 2012-11-18 14:17:48

MrFlash67
Scratcher
Registered: 2012-08-08
Posts: 500+

Re: M30W New Official Topic

Do I need to make an account on a random website just to download it? Couldn't you link it from Dropbox or something?


Who would win, SOPA or PIPA?

Offline

 

Board footer