Well, it seems to work now, anyhow
Pushed v1.4.2 to GitHub/PyPI.
Update using:
sudo pip install --upgrade kurt
Let me know if it works for you!
Offline
I also added a little GUI wrapper for the compiler, which you can try out using:
kurtgui.py
(Untested on Windows yet, just FYI)
Last edited by blob8108 (2012-09-30 07:52:48)
Offline
roijac wrote:
works great
Awesome!
how do you get x&y positions? something with bounds?
Yeah, I think so -- unless you can find another, more obvious field on BaseMorph. From memory, bounds is:
x, y, width, height
tkinter. bah.
Well, it does come with Python...
Offline
blob8108 wrote:
LiquidMetal wrote:
Any chance you could set up a PPA for this? It would make it much simpler for Ubuntu.
Honestly, Ubuntu already has the easiest install procedure:
sudo apt-get install python-pip python-imaging
sudo pip install kurt
...and you're done!
vs windows, which takes about six steps and involves editing environment variables...
So I probably won't make that, no. Thanks for suggesting it, though!
EDIT: I have made a GUI, though, so I've done half of what you asked! Could you please try it out, and let me know what you think? Thanks!
Will that for Ubuntu update it automatically? Or will I need to install it again? I don't have administrator privileges, so each time i need to get an administrator to do it. Also, I'll be able to run it without administrator privileges, right?
You need to make a windows NSIS installer that checks for each dependency and installs if not there (and you can't browse to it). You probably could make one that wouldn't require to many changes if you wanted to repackage it with a new version of kurt. (I use windows, mainly) P.S. I might attempt to do this for you but don't count on my being successful (this is not a binding promise)
I'll try to get it installed on Ubuntu Tuesday night or Wednesday, and I'll try it out then.
Last edited by LiquidMetal (2012-09-30 09:34:12)
Offline
LiquidMetal wrote:
blob8108 wrote:
LiquidMetal wrote:
Any chance you could set up a PPA for this? It would make it much simpler for Ubuntu.
Honestly, Ubuntu already has the easiest install procedure:
sudo apt-get install python-pip python-imaging
sudo pip install kurt
...and you're done!
vs windows, which takes about six steps and involves editing environment variables...
So I probably won't make that, no. Thanks for suggesting it, though!
EDIT: I have made a GUI, though, so I've done half of what you asked! Could you please try it out, and let me know what you think? Thanks!Will that for Ubuntu update it automatically? Or will I need to install it again?
You can update it by simply using:
sudo pip install --upgrade kurt
I don't have administrator privileges, so each time i need to get an administrator to do it. Also, I'll be able to run it without administrator privileges, right?
Yup!
You need to make a windows NSIS installer that checks for each dependency and installs if not there (and you can't browse to it). You probably could make one that wouldn't require to many changes if you wanted to repackage it with a new version of kurt. (I use windows, mainly) P.S. I might attempt to do this for you but don't count on my being successful
If you say so. The hard part is setting up pip so you can install Python packages. I'm not sure about the licenses for redistributing everything else (eg. the Python Imaging Library). I could perhaps make an installer that included kurt and setup the environment vars correctly; you'd still have to run Python/PIL installers yourself, I think. If you could make one, that'd be awesome!
I'll try to get it installed on Ubuntu Tuesday night or Wednesday, and I'll try it out then.
Let me know how it goes
Offline
blob8108 wrote:
how do you get x&y positions? something with bounds?
Yeah, I think so -- unless you can find another, more obvious field on BaseMorph. From memory, bounds is:
x, y, width, height
[removed by moderator]
the real solution is
x = (sprite.bounds.value[0] + sprite.costume.rotationCenter.value[0] - 240, y = (sprite.bounds.value[1] * -1) - sprite.costume.rotationCenter.value[1] + 180)
now THAT was long debugging
Last edited by Paddle2See (2012-10-02 20:48:35)
Offline
roijac wrote:
blob8108 wrote:
how do you get x&y positions? something with bounds?
Yeah, I think so -- unless you can find another, more obvious field on BaseMorph. From memory, bounds is:
x, y, width, height[removed by moderator]
the real solution isCode:
(sprite.bounds.value[0] + sprite.costume.rotationCenter.value[0] - 240, (sprite.bounds.value[1] * -1) - sprite.costume.rotationCenter.value[1] + 180)now THAT was long debugging
Oh! You wanted Scratch-style co-ordinates... that didn't even occur to me
I might add those as Kurt properties, if you don't mind
Last edited by Paddle2See (2012-10-02 20:48:48)
Offline
roijac wrote:
Code:
x = (sprite.bounds.value[0] + sprite.costume.rotationCenter.value[0] - 240, y = (sprite.bounds.value[1] * -1) - sprite.costume.rotationCenter.value[1] + 180)
Isn't that better written as:
(x, y, w, h) = sprite.bounds (rx, ry) = sprite.costume.rotationCenter x = x + rx - 240 y = 180 - y - ry
Offline
If a background or sprite has text in it, will kurt save that? It looks to me like it just saved the background as an image.
Offline
I suppose the installer(s) would be made with NSIS. It would need to...
Check for Python 2.6 or 2.7 in directory C:/Python26 or 27
If no python found,
give options to browse or
download and
install* python 2.7.
Save the path to the python directory in a variable ($String1?).
Check for setuptools in the default path (which is what? is it based on the python path?)
if not found, give option to
browse or
download and
install* the appropriate version**.
Save the path to the python directory in a variable ($String2?)
Add $String1 and $String2 to your PATH (Path to what?) (I don't really understand the instructions here, but however NSIS does it would be different anyway.)
Check for PIL.
If not found, give options to
browse or
download and
install* the appropriate version**.
run "easy_install kurt" in a shell and wait until done.
Trouble is, I don't really know how to do anything with NSIS.
* If the installers are simply downloaded and run including the option to change the default install location, then how will the NSIS installer know where it is put? Maybe it will know somehow, or maybe a files only install with as little user input as possible would be better?
** 32 bit, 64 bit options, or just go with 32? Or I make separate installers for that?
Last edited by LiquidMetal (2012-10-03 00:18:41)
Offline
LiquidMetal wrote:
I suppose the installer(s) would be made with NSIS. It would need to...
Check for Python 2.6 or 2.7 in directory C:/Python26 or 27
If no python found,
give options to browse or
download and
install* python 2.7.
Save the path to the python directory in a variable ($String1?).
Check for setuptools in the default path (which is what? is it based on the python path?)
if not found, give option to
browse or
download and
install* the appropriate version**.
Save the path to the python directory in a variable ($String2?)
Add $String1 and $String2 to your PATH (Path to what?) (I don't really understand the instructions here, but however NSIS does it would be different anyway.)
Check for PIL.
If not found, give options to
browse or
download and
install* the appropriate version**.
run "easy_install kurt" in a shell and wait until done.
Trouble is, I don't really know how to do anything with NSIS.
* If the installers are simply downloaded and run including the option to change the default install location, then how will the NSIS installer know where it is put? Maybe it will know somehow, or maybe a files only install with as little user input as possible would be better?
** 32 bit, 64 bit options, or just go with 32? Or I make separate installers for that?
best would be to just include the installers with it and run them if needed
Offline
LiquidMetal wrote:
If a background or sprite has text in it, will kurt save that? It looks to me like it just saved the background as an image.
Yeah, that's exactly what it does. What would you rather have it do?
Offline
roijac wrote:
best would be to just include the installers with it and run them if needed
That would be the easiest method, but is there a way to make one of those installers return the path that it installed in when done? Would it be problematic if any of the requirements were installed in a separate location by the included installer? Or after installation, maybe the program should check for the installation, and if not found, ask to browse/install again?
Can you explain the PATH thing?
blob8108 wrote:
LiquidMetal wrote:
If a background or sprite has text in it, will kurt save that? It looks to me like it just saved the background as an image.
Yeah, that's exactly what it does. What would you rather have it do?
If the sprite has text that can be edited from within Scratch, then kurt should save the position, font, and size of that text separately from the image. That way, the text could still be editable when it re-compiles the project.
Last edited by LiquidMetal (2012-10-03 08:36:36)
Offline
LiquidMetal wrote:
blob8108 wrote:
LiquidMetal wrote:
If a background or sprite has text in it, will kurt save that? It looks to me like it just saved the background as an image.
Yeah, that's exactly what it does. What would you rather have it do?
If the sprite has text that can be edited from within Scratch, then kurt should save the position, font, and size of that text separately from the image. That way, the text could still be editable when it re-compiles the project.
I thought about doing that. I decided that having the image with the text was more useful, as re-creating the exact font/size/position in an external editor can be quite difficult.
I might add an option to the decompiler to specify the behaviour you'd prefer. Ideally it'd do both: but that becomes quite hard to resolve. How can Kurt tell which one you've edited? And if you edit both, which one should it prefer? Hopefully you see the issue...
Last edited by blob8108 (2012-10-03 12:00:32)
Offline
If you save the background as an image, and the text in the sprite/background costume as a text file, then editing either would not effect the other.
Offline
LiquidMetal wrote:
If you save the background as an image, and the text in the sprite/background costume as a text file, then editing either would not effect the other.
Yes, of course. But the point is I want to have the existing behaviour at the same time, so it saves two copies of the image: one with and one without the text.
Offline
But that would just create extra problems, as you mentioned. The only good way to do that would be to manage it through an even more complex gui.
Offline
LiquidMetal wrote:
But that would just create extra problems, as you mentioned. The only good way to do that would be to manage it through an even more complex gui.
...this is why I chose to just use the images with text I'll add an option to the decompiler, I think.
Offline
Hey blob8108, when I try to install using option 2 I get "ImportError: No module named setuptools". Is it because I'm using cmd?
Offline
Are you using Windows? It's a little tricky... Try installing setuptools I can give more detailed instructions if you want!
Offline
blob8108 wrote:
Are you using Windows? It's a little tricky... Try installing setuptools I can give more detailed instructions if you want!
Wow *brainfart* I never had setuptools installed. XD I just installed it, I'll give it another go.
Offline
why do I get Containers on some vars when opening a project in kurt? I got Container({'length': 4, 'data': [106, 134, 95, 169]}) instead of 2841609834 and Container({'length': 5, 'data': [212, 248, 93, 150, 2]}) instead of 11112675540
maybe some precision number saving?
Offline