×

Discussion Board

Page 2 of 4 FirstFirst 1234 LastLast
Results 16 to 30 of 58
  1. #16
    Super Contributor
    Join Date
    Dec 2004
    Posts
    643

    Re: [Announce] pygame for S60 for PyS60 1.9.x

    Quote Originally Posted by GameDude View Post
    Ah, that's what I thought as well. Unfortunately getting 1.9.4 was not straightforward. The Python 1.9.4 seems to be missing at least fnmatch, glob and binascii( built-in) modules. They did come with the previous builds. I'm not using the packager tool so the pygame build scripts need to be tweaked and binascii must be enabled in C code anyway. binascii is used by 'random'(quite often used) so I'm not that sure if it should be left out.
    The correct way to package PyGame for the 1.9.4 is to make a ZIP that users can unpack into the module repository directory. That ZIP should contain PyGame's .pyd's and .py's as well as the dependency specification file that says which modules it imports from the standard library. Then the packaging tool can simply embed the necessary PyGame files into the application as it's packaged.

    Also note that all the modules that were left out of the base runtime are in the script shell package.

  2. #17
    Super Contributor
    Join Date
    Mar 2003
    Location
    Espoo, Finland
    Posts
    976

    Re: [Announce] pygame for S60 for PyS60 1.9.x

    Hmph,

    This is a really stupid question, but how would I import/use binascii from script shell package in my own script? Also at least 1.9.4 still has runtime and shell as two separate SIS files. How would I handle the situation, where user has not installed script shell at all? Would binascii be completely missing from the device? I'm confused.

    Quote Originally Posted by jplauril View Post
    The correct way to package PyGame for the 1.9.4 is to make a ZIP that users can unpack into the module repository directory. That ZIP should contain PyGame's .pyd's and .py's as well as the dependency specification file that says which modules it imports from the standard library. Then the packaging tool can simply embed the necessary PyGame files into the application as it's packaged.

    Also note that all the modules that were left out of the base runtime are in the script shell package.
    Second question, hopefully not a stupid one: wouldn't I create a SIS file, which users would install? Instead of a ZIP? How would a user be able to open a ZIP file in handset, not to mention uninstall into right location?

    Third question: last time (1.9.3) I checked the graphical packaging tool (if it was the one using ensymble), it was ... not fulfilling my needs as a developer and I had to create my SIS on command-line. Will that magical embedding work also from command line?

    Wondering,

    --jouni who missed all docs and tutorials about module repo and related tools

  3. #18
    Regular Contributor
    Join Date
    Oct 2007
    Posts
    114

    Re: [Announce] pygame for S60 for PyS60 1.9.x

    Quote Originally Posted by JOM View Post
    Hmph,

    This is a really stupid question, but how would I import/use binascii from script shell package in my own script?
    The Scriptshell is generated with all the python modules as its dependencies. As binascii is moved to module repo, the application packager(ensymble) will package this PYD into the Scriptshell sis.

    Quote Originally Posted by JOM View Post
    Also at least 1.9.4 still has runtime and shell as two separate SIS files. How would I handle the situation, where user has not installed script shell at all? Would binascii be completely missing from the device? I'm confused.
    If your application imports binascii, then at the time of packaging the application packager(ensymble) automatically scans your python script, finds out all the imports, checks if those modules are part of Python runtime. If not it will package it with your application and it will be installed on the phone at the standard location(\sys\bin\).

    Quote Originally Posted by JOM View Post
    Second question, hopefully not a stupid one: wouldn't I create a SIS file, which users would install? Instead of a ZIP? How would a user be able to open a ZIP file in handset, not to mention uninstall into right location?
    If you are developing a library or application which other developers will use(miso, wlantools, pygame etc..) you should create a zip package in the specified format(please refer doc) and then upload it. Other developers will download this zip, extract it to the module repo on their PC. When they package their script which say for eg imports wlantools, the application packager will search for this module in the module repo and then package the PYD/PY along with the application.

    Quote Originally Posted by JOM View Post
    Third question: last time (1.9.3) I checked the graphical packaging tool (if it was the one using ensymble), it was ... not fulfilling my needs as a developer and I had to create my SIS on command-line. Will that magical embedding work also from command line?
    Yes.
    import antigravity

  4. #19
    Super Contributor
    Join Date
    Mar 2003
    Location
    Espoo, Finland
    Posts
    976

    Re: [Announce] pygame for S60 for PyS60 1.9.x

    Quote Originally Posted by ashwinurao View Post
    If your application imports binascii, then at the time of packaging the application packager(ensymble) automatically scans your python script, finds out all the imports, checks if those modules are part of Python runtime. If not it will package it with your application and it will be installed on the phone at the standard location(\sys\bin\).

    If you are developing a library or application which other developers will use(miso, wlantools, pygame etc..) you should create a zip package in the specified format(please refer doc) and then upload it. Other developers will download this zip, extract it to the module repo on their PC. When they package their script which say for eg imports wlantools, the application packager will search for this module in the module repo and then package the PYD/PY along with the application.
    Now it's getting more clear, thanx for good explanation!

    Cheers,

    --jouni

  5. #20
    Regular Contributor
    Join Date
    Jan 2007
    Location
    Oulu, Finland
    Posts
    147

    Re: [Announce] pygame for S60 for PyS60 1.9.x

    Quote Originally Posted by jplauril View Post
    The correct way to package PyGame for the 1.9.4 is to make a ZIP that users can unpack into the module repository directory. That ZIP should contain PyGame's .pyd's and .py's as well as the dependency specification file that says which modules it imports from the standard library. Then the packaging tool can simply embed the necessary PyGame files into the application as it's packaged.

    Also note that all the modules that were left out of the base runtime are in the script shell package.
    The problem with this is that the pygame libraries are provided by the pygame.exe. SDL needs some initialization on Symbian before the SDL C-APIs are usable, so there is some research left to do to get all of the stuff into a DLL and play nicely with appuifw.

    I'm also wondering how the packaging tool handles conflicts with native modules... such as binascii.pyd. If there are 2 applications needing it, which application removes the module on uninstall? If it is uninstalled, how the another application can still work? Is there some kind of renaming magic going on or what?

  6. #21
    Regular Contributor
    Join Date
    Oct 2007
    Posts
    114

    Re: [Announce] pygame for S60 for PyS60 1.9.x

    Quote Originally Posted by GameDude View Post
    I'm also wondering how the packaging tool handles conflicts with native modules... such as binascii.pyd. If there are 2 applications needing it, which application removes the module on uninstall? If it is uninstalled, how the another application can still work? Is there some kind of renaming magic going on or what?
    The PYD names are suffixed with the application UID during packaging.
    import antigravity

  7. #22
    Super Contributor
    Join Date
    Dec 2004
    Posts
    643

    Re: [Announce] pygame for S60 for PyS60 1.9.x

    Yes, it's magic

  8. #23
    Super Contributor
    Join Date
    Mar 2003
    Location
    Espoo, Finland
    Posts
    976

    Re: [Announce] pygame for S60 for PyS60 1.9.x

    Quote Originally Posted by ashwinurao View Post
    The PYD names are suffixed with the application UID during packaging.
    Huh,

    Well it's sure guaranteed to work
    Good plan for v1.0

    Cheers,

    --jouni

  9. #24
    Regular Contributor
    Join Date
    Jan 2007
    Location
    Oulu, Finland
    Posts
    147

    Post Re: [Announce] pygame for S60 for PyS60 1.9.x

    Quote Originally Posted by ashwinurao View Post
    The PYD names are suffixed with the application UID during packaging.
    Cool Does it happen to support custom main executable as well? If not, I suppose I could take look at it and make a patch.


    OK, found this line from ensymble:
    Code:
    open(os.path.join("templates", "python_ui.exe"), "rb").read()
    Should I just replace the python_ui.exe with the pygame's version? Do I need to be aware of any compatibility issues?
    Last edited by GameDude; 2009-05-14 at 19:50.

  10. #25
    Regular Contributor
    Join Date
    Oct 2007
    Posts
    114

    Re: [Announce] pygame for S60 for PyS60 1.9.x

    Quote Originally Posted by GameDude View Post
    Cool Does it happen to support custom main executable as well? If not, I suppose I could take look at it and make a patch.

    OK, found this line from ensymble:
    Code:
    open(os.path.join("templates", "python_ui.exe"), "rb").read()
    Should I just replace the python_ui.exe with the pygame's version? Do I need to be aware of any compatibility issues?
    python_ui.exe is the S60 UI stub app which creates the UI environment and loads appuifw. At the end it results in the execution of the application's default.py. Since you don't have everything as a DLL, I think that you can look at the source code of python_ui.exe at ext\amaretto\python_ui and then probably add your pygame SDL initialization code in E32Main. Then compile the python_ui.exe and distribute that to users who want to use pygame.

    So the library zip that you distribute to app developers should be extracted at PythonForS60 folder itself. python_ui.exe should go to the templates folder and the rest to module-repo\dev-modules\pygame\ folder. Once you have all the initialization done in a DLL this patched python_ui will not be needed.

    Maybe this is not the best approach, but I cannot think of anything simpler ATM.
    import antigravity

  11. #26
    Regular Contributor
    Join Date
    Jan 2007
    Location
    Oulu, Finland
    Posts
    147

    Re: [Announce] pygame for S60 for PyS60 1.9.x

    Hello,
    there is now a release for 1.9.4 available.

    No fix for the missing binascii module yet, so the snake.py won't work. Just a quick release to make the launcher work on 1.9.4. Also, the pygame library is now compiled into .pyc files for a bit faster startup( feature of scons-for-symbian). gfxdraw was also missing from trunk because I forgot to add it to the branch in the first place

  12. #27
    Registered User
    Join Date
    Mar 2009
    Posts
    5

    Re: [Announce] pygame for S60 for PyS60 1.9.x

    Hi, tested 1.9.4 release on Nokia 5800. Launcher starts fine. Click 'About'. About text starts to fade in and it crashes:

    stdout.txt says out of memory. Free memory is ~40mb when running shell and ~30mb running pygame launcher.

    Below is full stdout.txt

    Regards,
    Andreas

    Code:
    c:\resource\python25\python25.zip\site.py:86: RuntimeWarning: import cdrom: No module named cdrom
    (ImportError: No module named cdrom)
      return _original_import(name, globals, locals, fromlist, level)
    c:\resource\python25\python25.zip\site.py:86: RuntimeWarning: import joystick: No module named joystick
    (ImportError: No module named joystick)
      return _original_import(name, globals, locals, fromlist, level)
    c:\resource\python25\python25.zip\site.py:86: RuntimeWarning: import mouse: No module named mouse
    (ImportError: No module named mouse)
      return _original_import(name, globals, locals, fromlist, level)
    \data\pygame\launcher\pygame_launcher.py:15: RuntimeWarning: Detected old file(s).  Please remove the old files:
    \data\pygame\libs\pygame\color.pyc \data\pygame\libs\pygame\camera.pyc 
    Leaving them there might break pygame.  Cheers!
    
    
    Traceback (most recent call last):
      File "\data\pygame\pygame_main.py", line 61, in <module>
        m = imp.load_module("__main__", fp, pathname, stuff)
      File "app\launcher\pygame_launcher.py", line 1270, in <module>
      File "app\launcher\pygame_launcher.py", line 1217, in start
      File "app\launcher\pygame_launcher.py", line 974, in run
      File "app\launcher\pygame_launcher.py", line 1199, in handleEvent
      File "app\launcher\pygame_launcher.py", line 749, in handleEvent
      File "app\launcher\pygame_launcher.py", line 636, in doSelect
      File "app\launcher\pygame_launcher.py", line 1175, in mhAbout
      File "app\launcher\pygame_launcher.py", line 1064, in __handle_transition_animation
      File "app\launcher\pygame_launcher.py", line 218, in do
    error: Out of memory

  13. #28
    Regular Contributor
    Join Date
    Jan 2007
    Location
    Oulu, Finland
    Posts
    147

    Re: [Announce] pygame for S60 for PyS60 1.9.x

    Thanks for the report. This is something I was afraid of. The animation uses a couple of full screen Surfaces and your device has a lot bigger screen than my E51. The animation is not very fast anyway on phone so I suppose it has to be done differently... And making the launcher byte-compiled was not a good idea either. Will revert that to normal .py so it can be easily fixed or replaced.

    Does it crash also when you select the Applications item or is it just the About?

  14. #29
    Registered User
    Join Date
    Mar 2009
    Posts
    5

    Re: [Announce] pygame for S60 for PyS60 1.9.x

    It crashes on both Application and Exit menu choices.

  15. #30
    Registered User
    Join Date
    Mar 2009
    Posts
    5

    Re: [Announce] pygame for S60 for PyS60 1.9.x

    It crashes on both Application and Exit menu choices.

    And yes, the few frames om transition animation that gets plays before crash are quite slow.

Similar Threads

  1. Replies: 50
    Last Post: 2009-11-17, 19:56

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×