use os.listdir
This commit is contained in:
parent
3357992dd7
commit
629c1de8d5
1 changed files with 5 additions and 1 deletions
|
@ -226,7 +226,11 @@ class Client(object):
|
|||
def load_plugins(self, base=os.path.join(utils.basedir(), 'client.d')):
|
||||
global parse_path, example_path, ignore_file, sync_extensions, encode
|
||||
base = os.path.expanduser(base)
|
||||
for path in sorted(glob('%s%s*.py' % (base, os.sep))):
|
||||
for name in sorted(os.listdir(base)):
|
||||
if not name.endswith('.py'):
|
||||
continue
|
||||
path = os.path.join(base, name)
|
||||
|
||||
with open(path) as fp:
|
||||
module = imp.load_source(os.path.basename(path).split('.')[0], base, fp)
|
||||
if hasattr(module, 'parse_path'):
|
||||
|
|
Loading…
Reference in a new issue