diff options
| author | 2020-02-14 22:00:15 +0000 | |
|---|---|---|
| committer | 2020-02-14 22:00:15 +0000 | |
| commit | ab892c33b5991e64c299358279293af59a27cb4d (patch) | |
| tree | 6b11c820789c89ef23098f082c05ac9796ee3c19 /src | |
| parent | split out command_spec module (diff) | |
| signature | ||
support exported command spec types!
Diffstat (limited to 'src')
| -rw-r--r-- | src/core_modules/command_spec/__init__.py | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/core_modules/command_spec/__init__.py b/src/core_modules/command_spec/__init__.py index c28976a8..1ac25499 100644 --- a/src/core_modules/command_spec/__init__.py +++ b/src/core_modules/command_spec/__init__.py @@ -44,12 +44,17 @@ class Module(ModuleManager.BaseModule): value = simple_value n = simple_count error = argument_type.error() - elif argument_type.type in types.TYPES: - func = types.TYPES[argument_type.type] - try: - value, n = func(server, channel, user, args) - except types.SpecTypeError as e: - error = e.message + else: + if argument_type.type in types.TYPES: + func = types.TYPES[argument_type.type] + else: + func = self.exports.get_one("spec.%s" % argument_type.type) + + if func: + try: + value, n = func(server, channel, user, args) + except types.SpecTypeError as e: + error = e.message options.append([argument_type, value, n, error]) return options |
