1
# Copyright (c) 2007 Twisted Matrix Laboratories.
2
# Copyright (c) 2008 Divmod.
3
# See LICENSE for details.
9
def pluginPackagePaths(name):
11
Return a list of additional directories which should be searched for
12
modules to be included as part of the named plugin package.
15
@param name: The fully-qualified Python name of a plugin package, eg
18
@rtype: C{list} of C{str}
19
@return: The absolute paths to other directories which may contain plugin
20
modules for the named plugin package.
22
package = name.split('.')
23
# Note that this may include directories which do not exist. It may be
24
# preferable to remove such directories at this point, rather than allow
25
# them to be searched later on.
27
# Note as well that only '__init__.py' will be considered to make a
28
# directory a package (and thus exclude it from this list). This means
29
# that if you create a master plugin package which has some other kind of
30
# __init__ (eg, __init__.pyc) it will be incorrectly treated as a
31
# supplementary plugin directory.
33
os.path.abspath(os.path.join(x, *package))
37
not os.path.exists(os.path.join(x, *package + ['__init__.py']))]
42
twisted.plugin.pluginPackagePaths = pluginPackagePaths