Esempio n. 1
0
def __get_sender():
    """Return the 'authname <authemail>' string as read from the
    configuration file
    """
    sender = config.get('stgit.sender')
    if not sender:
        try:
            sender = str(git.user())
        except git.GitException:
            sender = str(git.author())

    if not sender:
        raise CmdException, 'unknown sender details'

    return address_or_alias(sender)
Esempio n. 2
0
def __get_sender():
    """Return the 'authname <authemail>' string as read from the
    configuration file
    """
    sender=config.get('stgit.sender')
    if not sender:
        try:
            sender = str(git.user())
        except git.GitException:
            sender = str(git.author())

    if not sender:
        raise CmdException, 'unknown sender details'

    return address_or_alias(sender)
Esempio n. 3
0
def __get_sender():
    """Return the 'authname <authemail>' string as read from the
    configuration file
    """
    sender = config.get('stgit.sender')
    if not sender:
        try:
            sender = text(git.user())
        except git.GitException:
            try:
                sender = text(git.author())
            except git.GitException:
                pass
    if not sender:
        raise CmdException('Unknown sender name and e-mail; you should for '
                           'example set git config user.name and user.email')
    sender = email.utils.parseaddr(sender)

    return email.utils.formataddr(address_or_alias(sender))
Esempio n. 4
0
File: mail.py Progetto: snits/stgit
def __get_sender():
    """Return the 'authname <authemail>' string as read from the
    configuration file
    """
    sender = config.get('stgit.sender')
    if not sender:
        try:
            sender = git.user()
        except git.GitException:
            try:
                sender = git.author()
            except git.GitException:
                pass
    if not sender:
        raise CmdException('Unknown sender name and e-mail; you should for '
                           'example set git config user.name and user.email')
    sender = email.utils.parseaddr(sender)

    return email.utils.formataddr(address_or_alias(sender))
Esempio n. 5
0
File: stack.py Progetto: snits/stgit
 def set_authdate(self, date):
     self._set_field('authdate', date or git.author().date)
Esempio n. 6
0
File: stack.py Progetto: snits/stgit
 def set_authemail(self, email):
     self._set_field('authemail', email or git.author().email)
Esempio n. 7
0
File: stack.py Progetto: snits/stgit
 def set_authname(self, name):
     self._set_field('authname', name or git.author().name)
Esempio n. 8
0
 def set_authdate(self, date):
     self._set_field('authdate', date or git.author().date)
Esempio n. 9
0
 def set_authemail(self, email):
     self._set_field('authemail', email or git.author().email)
Esempio n. 10
0
 def set_authname(self, name):
     self._set_field('authname', name or git.author().name)