What steps will reproduce the problem? 1. Create your program through a single file 2. Run the file at a directory with lots of directories and files
What is the expected output? What do you see instead?
Resources should not try to index every file found starting at ".", i.e, importing pyglet should be instantaneous, I would like not to wait for a 2 minutes importing to be finished.
Maybe it could be the developer responsability to start this indexing (let the developer call reindex instead of running it when the pyglet is imported).
Comment #1
Posted on Nov 22, 2008 by Massive HippoThis patch solves the problem by avoiding the use of the current directory as search path; related docstrings were fixed as well.
- pyglet-issue367-patch.diff 1.11KB
Comment #2
Posted on Nov 22, 2008 by Quick BirdThis change cannot be accepted as it breaks a release. The correct fix is either to perform the indexing lazily
or as an option to pyglet.options.
Comment #3
Posted on Nov 22, 2008 by Massive HippoHow do you think the lazy indexing should be done? I'll fix the patch to include a "delayed_resource_loading" option meanwhile.
Comment #4
Posted on Nov 22, 2008 by Massive HippoHere it goes, now using delayed_resource_loading to decide if reindex is needed or not when the class is instantiated.
Comment #5
Posted on Nov 23, 2008 by Quick BirdI've implemented lazy indexing in r2385 (the index is created only after a resource is requested, not at import time; giving you a chance to change the path).
Status: Fixed