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

#26 2012-09-19 11:34:01

slinger
Scratcher
Registered: 2011-06-21
Posts: 1000+

Re: M30W New Official Topic

I believe that this would be a better way to check the trunk of M30W out (without a SF account too)

Code:

svn co svn://svn.code.sf.net/p/m30w/svn/trunk m30w-svn

Last edited by slinger (2012-09-19 11:35:05)


http://s0.bcbits.com/img/buttons/bandcamp_130x27_blue.png

Offline

 

#27 2012-09-19 15:26:33

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

Re: M30W New Official Topic

On OS X Mountain Lion.

* Installs Python from  wxpython.org
* Runs M30W.py: "wxpython not found; download from wxpython.org"

hmm  ...


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

Offline

 

#28 2012-09-19 15:45:01

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

Re: M30W New Official Topic

blob8108 wrote:

On OS X Mountain Lion.

* Installs Python from  wxpython.org
* Runs M30W.py: "wxpython not found; download from wxpython.org"

hmm  ...

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

 

#29 2012-09-19 16:26:26

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

Re: M30W New Official Topic

Meh, doesn't work ._.

Darn, OS X really is a nightmare for dev stuff... Still, better than Windows!  big_smile


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

Offline

 

#30 2012-09-19 16:28:55

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

Re: M30W New Official Topic

It's something about 32-bit/64-bit Pythons.


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

Offline

 

#31 2012-09-19 16:42:16

MathWizz
Scratcher
Registered: 2009-08-31
Posts: 1000+

Re: M30W New Official Topic

Linux is pretty sweet for this stuff.  big_smile


http://block.site90.net/scratch.mit/text.php?size=30&text=%20A%20signature!&color=333333

Offline

 

#32 2012-09-19 16:45:38

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

Re: M30W New Official Topic

blob8108 wrote:

Meh, doesn't work ._.

Darn, OS X really is a nightmare for dev stuff... Still, better than Windows!  big_smile

what do u get on import wx? what installer did you use? what python are you using?

this goes with x64, this with x86

also, tried pip?

Offline

 

#33 2012-09-20 07:52:35

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

Re: M30W New Official Topic

@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

 

#34 2012-09-20 08:36:24

slinger
Scratcher
Registered: 2011-06-21
Posts: 1000+

Re: M30W New Official Topic

Sure, I can most definitely try! But first can I finish my install script? :p

Last edited by slinger (2012-09-20 09:52:01)


http://s0.bcbits.com/img/buttons/bandcamp_130x27_blue.png

Offline

 

#35 2012-09-20 09:22:37

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

Re: M30W New Official Topic

I settled for reading through your code, for now  smile

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.  hmm  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:

Code:

# `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.


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

Offline

 

#36 2012-09-20 10:03:04

slinger
Scratcher
Registered: 2011-06-21
Posts: 1000+

Re: M30W New Official Topic

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:

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?

Code:

 
#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)


http://s0.bcbits.com/img/buttons/bandcamp_130x27_blue.png

Offline

 

#37 2012-09-20 14:12:36

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

Re: M30W New Official Topic

Code:

#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?

Code:

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  smile

Offline

 

#38 2012-09-20 14:22:52

slinger
Scratcher
Registered: 2011-06-21
Posts: 1000+

Re: M30W New Official Topic

Okay, sure!


http://s0.bcbits.com/img/buttons/bandcamp_130x27_blue.png

Offline

 

#39 2012-09-20 14:35:33

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

Re: M30W New Official Topic

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?  smile


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

Offline

 

#40 2012-09-20 14:37:00

slinger
Scratcher
Registered: 2011-06-21
Posts: 1000+

Re: M30W New Official Topic

I'm having trouble committing to sourceforge (yes, I know how to use SVN  tongue ). 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)


http://s0.bcbits.com/img/buttons/bandcamp_130x27_blue.png

Offline

 

#41 2012-09-20 14:45:02

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

Re: M30W New Official Topic

@slinger, maybe get on gobby?
seems pretty nice  smile

Offline

 

#42 2012-09-20 14:45:23

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

Re: M30W New Official Topic

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.  smile


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

Offline

 

#43 2012-09-20 14:52:44

slinger
Scratcher
Registered: 2011-06-21
Posts: 1000+

Re: M30W New Official Topic

@roijac, Okay, I don't have much time right now though :\
edit: what is the server we are using?
@blob8107, Thanks!  big_smile

Last edited by slinger (2012-09-20 14:53:27)


http://s0.bcbits.com/img/buttons/bandcamp_130x27_blue.png

Offline

 

#44 2012-09-20 15:09:46

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

Re: M30W New Official Topic

slinger wrote:

@blob8107, Thanks!  big_smile

Him being my evil younger sibling...  tongue


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

Offline

 

#45 2012-09-20 19:05:35

MathWizz
Scratcher
Registered: 2009-08-31
Posts: 1000+

Re: M30W New Official Topic

blob8108 wrote:

slinger wrote:

@blob8107, Thanks!  big_smile

Him being my evil younger sibling...  tongue

Does that mean...you're siblings?  yikes


http://block.site90.net/scratch.mit/text.php?size=30&text=%20A%20signature!&color=333333

Offline

 

#46 2012-09-21 02:21:55

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

Re: M30W New Official Topic

MathWizz wrote:

blob8108 wrote:

slinger wrote:

@blob8107, Thanks!  big_smile

Him being my evil younger sibling...  tongue

Does that mean...you're siblings?  yikes

Who, me and blob8107?  tongue


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

Offline

 

#47 2012-09-21 02:50:14

NeilWest
Scratcher
Registered: 2010-01-06
Posts: 1000+

Re: M30W New Official Topic

This seems really cool! When will it be downloadable yet?

Offline

 

#48 2012-09-21 05:03:36

slinger
Scratcher
Registered: 2011-06-21
Posts: 1000+

Re: M30W New Official Topic

blob8108 wrote:

slinger wrote:

@blob8107, Thanks!  big_smile

Him being my evil younger sibling...  tongue

Oh lol, my bad  tongue
@NeilWest, I believe you can check out the svn branch by typing this in the terminal (if you ave Subversion that is  tongue )

Code:

svn co svn://svn.code.sf.net/p/m30w/svn/trunk m30w-svn

http://s0.bcbits.com/img/buttons/bandcamp_130x27_blue.png

Offline

 

#49 2012-09-21 09:12:44

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

Re: M30W New Official Topic

slinger wrote:

blob8108 wrote:

slinger wrote:

@blob8107, Thanks!  big_smile

Him being my evil younger sibling...  tongue

Oh lol, my bad  tongue
@NeilWest, I believe you can check out the svn branch by typing this in the terminal (if you ave Subversion that is  tongue )

Code:

svn co [color=red]svn://svn.code.sf.net/p/m30w/svn/[/color]

is correct path  tongue

Offline

 

#50 2012-09-21 10:50:36

slinger
Scratcher
Registered: 2011-06-21
Posts: 1000+

Re: M30W New Official Topic

I believe that checks out the whole project (tests etc). My link just checks out the trunk.


http://s0.bcbits.com/img/buttons/bandcamp_130x27_blue.png

Offline

 

Board footer