move SpecTypeErro to utils.parse.spec
This commit is contained in:
parent
ab892c33b5
commit
275f896ed8
3 changed files with 7 additions and 6 deletions
|
@ -53,7 +53,7 @@ class Module(ModuleManager.BaseModule):
|
||||||
if func:
|
if func:
|
||||||
try:
|
try:
|
||||||
value, n = func(server, channel, user, args)
|
value, n = func(server, channel, user, args)
|
||||||
except types.SpecTypeError as e:
|
except utils.parse.SpecTypeError as e:
|
||||||
error = e.message
|
error = e.message
|
||||||
|
|
||||||
options.append([argument_type, value, n, error])
|
options.append([argument_type, value, n, error])
|
||||||
|
|
|
@ -1,8 +1,4 @@
|
||||||
|
from src.utils.parse import SpecTypeError
|
||||||
class SpecTypeError(Exception):
|
|
||||||
def __init__(self, message: str, arg_count: int=1):
|
|
||||||
self.message = message
|
|
||||||
self.arg_count = arg_count
|
|
||||||
|
|
||||||
TYPES = {}
|
TYPES = {}
|
||||||
def _type(func):
|
def _type(func):
|
||||||
|
|
|
@ -3,6 +3,11 @@ from .time import duration
|
||||||
from .types import try_int
|
from .types import try_int
|
||||||
from src.utils.datetime.parse import date_human
|
from src.utils.datetime.parse import date_human
|
||||||
|
|
||||||
|
class SpecTypeError(Exception):
|
||||||
|
def __init__(self, message: str, arg_count: int=1):
|
||||||
|
self.message = message
|
||||||
|
self.arg_count = arg_count
|
||||||
|
|
||||||
class SpecArgumentContext(enum.IntFlag):
|
class SpecArgumentContext(enum.IntFlag):
|
||||||
CHANNEL = 1
|
CHANNEL = 1
|
||||||
PRIVATE = 2
|
PRIVATE = 2
|
||||||
|
|
Loading…
Reference in a new issue