Tobi's "Rapid" program for windows

Tobi's "Rapid" program for windows

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Tobi's "Rapid" program for windows

Post by Forboding Angel »

Available as a package here:
http://pypi.python.org/pypi/rapid-spring/0.3.0

You can download the sauce in a tarball or zip file here:
http://github.com/tvo/rapid/downloads

Now, on to my problem...

I have used py2exe to build an executable of the rapid program (see the attached file).

But when I run the executable (just to make sure that everything is ok, I get this error:

Code: Select all

C:\Users\username\rapid\rapid\dist>rapid
.........E........
======================================================================
ERROR: test_disappeared_repo_sdp_not_cached (__main__.TestRapid)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "rapid.py", line 679, in tearDown
  File "shutil.pyc", line 225, in rmtree
  File "shutil.pyc", line 223, in rmtree
WindowsError: [Error 145] The directory is not empty: 'C:\\Users\\username\\rapid\\rapid\\dist\\.test-rapid'

----------------------------------------------------------------------
Ran 18 tests in 0.191s

FAILED (errors=1)
Can someone who actually knows what they are doing use py2exe to make a windows executable of this program? Cause apparently I'm having little luck.
Attachments
rapid.7z
(2 MiB) Downloaded 30 times
User avatar
aegis
Posts: 2456
Joined: 11 Jul 2007, 17:47

Re: Tobi's "Rapid" program for windows

Post by aegis »

uh that exe works but it appears to be the wrong one?

if you build bin/rapid in your py2exe script, you might get an exe like this.

http://aegis.eat-peet.net/rapid.exe
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Tobi's "Rapid" program for windows

Post by Forboding Angel »

uhh can you explain to me step by step what you did and what you use for setup.py?

I tried it myself just now and when I run the exe I get:

Traceback (most recent call last):
File "rapid", line 7, in <module>
ImportError: No module named rapid.main

Yours seems to work perfectly (of course I need to actually pin and update something to know for sure I guess).

Edit: yep, yours works perfectly. Thanks. I would really appreciate it if you held my hand through how to do it (cause I imagine it will need to be periodically updated).
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Tobi's "Rapid" program for windows

Post by Forboding Angel »

Could someone please compile the newest Rapid version into an exe for me> I dearly need the new -y parameter on clean-upgrade. Apparently I fail at building it myself, and I've been asking in #sy for 2 days now.

Some kind soul want to help me out here?
slogic
AI Developer
Posts: 626
Joined: 17 Mar 2008, 19:03

Re: Tobi's "Rapid" program for windows

Post by slogic »

I'm under Windows. Followed instructions. Install was fluent. But it created a file "rapid" without extension. You think it can be launched?! Then i renamed it to rapid.py. Executed python rapid.py and got error stacktrace with error at the bottom:

ImportError: No module named main

What .py file should i run directly to make it work?
Andrej
Posts: 176
Joined: 13 Aug 2006, 18:55

Re: Tobi's "Rapid" program for windows

Post by Andrej »

If I understand correctly you get this error because
renaming the 'rapid' script to 'rapid.py' makes it have
the same name as the rapid module. (should be in python-install-dir/Lib/site-packages/ folder probably)
Files named *.py also come earlier in the module search path so the renamed rapid is now found instead when executing import statements like "from rapid.main import *" or similar.
(http://docs.python.org/tutorial/modules ... earch-path)

Try renaming the file to dicks.py or just
execute "python rapid" without renaming.
slogic
AI Developer
Posts: 626
Joined: 17 Mar 2008, 19:03

Re: Tobi's "Rapid" program for windows

Post by slogic »

Andrej wrote:execute "python rapid" without renaming.
Thanx! This fixed my problem. I did unnecessary thing which broke application :?
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

Re: Tobi's "Rapid" program for windows

Post by abma »

attached latest rapid 0.4.3 created with this py2exe script:

Code: Select all

from distutils.core import setup
import py2exe

setup(
        console=['rapid'],
        options =
                {'py2exe':
                    {
                        'bundle_files': 1,
                        'compressed': 2,
                        'optimize': 2,
                        'ascii':True,
                   }
                },
        zipfile = None
)
Attachments
rapid.7z
rapid 0.4.3 windows executable
(2.29 MiB) Downloaded 31 times
User avatar
aegis
Posts: 2456
Joined: 11 Jul 2007, 17:47

Re: Tobi's "Rapid" program for windows

Post by aegis »

I used this and compressed with upx to get it down to a 2MB exe

Code: Select all

from distutils.core import setup
import py2exe

setup(
	console = ['rapid'],
	options = {'py2exe': {'compressed': 1,
							'optimize': 1,
							'bundle_files': 1,
							'excludes': ['_ssl', 'unicodedata'],
						}},
	zipfile = None,
	)
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Tobi's "Rapid" program for windows

Post by Forboding Angel »

You posted your setup.py's! I could kiss the both of you~ Thank you thank you thank you thank you!

And wow, no wonder my attmepts were malformed. I was doin it rong bigtime. O_o

Edit: Wow, I am such a noob...
User avatar
koshi
Lobby Developer
Posts: 1059
Joined: 14 Aug 2007, 16:15

Re: Tobi's "Rapid" program for windows

Post by koshi »

I've created this containing both cli and gui binaries using cx_freeze, because it's supposed to be able to generate a .msi. The corresponding bdist_msi however leaves me with an empty dir. Above archive contains the dll deps that unitsync apparently pulls in.
You can find the setup.py changes at http://github.com/springlobby/rapid/tree/cx_freeze

Edit: python2.6 with patched msilib, pyqt4.8.1

Edit2: if above archive does not work for you please try this instead
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Tobi's "Rapid" program for windows

Post by Forboding Angel »

koshi wrote:I've created this containing both cli and gui binaries using cx_freeze, because it's supposed to be able to generate a .msi. The corresponding bdist_msi however leaves me with an empty dir. Above archive contains the dll deps that unitsync apparently pulls in.
You can find the setup.py changes at http://github.com/springlobby/rapid/tree/cx_freeze

Edit: python2.6 with patched msilib, pyqt4.8.1

Edit2: if above archive does not work for you please try this instead

^^ This jsut throws errors, and ever since 82.6, the rapid tool will throw errors, particularly on clean-upgrade.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Tobi's "Rapid" program for windows

Post by Forboding Angel »

Ok, so I went here: https://github.com/tvo/rapid/downloads

And downloaded: https://github.com/tvo/rapid/zipball/v0.4.3

Then, I unzipped it to: C:\Python26\tvo-rapid-d0cee20

I then went into the tvo-rapid-d0cee20 folder and created a new text file which I called build.py I then right clicked on build.py and choose "Edit in IDLE".

Then I pasted in these lines:

Code: Select all

from distutils.core import setup
import py2exe

setup(
   console = ['rapid'],
   options = {'py2exe': {'compressed': 1,
                     'optimize': 1,
                     'bundle_files': 1,
                     'excludes': ['_ssl', 'unicodedata'],
                  }},
   zipfile = None,
   )
Then I saved the file.

Then I opened a cmd prompt at that location (I have the correct environment variables set up in windows for python) and ran: python build.py py2exe

At which point I got this error:
Cmd Prompt wrote:C:\Python26\tvo-rapid-d0cee20>python build.py py2exe
C:\Python26\lib\site-packages\py2exe\build_exe.py:16: DeprecationWarning: the se
ts module is deprecated
import sets
running py2exe
*** searching for required modules ***
error: rapid: Permission denied
Can someone please explain to me where I went wrong?

**Note** I tried running cmd prompt as admin, but received the same error
Also, moving to documents netted the same error as well
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: Tobi's "Rapid" program for windows

Post by zwzsg »

So I wanted to get all EvoRTS maps. But Forboding Angel doesn't provide links for maps and mods, only a link to rapid. I would rather have avoided it, but oh well, after all, maybe it works.

Well, it does not:

Image

From following instructions from http://www.evolutionrts.info/download/
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

Re: Tobi's "Rapid" program for windows

Post by abma »

Did you place rapid directly into the spring folder?

In the screenshot it looks like you've created the subfolder SolidNot. rapid.exe has to be near by unitsync.dll/spring.exe.

rapid can't download maps, afaik rapid only can download games. if you want to download the maps, scroll down on http://www.evolutionrts.info/download/ :-)
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: Tobi's "Rapid" program for windows

Post by zwzsg »

Yes, this is my Spring folder, sorry for the weird name.

Maps were added only couple hours ago to that page, after I asked forbie.

On the plus side, rapid-gui.exe works. I on clicked on evo rts test 748, and it downloaded it, and now I can see it in Spring menu and play it.

I'm kinda scared about how it's all spread into incomprehensible data dust instead of a file or a folder that I would be more confortable working with, especially considering how my goal was not to play EvoRTS, but to compare solid and non solid load time on a real world case (Spring with Evo RTS + Gundam).
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Tobi's "Rapid" program for windows

Post by Forboding Angel »

Z, rapid can create an sdz, an sdd, or just about anything you like.

Also, post a screenshot of you running the command from your spring folder. It works for EVERYONE, plus, the instructions on the evo site ( http://www.evolutionrts.info/download/ ) are very explicit as to where it should be unpacked.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: Tobi's "Rapid" program for windows

Post by zwzsg »

Forboding Angel wrote:Z, rapid can create an sdz, an sdd, or just about anything you like.
Will look into that.
Forboding Angel wrote:It works for EVERYONE
Proved false.
Forboding Angel wrote:Also, post a screenshot of you running the command from your spring folder.
Image

Can we go past the stage where you tell me over and over to put rapid in Spring folder now?

Forboding Angel wrote:plus, the instructions on the evo site ( http://www.evolutionrts.info/download/ ) are very explicit as to where it should be unpacked.
Yes, and I followed them.




I'm SORRY I confused you by having all my spring related stuff (archived installer, stuff I wanna keep set apart, map in progress, several install side by side, etc...) in a folder named /Spring/ while having the Spring folders themselves bearing weird names.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Tobi's "Rapid" program for windows

Post by Forboding Angel »

Yeah, I see it. It looks like the various dll's and things aren't there, which is why it is failing.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: Tobi's "Rapid" program for windows

Post by zwzsg »

Which dll and things? Where do they come from? From Spring installer? From rapid.zip? From library.zip you told me not to unzip (and which doesn't help when unzipped)? Am I supposed to have python installed on my machine beforehand? To get some redistributable framework MS thingy everybody is supposed to already have these days?
Post Reply

Return to “Engine”