pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/doc/guide/files doc/guide: fix type hinting in the pla...
details: https://anonhg.NetBSD.org/pkgsrc/rev/6cce4f14f7b0
branches: trunk
changeset: 417136:6cce4f14f7b0
user: rillig <rillig%pkgsrc.org@localhost>
date: Mon Nov 04 18:58:30 2019 +0000
description:
doc/guide: fix type hinting in the placeholders utility
diffstat:
doc/guide/files/fill-placeholders.py | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diffs (37 lines):
diff -r 77a36eadad92 -r 6cce4f14f7b0 doc/guide/files/fill-placeholders.py
--- a/doc/guide/files/fill-placeholders.py Mon Nov 04 18:56:28 2019 +0000
+++ b/doc/guide/files/fill-placeholders.py Mon Nov 04 18:58:30 2019 +0000
@@ -1,5 +1,5 @@
#! python
-# $NetBSD: fill-placeholders.py,v 1.1 2019/05/05 18:36:05 rillig Exp $
+# $NetBSD: fill-placeholders.py,v 1.2 2019/11/04 18:58:30 rillig Exp $
"""
Fills in some sections of data that are determined directly from the
@@ -10,7 +10,7 @@
import os
import re
import sys
-from typing import List, Match
+from typing import Callable, List, Match, Set
from xml.sax.saxutils import escape as to_xml
pkgsrcdir = os.environ['PKGSRCDIR']
@@ -38,7 +38,7 @@
sites = []
for line in read_lines(f'{pkgsrcdir}/mk/fetch/sites.mk'):
- m = re.match(r'^(MAS\w+)', line)
+ m = re.match(r'^(MASTER_SITE_\w+)', line)
if m:
sites.append(m[1])
@@ -50,7 +50,7 @@
return '\n'.join(out)
-def process(filename: str, placeholders: set):
+def process(filename: str, placeholders: Set[Callable[[], str]]):
tmpl_filename = f'{filename}.tmpl'
tmp_filename = f'{filename}.tmp'
in_filename = tmpl_filename if os.path.isfile(tmpl_filename) else filename
Home |
Main Index |
Thread Index |
Old Index