1 Return-Path: <wking@tremily.us>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id 2D13C431FAE
\r
6 for <notmuch@notmuchmail.org>; Sat, 5 Apr 2014 10:31:44 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
8 X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"
\r
12 X-Spam-Status: No, score=0 tagged_above=-999 required=5
\r
13 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001]
\r
15 Received: from olra.theworths.org ([127.0.0.1])
\r
16 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
17 with ESMTP id XXUaVvQLRY4x for <notmuch@notmuchmail.org>;
\r
18 Sat, 5 Apr 2014 10:31:38 -0700 (PDT)
\r
19 Received: from qmta03.westchester.pa.mail.comcast.net
\r
20 (qmta03.westchester.pa.mail.comcast.net [76.96.62.32])
\r
21 by olra.theworths.org (Postfix) with ESMTP id 77C72431FC2
\r
22 for <notmuch@notmuchmail.org>; Sat, 5 Apr 2014 10:31:28 -0700 (PDT)
\r
23 Received: from omta20.westchester.pa.mail.comcast.net ([76.96.62.71])
\r
24 by qmta03.westchester.pa.mail.comcast.net with comcast
\r
25 id mHWN1n0011YDfWL53HXUS2; Sat, 05 Apr 2014 17:31:28 +0000
\r
26 Received: from odin.tremily.us ([24.18.63.50])
\r
27 by omta20.westchester.pa.mail.comcast.net with comcast
\r
28 id mHXT1n00B152l3L3gHXT2M; Sat, 05 Apr 2014 17:31:28 +0000
\r
29 Received: from mjolnir.tremily.us (unknown [192.168.0.140])
\r
30 by odin.tremily.us (Postfix) with ESMTPS id 01F971103C1D;
\r
31 Sat, 5 Apr 2014 10:31:27 -0700 (PDT)
\r
32 Received: (nullmailer pid 16923 invoked by uid 1000);
\r
33 Sat, 05 Apr 2014 17:31:15 -0000
\r
34 From: "W. Trevor King" <wking@tremily.us>
\r
35 To: notmuch@notmuchmail.org
\r
36 Subject: [PATCH 6/7] doc/prerst2man.py: Convert execfile to import
\r
37 Date: Sat, 5 Apr 2014 10:31:10 -0700
\r
39 <7c43c614cb09665400544fc0928ac14bb67ceeb5.1396718720.git.wking@tremily.us>
\r
40 X-Mailer: git-send-email 1.9.1.353.gc66d89d
\r
41 In-Reply-To: <cover.1396718720.git.wking@tremily.us>
\r
42 References: <cover.1396718720.git.wking@tremily.us>
\r
43 In-Reply-To: <cover.1396718720.git.wking@tremily.us>
\r
44 References: <cover.1396718720.git.wking@tremily.us>
\r
45 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net;
\r
46 s=q20140121; t=1396719088;
\r
47 bh=surGy6r4gr9e//xrzFrd6sbiw4m4FMtByh0+q6ZgS2o=;
\r
48 h=Received:Received:Received:Received:From:To:Subject:Date:
\r
50 b=NBbHUAr9J7jtf89wz9cL5nvdQa+2ccEcUIMsTYTl5FHhz/L/rH1CDq81nKCVM9Y2i
\r
51 WD8EMt81Ra5pqNu5/HoUKQT9PZ8vxcfCeZ03E9tC7kAZMSmi3UbCpZPF6GKZ5ZnR6G
\r
52 Nh5Q3oRNDLWISWkIeHQi96ZTI/ppSssbu9kAY1Ryh6pqGnJ0nt3aI7q77M0M7iynJ0
\r
53 l43KIjWj+7CwWJHEec5gcEIVp8xRD6pRv/uuiDpspqZjjE6b1hagkNPT4X/wiqQfnY
\r
54 MvJsvSeKi2fq9qEmnSFH7HpwgOs7CQYRSOY8AbILHLNJcVcYIFtcnQ+vittk/XLMHu
\r
56 X-BeenThere: notmuch@notmuchmail.org
\r
57 X-Mailman-Version: 2.1.13
\r
59 List-Id: "Use and development of the notmuch mail system."
\r
60 <notmuch.notmuchmail.org>
\r
61 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
62 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
63 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
64 List-Post: <mailto:notmuch@notmuchmail.org>
\r
65 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
66 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
67 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
68 X-List-Received-Date: Sat, 05 Apr 2014 17:31:44 -0000
\r
70 excefile is gone in Python 3 [1]. Instead of exec-ing the
\r
71 configuration, it's easier to insert the source directory in Python's
\r
72 path [2], and just import the configuration. With this change,
\r
73 prerst2man.py is compatible with both Python 2 and 3.
\r
75 [1]: https://docs.python.org/3.0/whatsnew/3.0.html#builtins
\r
76 [2]: https://docs.python.org/3/library/sys.html#sys.path
\r
78 doc/prerst2man.py | 18 ++++++++++--------
\r
79 1 file changed, 10 insertions(+), 8 deletions(-)
\r
81 diff --git a/doc/prerst2man.py b/doc/prerst2man.py
\r
82 index 81ce817..7d78e9b 100644
\r
83 --- a/doc/prerst2man.py
\r
84 +++ b/doc/prerst2man.py
\r
86 -from sys import argv
\r
88 from datetime import date
\r
89 from os.path import dirname, isdir
\r
90 from os import makedirs, system
\r
94 -sourcedir = argv[2]
\r
96 +rst2man = sys.argv[1]
\r
97 +sourcedir = sys.argv[2]
\r
98 +outdir = sys.argv[3]
\r
100 +sys.path.insert(0, sourcedir)
\r
104 if not isdir(outdir):
\r
105 makedirs(outdir, 0o755)
\r
107 -execfile(sourcedir + "/conf.py")
\r
110 def header(file, startdocname, command, description, authors, section):
\r
112 @@ -29,10 +31,10 @@ def header(file, startdocname, command, description, authors, section):
\r
113 '-' * len(description),
\r
115 '-' * len(description),
\r
116 -date.today().isoformat(), release, section, project))
\r
117 +date.today().isoformat(), conf.release, section, conf.project))
\r
119 blankre = re.compile("^\s*$")
\r
120 -for page in man_pages:
\r
121 +for page in conf.man_pages:
\r
122 outdirname = outdir + '/' + dirname(page[0])
\r
123 if not isdir(outdirname):
\r
124 makedirs(outdirname, 0o755)
\r