Ryan Welch píše v Pá 20. 05. 2011 v 13:18 -0700:
> in sphinx/pycode/__init__.py:
> 
> _grammarfile = path.join(path.dirname(__file__), 'Grammar.txt')
> 
> So, it would appear that even using the hooking mechanism, this file
> won't be correctly found. I've tried using a hook-sphinx.py and adding
> "Grammar.txt" to datas = [], but that just ends up placing the file in
> a place the module won't look.
> 
> My thought was that I'd have to test sys.frozen and write some kind of
> import hook for sphinx.pycode to change __file__, but I'm not even
> quite sure that would work.
> 
> Any ideas?

Usual hooks are used only during packaging not at runtime.

I think you could try the following:

1) use standard hook mechanism to include 'Grammar.txt' with the
executable
2) use runtime hooks and override the _grammarfile when running your
app:
 - inside your runtime hook for sphinx you could have code similar to

import sphinx
sphinx.pycode._grammarfile = join(dirname(sys.executable),'Grammar.txt')

 - for example look at files
   ./support/rthooks/pyi_rth_django.py
   ./rthooks.dat



-- 
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pyinstaller?hl=en.

Reply via email to