Author: tchemit Date: 2014-07-20 17:49:57 +0200 (Sun, 20 Jul 2014) New Revision: 100 Url: http://forge.codelutin.com/projects/adminsys/repository/revisions/100 Log: improve usage of git multimail (refs #5074) Modified: scripts/git-tools/git-multimail-run.py Modified: scripts/git-tools/git-multimail-run.py =================================================================== --- scripts/git-tools/git-multimail-run.py 2014-07-20 13:40:37 UTC (rev 99) +++ scripts/git-tools/git-multimail-run.py 2014-07-20 15:49:57 UTC (rev 100) @@ -40,16 +40,6 @@ import git_multimail -# It is possible to modify the output templates here; e.g.: - -#git_multimail.FOOTER_TEMPLATE = """\ -# -#-- \n\ -#This email was generated by the wonderful git-multimail tool. -#""" - -# Specify which "git config" section contains the configuration for -# git-multimail: config = git_multimail.Config('multimailhook') forge = config.get('forge') @@ -65,38 +55,6 @@ """.format(forge, reponame) -git_multimail.REF_CREATED_SUBJECT_TEMPLATE = ( - '%(refname_type)s %(short_refname)s created' - ' (now %(newrev_short)s)' - ) -git_multimail.REF_UPDATED_SUBJECT_TEMPLATE = ( - '%(refname_type)s %(short_refname)s updated' - ' (%(oldrev_short)s -> %(newrev_short)s)' - ) -git_multimail.REF_DELETED_SUBJECT_TEMPLATE = ( - '%(refname_type)s %(short_refname)s deleted' - ' (was %(oldrev_short)s)' - ) - -git_multimail.REVISION_HEADER_TEMPLATE = """\ -Date: %(send_date)s -To: %(recipients)s -Subject: %(num)02d/%(tot)02d: %(oneline)s -MIME-Version: 1.0 -Content-Type: text/plain; charset=%(charset)s -Content-Transfer-Encoding: 8bit -From: %(fromaddr)s -Reply-To: %(reply_to)s -In-Reply-To: %(reply_to_msgid)s -References: %(reply_to_msgid)s -X-Git-Host: %(fqdn)s -X-Git-Repo: %(repo_shortname)s -X-Git-Refname: %(refname)s -X-Git-Reftype: %(refname_type)s -X-Git-Rev: %(rev)s -Auto-Submitted: auto-generated -""" - git_multimail.REVISION_INTRO_TEMPLATE = """\ This is an automated email from the git hooks/post-receive script. @@ -106,34 +64,11 @@ """.format(forge, reponame) - # Select the type of environment: environment = git_multimail.GenericEnvironment(config=config) # Choose the method of sending emails based on the git config: mailer = git_multimail.choose_mailer(config, environment) -# Alternatively, you may hardcode the mailer using code like one of -# the following: - -# Use "/usr/sbin/sendmail -oi -t" to send emails. The envelopesender -# argument is optional: -#mailer = git_multimail.SendMailer( -# command=['/usr/sbin/sendmail', '-oi', '-t'], -# envelopesender='git-repo@example.com', -# ) - -# Use Python's smtplib to send emails. Both arguments are required. -#mailer = git_multimail.SMTPMailer( -# envelopesender='git-repo@example.com', -# # The smtpserver argument can also include a port number; e.g., -# # smtpserver='mail.example.com:25' -# smtpserver='mail.example.com', -# ) - -# OutputMailer is intended only for testing; it writes the emails to -# the specified file stream. -#mailer = git_multimail.OutputMailer(sys.stdout) - # Read changes from stdin and send notification emails: git_multimail.run_as_post_receive_hook(environment, mailer)
participants (1)
-
tchemit@users.forge.codelutin.com