[Twisted-Python] Re: Twisted 1.0.4 - Heavy search for `plugins.tml'

Francois Pinard pinard at iro.umontreal.ca
Sun Apr 27 12:50:43 EDT 2003


[Christopher Armstrong]
> [Francois Pinard]

> > I noticed yesterday how heavily Twisted tries to find `plugins.tml'.
> > Being new to the game, and not knowing the motivations, a lot of
> > things surely escape my comprehension, yet at first glance, it looks
> > excessive to me trying many thousands of disk accesses merely to find
> > a configuration file.

> The thing is, it's not a configuration file :-) It's a plugins file.
> The point is for applications to distribute one along with their
> packages, and just have it put into their Python package directory,
> so there's no tricky registration process required.

Ok.  It is not a configuration file, if you want.  Or this file configures
the plugins, say.  And, I surely understood that the idea of searching so
hard was so the user does not have to say much about where it is.  Granted.

It still looks like Twisted is going overboard with this.  If `plugins.tml'
files were being collected from the top-level directories along `sys.path'
and maybe no more than one-level below, and maybe also for test purposes
(despite the security weakness), into the current directory and one
level of directories below, it would probably make a lot of sense at a
reasonable cost.

But trying every single executable along the shell load path as if the
executable were a directory (yet I understand it would be slower to first
check if it is a directory) is heavy and unlikely to be any fruitful -- at
least in my naive eyes.  It might be worth some revisiting, who knows...
If you really want full generality, it might be more sane and useful to
invent some TWISTED_SEARCH_PATH environment variable, than to go berzerk
and frantically search everything in the wild. :-)

-- 
François Pinard   http://www.iro.umontreal.ca/~pinard




More information about the Twisted-Python mailing list