Hi Nathan -

I see your point, and yet the problem occurs. This works fine:


==============================================================
$ cd temp
$ python
Python 2.7.1 (r271:86832, Jul 31 2011, 19:30:53)
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyglet
>>> loc = pyglet.resource.FileLocation('')
>>> print loc
<pyglet.resource.FileLocation object at 0x42fe10>
==============================================================


whereas this doesn't (the errors appear after I hit ctrl-c when I get tired of waiting):

==============================================================
DMUSICAN56252:temp dmusican$ cd ~
DMUSICAN56252:~ dmusican$ python
Python 2.7.1 (r271:86832, Jul 31 2011, 19:30:53)
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyglet
>>> loc = pyglet.resource.FileLocation('')
^CTraceback (most recent call last):
  File "<stdin>", line 1, in <module>
File "/Library/Python/2.7/site-packages/pyglet-1.1.4-py2.7.egg/pyglet/__init__.py", line 306, in __getattr__ File "/Library/Python/2.7/site-packages/pyglet-1.1.4-py2.7.egg/pyglet/resource.py", line 680, in <module> File "/Library/Python/2.7/site-packages/pyglet-1.1.4-py2.7.egg/pyglet/resource.py", line 291, in __init__ File "/Library/Python/2.7/site-packages/pyglet-1.1.4-py2.7.egg/pyglet/resource.py", line 335, in reindex File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
    for x in walk(new_path, topdown, onerror, followlinks):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
    for x in walk(new_path, topdown, onerror, followlinks):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
    for x in walk(new_path, topdown, onerror, followlinks):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
    for x in walk(new_path, topdown, onerror, followlinks):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
    for x in walk(new_path, topdown, onerror, followlinks):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
    for x in walk(new_path, topdown, onerror, followlinks):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
    for x in walk(new_path, topdown, onerror, followlinks):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
    for x in walk(new_path, topdown, onerror, followlinks):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
    for x in walk(new_path, topdown, onerror, followlinks):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
    for x in walk(new_path, topdown, onerror, followlinks):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 294, in walk
    for x in walk(new_path, topdown, onerror, followlinks):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 284, in walk
    if isdir(join(top, name)):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/posixpath.py", line 65, in join
    for b in p:
KeyboardInterrupt
>>>
====================================================================

Wacky, isn't it?

--
Dave



On 3/19/13 10:32 AM, Nathan wrote:
On Fri, Mar 15, 2013 at 8:44 PM, Dave Musicant <[email protected]
<mailto:[email protected]>> wrote:

    I've discovered the problem, actually --
    pyglet.resource.FileLocation seems to take an enormously long time
    when run from directories with a lot of subdirectories/files (such
    as my home directory). Can anyone clarify what's going on there?
    Should this be considered a bug?


I don't think that's the problem.  Take a look at the code for
FileLocation (it's almost...no code at all)

class Location(object):
     def open(self, filename, mode='rb'):
         raise NotImplementedError('abstract')

class FileLocation(Location):
     def __init__(self, path):
         self.path = path

     def open(self, filename, mode='rb'):
         return open(os.path.join(self.path, filename), mode)

~ Nathan

--
You received this message because you are subscribed to a topic in the
Google Groups "pyglet-users" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/pyglet-users/83pe-B1J2EQ/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to
[email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pyglet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.



--
You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pyglet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to