EmailOption and URLOption : let user choose attr for DomainnameOption
authorEmmanuel Garette <egarette@cadoles.com>
Tue, 1 Oct 2013 18:01:38 +0000 (20:01 +0200)
committerEmmanuel Garette <egarette@cadoles.com>
Tue, 1 Oct 2013 18:01:38 +0000 (20:01 +0200)
tiramisu/option.py

index 0d0c69a..88da41a 100644 (file)
@@ -1039,12 +1039,6 @@ class EmailOption(DomainnameOption):
     _opt_type = 'email'
     username_re = re.compile(r"^[\w!#$%&'*+\-/=?^`{|}~.]+$")
 
-    def __init__(self, *args, **kwargs):
-        kwargs['type_'] = 'domainname'
-        kwargs['allow_ip'] = False
-        kwargs['allow_without_dot'] = False
-        super(EmailOption, self).__init__(*args, **kwargs)
-
     def _validate(self, value):
         splitted = value.split('@', 1)
         try:
@@ -1063,12 +1057,6 @@ class URLOption(DomainnameOption):
     proto_re = re.compile(r'(http|https)://')
     path_re = re.compile(r"^[a-z0-9\-\._~:/\?#\[\]@!%\$&\'\(\)\*\+,;=]+$")
 
-    def __init__(self, *args, **kwargs):
-        kwargs['type_'] = 'domainname'
-        kwargs['allow_ip'] = False
-        kwargs['allow_without_dot'] = False
-        super(URLOption, self).__init__(*args, **kwargs)
-
     def _validate(self, value):
         match = self.proto_re.search(value)
         if not match: