On OS X Mountain Lion.
* Installs Python from wxpython.org
* Runs M30W.py: "wxpython not found; download from wxpython.org"
...
Offline
blob8108 wrote:
On OS X Mountain Lion.
* Installs Python from wxpython.org
* Runs M30W.py: "wxpython not found; download from wxpython.org"
...
which wx version? (2.9 would be best)
sys.path? it could also be that wxversion isn't installed, post if it isn't, i'll fix it
Offline
Meh, doesn't work ._.
Darn, OS X really is a nightmare for dev stuff... Still, better than Windows!
Offline
It's something about 32-bit/64-bit Pythons.
Offline
Offline
@slinger, do you want to work on saving/loading? finish attributes/stage loading, save unparsed sound so you can save it afterwards, and of course implement saving?
i want to work on spritespanel and implement a listbook so we can show the attributes of the sprite.
what do you say?
Offline
I settled for reading through your code, for now
I note you don't load the stage atm. I see you're converting everything to your own classes, which is perfectly understandable, but may cause you some problems. Would it be easier if you could subclass Kurt's Sprite, Stage, Script classes directly, etc, and then configure Kurt to use your classes instead, somehow?
Compiling block plugin syntax is slightly awkward at the moment, because Scripts need to be attached to Sprite objects to make things like "point toward [Sprite2 v]" work. Kurt's compiler uses something like:
# `sprite`: a kurt.user_objects.Sprite # `project`: a kurt.files.ScratchProjectFile script = read_script_file(sprite, script_path) script.replace_sprite_refs(lookup_sprite_named = project.get_sprite) for var in script.find_undefined_variables(project.stage): print "variable not found:", var
The "lookup_sprite_named" argument is a function that takes a single "name" argument and returns a Sprite object.
My current plan is to make `parse_block_plugin` a method of the Sprite/Stage object itself. Then you can just do "sprite.parse_block_plugin(data, lookup_sprite_named)" and have it magically work. (I'll have to restructure the compiler, too.) I guess the undefined variables would stay as a method of the script object.
Separating the scripts by three newlines is an interesting idea — I thought about it for Kurt's decompiler. I might tweak the parser to start a new script when it meets a new event hat, or something like that.
Offline
slinger wrote:
But first can I finish my install script? :p
I didn't finish it exactly. I wouldn't mind a little help finishing it :p
Here is the code:
#!/usr/bin/python #This script sets up the external modules needed by M30W. #This script is like in pre-pre-alpha, don't expect much :p """This script will set up all the external modules needed by M30W. """ import platform import webbrowser import time def windows(): import win32api if os_bits == '32': webbrowser.open_new('''http://downloads.sourceforge.net/wxpython/wxPyth on2.8-win32-unicode-2.8.12.1-py27.exe''')#Doesn't work if I indent :c elif os_bits == '64': webbrowser.open_new('''http://downloads.sourceforge.net/wxpython/wxPyt hon2.8-win64-unicode-2.8.12.1-py27.exe''') print "Script will wait five seconds before next download starts." time.sleep(5) webbrowser.open_new('''http://effbot.org/downloads/PIL-1.1.7.win32-py2 .7.exe''') webbrowser.open_new('''https://raw.github.com/pypa/pip/master/contrib/ get-pip.py''') print 'Save the file as a .py file.' raw_input('Hit enter when done') #Not sure about if this next bit even uses the right code. win32api.ShellExecute(0, 'run', 'python.exe', 'Downloads/get-pip.py', '', 1) win32api.ShellExecute(0, 'run', 'pip.exe', 'pip install kurt', 1) print 'Setup complete, now run M30W!' def linux(): #Can't figure/find out how to give commands to the Linux console :C print 'Not yet working!' def mac(): webbrowser.open_new('''http://downloads.sourceforge.net/wxpython/wxPython2 .8-osx-unicode-2.8.12.1-universal-py2.7.dmg''') webbrowser.open_new('''http://effbot.org/downloads/Imaging-1.1.7.tar.gz''') print 'You will have to compile this yourself.' webbrowser.open_new('''https://raw.github.com/pypa/pip/master/contrib/ get-pip.py''') print 'Save the file as a .py file and run it!' #Same issue here as in the linux function. current_os = platform.system() os_bits = int(raw_input('How many bits is your operating system? ')) if current_os == 'Windows': windows() elif current_os == 'Linux': linux() elif current_os == 'Darwin': mac()
Also, am I following PEP8 when I do this?
#This is an example. if 1 == 1: webbrowser.open_new('''http://downloads.sourceforge.net/wxpython/wxPyt hon2.8-win64-unicode-2.8.12.1-py27.exe''') print '1 is equal to 1!'
If not how do I get around that?
Last edited by slinger (2012-09-20 10:05:44)
Offline
#This is an example. if 1 == 1: webbrowser.open_new('''http://downloads.sourceforge.net/wxpython/wxPyt hon2.8-win64-unicode-2.8.12.1-py27.exe''') print '1 is equal to 1!'
If not how do I get around that?
if 1 == 1: webbrowser.open_new("http://downloads.sourceforge.net/wxpython/wxPyt" "hon2.8-win64-unicode-2.8.12.1-py27.exe") print '1 is equal to 1!'
is a way, but i would do the whole a bit different; why not just commit it so we can both work on it?
btw, this is nice
Offline
Yeah, can't you have the script download the right things (or bundle the files along with the installer) and have it install them for you, rather than getting you to download them all?
Offline
I'm having trouble committing to sourceforge (yes, I know how to use SVN ). I kinda remember having this problem before, anyone want to refresh my memory on how to do such a thing?
@blob8108 I believe that's what my script is supposed to do when it's finished.
(Download and install all needed modules that is.)
Last edited by slinger (2012-09-20 14:38:48)
Offline
slinger wrote:
@blob8108 I believe that's what my script is supposed to do when it's finished.
(Download and install all needed modules that is.)
If you're just trying to download a file, urllib's a much better way of doing it, rather than using the user's browser.
Offline
slinger wrote:
@blob8107, Thanks!
Him being my evil younger sibling...
Offline
MathWizz wrote:
blob8108 wrote:
slinger wrote:
@blob8107, Thanks!
Him being my evil younger sibling...
Does that mean...you're siblings?
Who, me and blob8107?
Offline
This seems really cool! When will it be downloadable yet?
Offline
blob8108 wrote:
slinger wrote:
@blob8107, Thanks!
Him being my evil younger sibling...
Oh lol, my bad
@NeilWest, I believe you can check out the svn branch by typing this in the terminal (if you ave Subversion that is )
svn co svn://svn.code.sf.net/p/m30w/svn/trunk m30w-svn
Offline
slinger wrote:
blob8108 wrote:
slinger wrote:
@blob8107, Thanks!
Him being my evil younger sibling...
Oh lol, my bad
@NeilWest, I believe you can check out the svn branch by typing this in the terminal (if you ave Subversion that is )Code:
svn co [color=red]svn://svn.code.sf.net/p/m30w/svn/[/color]
is correct path
Offline