This is an automated email from the ASF dual-hosted git repository.
sbp pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tooling-trusted-release.git
The following commit(s) were added to refs/heads/main by this push:
new 986db9c Indicate whether a file is recognised as an artifact or
metadata
986db9c is described below
commit 986db9cfa49425ebc00f195163c63f8f74c63595
Author: Sean B. Palmer <[email protected]>
AuthorDate: Fri Mar 21 16:09:03 2025 +0200
Indicate whether a file is recognised as an artifact or metadata
---
atr/routes/files.py | 11 +++++++++++
atr/templates/files-list.html | 10 +++++++++-
2 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/atr/routes/files.py b/atr/routes/files.py
index 9bd24ab..4186379 100644
--- a/atr/routes/files.py
+++ b/atr/routes/files.py
@@ -20,6 +20,7 @@
from __future__ import annotations
import os
+import re
from typing import TYPE_CHECKING, Any, Final, NoReturn, Protocol, TypeVar
import aiofiles.os
@@ -205,6 +206,8 @@ async def root_files_list(session: CommitterSession,
project_name: str, version_
paths = await _paths_recursive_list(base_path)
path_templates = {}
path_substitutions = {}
+ path_artifacts = set()
+ path_metadata = set()
for path in paths:
elements = {
"core": project_name,
@@ -223,6 +226,12 @@ async def root_files_list(session: CommitterSession,
project_name: str, version_
path_substitutions[path] = ", ".join(subs)
else:
path_substitutions[path] = "none"
+ search = re.search(analysis.extension_pattern(), path)
+ if search:
+ if search.group("archiveonly"):
+ path_artifacts.add(path)
+ elif search.group("metadata"):
+ path_metadata.add(path)
return await quart.render_template(
"files-list.html",
@@ -234,4 +243,6 @@ async def root_files_list(session: CommitterSession,
project_name: str, version_
server_domain=session.host,
templates=path_templates,
substitutions=path_substitutions,
+ artifacts=path_artifacts,
+ metadata=path_metadata,
)
diff --git a/atr/templates/files-list.html b/atr/templates/files-list.html
index ad41ee4..0ae9e78 100644
--- a/atr/templates/files-list.html
+++ b/atr/templates/files-list.html
@@ -64,7 +64,15 @@
<tbody>
{% for path in paths %}
<tr>
- <td>{{ path }}</td>
+ <td>
+ {% if path in artifacts %}
+ <strong>{{ path }}</strong>
+ {% elif path in metadata %}
+ <em>{{ path }}</em>
+ {% else %}
+ {{ path }}
+ {% endif %}
+ </td>
<td>{{ templates[path] }}</td>
<td>{{ substitutions[path] }}</td>
</tr>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]