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)
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)
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))
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))
def set_authdate(self, date): self._set_field('authdate', date or git.author().date)
def set_authemail(self, email): self._set_field('authemail', email or git.author().email)
def set_authname(self, name): self._set_field('authname', name or git.author().name)