pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/doc/guide/files



Module Name:    pkgsrc
Committed By:   rillig
Date:           Mon Nov  4 18:58:30 UTC 2019

Modified Files:
        pkgsrc/doc/guide/files: fill-placeholders.py

Log Message:
doc/guide: fix type hinting in the placeholders utility


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 pkgsrc/doc/guide/files/fill-placeholders.py

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/doc/guide/files/fill-placeholders.py
diff -u pkgsrc/doc/guide/files/fill-placeholders.py:1.1 pkgsrc/doc/guide/files/fill-placeholders.py:1.2
--- pkgsrc/doc/guide/files/fill-placeholders.py:1.1     Sun May  5 18:36:05 2019
+++ pkgsrc/doc/guide/files/fill-placeholders.py Mon Nov  4 18:58:30 2019
@@ -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 filecmp
 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 @@ def master_sites() -> str:
     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 @@ def master_sites() -> str:
     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