supybot-test: Add the --exclude option.

This commit is contained in:
Valentin Lorentz 2013-01-06 17:17:26 +01:00
parent 603f44129d
commit 413bdbf80e

View File

@ -142,13 +142,17 @@ if __name__ == '__main__':
action='append', dest='pluginsDirs', default=[], action='append', dest='pluginsDirs', default=[],
help='Looks in in the given directory for plugins and ' help='Looks in in the given directory for plugins and '
'loads the tests from all of them.') 'loads the tests from all of them.')
parser.add_option('', '--exclude',
action='append', dest='excludePlugins', default=[],
help='List of plugins you do not want --plugins-dir '
'to include.')
(options, args) = parser.parse_args() (options, args) = parser.parse_args()
# This must go before checking for args, of course. # This must go before checking for args, of course.
for pluginDir in options.pluginsDirs: for pluginDir in options.pluginsDirs:
for name in glob.glob(os.path.join(pluginDir, '*')): for name in glob.glob(os.path.join(pluginDir, '*')):
#print '***', name #print '***', name
if os.path.isdir(name): if name not in options.excludePlugins and os.path.isdir(name):
args.append(name) args.append(name)
if not args: if not args: