Lino Website

runpy.exe failed when frozen

Sunday, 11. December 2005 02:04.

Executing the frozen runpy.exe (using as example timtools runpy syncspz.py) failed:

Traceback (most recent call last):
  File "runpy.py", line 49, in ?
  File "lino\console\application.pyo", line 238, in main
  File "runpy.py", line 43, in run
  File "syncspz.py", line 2, in ?
    from lino.scripts.sync import SyncJob
ImportError: No module named sync

Explanation: py2exe does not store the scripts themselves in the library.zip. And this is okay. So I created a new module lino.apps.synchronizer containing the Synchronizer class. The modules in lino.scripts should contain only the wrapper logic to convert command-line options to arguments.

Here is the new version of the first runpy script:

from lino.console import syscon
from lino.apps.timtools.synchronizer import Synchronizer
job=Synchronizer()
job.addProject(r"c:\tim\stvith",   r"x:\tim\stvith")
job.addProject(r"x:\tim\dlm",      r"c:\tim\dlm")
job.addProject(r"x:\tim\localdlm", r"c:\tim\localdlm")
job.addProject(r"x:\tim",          r"c:\tim")
syscon.run(job.run)

Refering articles:

Copyright 2001-2007 Luc Saffre.
http://lino.saffre-rumma.ee
Generated 2007-06-07 16:22:35