Dipole Consulting SPRL

Making Thuban an independant application PDF Print E-mail

How i've have updated Thuban so that we can create a independant application of it.

 I used cx Freeze 3.0.3 to do it.

 

This is a draft and will be update soon (for win32). 

 

Update (2007-05-10) : i've made interesting test with pyinstaller 1.3 under win32. It seems to work fine and embeds all the needed libraries 

 

Code modifications

 

Update all the Python code using __path__  or __file__ for managing the frozen state of the new application. For example, Thuban/Model/resources.py has been updated in the following way :

 if hasattr(sys, 'frozen'):
    projdir = \
            os.path.join(os.path.dirname(sys.executable), "Resources", "Projections")
else:
    projdir = \
            os.path.join(Thuban.__path__[0], pardir, "Resources", "Projections")    


I will post a patch asap.

 

 Freezing the app under linux:

 

A single command line : 

FreezePython --install-dir ~/tmp/dist/ --include-path=current/thuban:current/thuban/Lib/ --include-modules=Extensions.svgexport,Extensions.umn_mapserver, Extensions.mouseposition,Extensions.importAPR,Extensions.ogr, Extensions.bboxdump,Extensions.export_shapefile,Extensions.gns2shp,Extensions.profiling, Extensions.wms,pyexpat,xml.sax.drivers2.drv_pyexpat  current/thuban/thuban.py

All the not directly used modules have to be added to the --include-modules option to be integrated in the application. 

Finally, you only have to add the needed missing resources by copying the directories to the new dist :

    cp -r current/thuban/Resources /home/did/tmp/dist/
    cp -r current/thuban/Data /home/did/tmp/dist/
    cp -r current/thuban/Doc /home/did/tmp/dist/
    cp -r current/thuban/Examples /home/did/tmp/dist/

Launching /home/did/tmp/dist/thuban just works fine.

 

Last Updated ( jeudi, 10 mai 2007 )
 
Next >
Main Menu
Home
Services
Products
References
Technical
Jobs
Downloads
Links
Contact Us
Login Form





Lost Password?
No account yet? Register
Newsflash
The JWaveLib 1.1.0 has been released on the 31th of July. A heavy refactoring work has been done on the existing code base to improve the use of the JWavelib by the different tools and products build on top of it (JWaveLib for eWON , WaveSniffer ).