You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@steve.apache.org by ti...@apache.org on 2026/02/28 03:35:36 UTC
(steve) branch display updated (c663c32 -> 299fb67)
This is an automated email from the ASF dual-hosted git repository.
tison pushed a change to branch display
in repository https://gitbox.apache.org/repos/asf/steve.git
discard c663c32 uv run ruff format
add f0b7234 Merge pull request #83 from apache/display
new 299fb67 uv run ruff format
This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version. This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:
* -- * -- B -- O -- O -- O (c663c32)
\
N -- N -- N refs/heads/display (299fb67)
You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.
Any revisions marked "omit" are not gone; other references still
refer to them. Any revisions marked "discard" are gone forever.
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
(steve) 01/01: uv run ruff format
Posted by ti...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
tison pushed a commit to branch display
in repository https://gitbox.apache.org/repos/asf/steve.git
commit 299fb677383a4a1c468306e93c1404152f681995
Author: tison <wa...@gmail.com>
AuthorDate: Sat Feb 28 11:34:16 2026 +0800
uv run ruff format
Signed-off-by: tison <wa...@gmail.com>
---
v3/server/bin/mail-voters.py | 36 ++++++++++++++++--------------------
1 file changed, 16 insertions(+), 20 deletions(-)
diff --git a/v3/server/bin/mail-voters.py b/v3/server/bin/mail-voters.py
index b1a2ed2..1fca181 100755
--- a/v3/server/bin/mail-voters.py
+++ b/v3/server/bin/mail-voters.py
@@ -43,20 +43,20 @@ def main(eid, template_file):
"""
# Load the election
election = steve.election.Election(DB_FNAME, eid)
-
+
# Get metadata for context
metadata = election.get_metadata()
-
+
# Get list of eligible voters
voters = election.get_voters_for_email()
-
+
if not voters:
- _LOGGER.info(f"No eligible voters found for election {eid}")
+ _LOGGER.info(f'No eligible voters found for election {eid}')
return
-
+
# Load the EZT template
template = ezt.Template(template_file)
-
+
# Send email to each voter
for voter in voters:
# Prepare data dictionary for template rendering
@@ -64,22 +64,22 @@ def main(eid, template_file):
'voter': voter, # edict with pid, name, email
'election': metadata, # edict with eid, title, owner_pid, etc.
}
-
+
# Render the template to a StringIO stream
output = io.StringIO()
template.generate(output, data)
rendered_body = output.getvalue()
-
+
# Send the email
asfpy.messaging.mail(
- sender="Apache Election Platform <vo...@apache.org>",
+ sender='Apache Election Platform <vo...@apache.org>',
recipient=voter.email,
- subject=f"Vote in Election: {metadata.title}",
+ subject=f'Vote in Election: {metadata.title}',
message=rendered_body,
# Add other parameters as needed (e.g., auth, headers)
)
-
- _LOGGER.info(f"Sent email to {voter.email} for election {eid}")
+
+ _LOGGER.info(f'Sent email to {voter.email} for election {eid}')
if __name__ == '__main__':
@@ -87,18 +87,14 @@ if __name__ == '__main__':
parser = argparse.ArgumentParser(
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
- description="Send emails to eligible voters for a given election."
- )
- parser.add_argument(
- '--eid',
- required=True,
- help='Election ID to send emails for.'
+ description='Send emails to eligible voters for a given election.',
)
+ parser.add_argument('--eid', required=True, help='Election ID to send emails for.')
parser.add_argument(
'--template',
required=True,
- help='Path to the .ezt template file for email body.'
+ help='Path to the .ezt template file for email body.',
)
args = parser.parse_args()
-
+
main(args.eid, args.template)