aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/livestreamer/__init__.py
diff options
context:
space:
mode:
authorGravatar Christopher Rosell <chrippa@tanuki.se>2012-09-29 22:04:44 +0200
committerGravatar Christopher Rosell <chrippa@tanuki.se>2012-09-29 22:04:44 +0200
commitef86768ac8520e94dcd336b3acc98c0572382371 (patch)
tree054f146b0848fa52056758aabdce7a59960fc92a /src/livestreamer/__init__.py
parent6ace47a5c2d9e4fc910ec39846a2d9540cb665b7 (diff)
cli: Add option to load plugins from custom directories.
Diffstat (limited to 'src/livestreamer/__init__.py')
-rw-r--r--src/livestreamer/__init__.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/livestreamer/__init__.py b/src/livestreamer/__init__.py
index ca176d0..a34d90b 100644
--- a/src/livestreamer/__init__.py
+++ b/src/livestreamer/__init__.py
@@ -82,16 +82,14 @@ class Livestreamer(object):
return self.plugins
def load_builtin_plugins(self):
- for loader, name, ispkg in pkgutil.iter_modules(plugins.__path__):
- file, pathname, desc = imp.find_module(name, plugins.__path__)
- self.load_plugin(name, file, pathname, desc)
+ self.load_plugins(plugins.__path__[0])
def load_plugins(self, path):
"""
Attempt to load plugins from the *path* directory.
"""
- for loader, name, ispkg in pkgutil.iter_modules(path):
- file, pathname, desc = imp.find_module(name, path)
+ for loader, name, ispkg in pkgutil.iter_modules([path]):
+ file, pathname, desc = imp.find_module(name, [path])
self.load_plugin(name, file, pathname, desc)
def load_plugin(self, name, file, pathname, desc):