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
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
roijac wrote:
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...
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
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
Still can't open costumes viewer list thing
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:
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!
Offline
blob8108 wrote:
Still can't open costumes viewer list thing
Odd, I can. I've also got the same error as you as well.
I also have some errors, Ctrl+S results with this error, I'm assuming this is because I never originally saved with a name:
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:
(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
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)
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
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...
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()
Interesting, thumbnail() won't expand images to larger size (original image is 16x16)
Offline
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():
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
Offline
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
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
I have it installed, looks great!
Offline
roijac wrote:
linux/windows?
Windows. It works perfectly, I didn't find any bugs.
Offline
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)
Offline
How do you plan on dealing with script positions? Are you just going to leave them all overlapping at (20, 20)?
Offline
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
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)
Offline
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:
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
Offline