Received: by mail.netbsd.org (Postfix, from userid 605) id 0D8B984D27; Mon, 4 Nov 2019 18:58:32 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id 896C984CFC for ; Mon, 4 Nov 2019 18:58:31 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([IPv6:::1]) by localhost (mail.netbsd.org [IPv6:::1]) (amavisd-new, port 10025) with ESMTP id CP9fe3qI8x6M for ; Mon, 4 Nov 2019 18:58:31 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.netbsd.org [199.233.217.197]) by mail.netbsd.org (Postfix) with ESMTP id DDCB884CDA for ; Mon, 4 Nov 2019 18:58:30 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id D5BE9FA93; Mon, 4 Nov 2019 18:58:30 +0000 (UTC) Content-Transfer-Encoding: 7bit Content-Type: multipart/mixed; boundary="_----------=_1572893910206110" MIME-Version: 1.0 Date: Mon, 4 Nov 2019 18:58:30 +0000 From: "Roland Illig" Subject: CVS commit: pkgsrc/doc/guide/files To: pkgsrc-changes@NetBSD.org Reply-To: rillig@netbsd.org X-Mailer: log_accum Message-Id: <20191104185830.D5BE9FA93@cvs.NetBSD.org> Sender: pkgsrc-changes-owner@NetBSD.org List-Id: pkgsrc-changes.NetBSD.org Precedence: bulk List-Unsubscribe: This is a multi-part message in MIME format. --_----------=_1572893910206110 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" 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. --_----------=_1572893910206110 Content-Disposition: inline Content-Length: 1420 Content-Transfer-Encoding: binary Content-Type: text/x-diff; charset=us-ascii 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 --_----------=_1572893910206110--