def __init__(self, email, stats=None):
        """ Detect name, login and email """
        # Make sure we received the email string, save the original for cloning
        if not email:
            raise ConfigError("Email required for user initialization.")
        self._original = email.strip()
        # Separate aliases if provided
        try:
            email, aliases = re.split(r"\s*;\s*", self._original, 1)
        except ValueError:
            email = self._original
            aliases = None
        # Extract everything from the email string provided
        parts = utils.EMAIL_REGEXP.search(email)
        if parts is None:
            raise ConfigError("Invalid email address '{0}'".format(email))
        self.name = parts.groups()[0]
        self.email = parts.groups()[1]
        self.login = self.email.split('@')[0]
        # Check for possible aliases
        self.alias(aliases, stats)
def __init__ ( self , email , stats = None ) : if not email : raise ConfigError ( "Email required for user initialization." ) self . _original = email . strip ( ) try : email , aliases = re . split ( r"\s*;\s*" , self . _original , 1 ) except ValueError : email = self . _original aliases = None parts = utils . EMAIL_REGEXP . search ( email ) if parts is None : raise ConfigError ( "Invalid email address '{0}'" . format ( email ) ) self . name = parts . groups ( ) [ 0 ] self . email = parts . groups ( ) [ 1 ] self . login = self . email . split ( '@' ) [ 0 ] self . alias ( aliases , stats )
Detect name, login and email