Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 68E3B431FC4 for ; Sat, 5 Apr 2014 10:31:33 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Tw31mttj7b9f for ; Sat, 5 Apr 2014 10:31:26 -0700 (PDT) Received: from QMTA11.westchester.pa.mail.comcast.net (qmta11.westchester.pa.mail.comcast.net [76.96.59.211]) by olra.theworths.org (Postfix) with ESMTP id DC7D4431FAF for ; Sat, 5 Apr 2014 10:31:25 -0700 (PDT) Received: from omta02.westchester.pa.mail.comcast.net ([76.96.62.19]) by QMTA11.westchester.pa.mail.comcast.net with comcast id mGB21n0040QuhwU5BHXRaE; Sat, 05 Apr 2014 17:31:25 +0000 Received: from odin.tremily.us ([24.18.63.50]) by omta02.westchester.pa.mail.comcast.net with comcast id mHXQ1n00T152l3L3NHXRNP; Sat, 05 Apr 2014 17:31:25 +0000 Received: from mjolnir.tremily.us (unknown [192.168.0.140]) by odin.tremily.us (Postfix) with ESMTPS id 3206D1103C12; Sat, 5 Apr 2014 10:31:24 -0700 (PDT) Received: (nullmailer pid 16913 invoked by uid 1000); Sat, 05 Apr 2014 17:31:15 -0000 From: "W. Trevor King" To: notmuch@notmuchmail.org Subject: [PATCH 1/7] doc/mkdocdeps.py: Convert execfile to import Date: Sat, 5 Apr 2014 10:31:05 -0700 Message-Id: <8d518408f2da8bc96ae3123f05791142da26b9bc.1396718720.git.wking@tremily.us> X-Mailer: git-send-email 1.9.1.353.gc66d89d In-Reply-To: References: In-Reply-To: References: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20140121; t=1396719085; bh=hna/xxGjPPXp+BaF7YqRVNPn6WIgCOnieHoUQV75lgA=; h=Received:Received:Received:Received:From:To:Subject:Date: Message-Id; b=uMmaG4tEPbR/zUUbjEfK/V7EPRQZDW40CveJCqAYFaqe/W3g7QdErCbI6DfnFRsxg pdxkaGioohZcmoqd+0MscXqH+3MovRvmGhbJylhfUHWjKdZbVcnXt6zajYSfXo1Vs6 uzdu1J2C/gcaXywlp/rZJqHAv4Qg78zwxrr5/+eH0loryDhQ3/m0afhbJvEJSL6/EC zte8fbfShAMBa411IqROYQkxc6eNh9Kza+5hEyTt2KI4RU8NruAlmKGOotbfFoSuRE /vWxC4nGHH/vNE1fKCy/LJkLXClTF2dAQbJqEc3Myo6BO6gZQGaWBrwSDFVPRc/r+F ipc80js3BHJRQ== X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Apr 2014 17:31:33 -0000 excefile is gone in Python 3 [1]. Instead of exec-ing the configuration, it's easier to insert the source directory in Python's path [2], and just import the configuration. With this change, mkdocdeps.py is compatible with both Python 2 and 3. [1]: https://docs.python.org/3.0/whatsnew/3.0.html#builtins [2]: https://docs.python.org/3/library/sys.html#sys.path --- doc/mkdocdeps.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/doc/mkdocdeps.py b/doc/mkdocdeps.py index 71bd135..de1cbb8 100644 --- a/doc/mkdocdeps.py +++ b/doc/mkdocdeps.py @@ -1,15 +1,16 @@ -from sys import argv -srcdir = argv[1] -builddir = argv[2] -outfile = argv[3] +import sys -execfile(srcdir + '/conf.py') +srcdir = sys.argv[1] +builddir = sys.argv[2] +outfile = sys.argv[3] +sys.path.insert(0, srcdir) +import conf roff_files = [] rst_files = [] out=open(outfile,'w') -for page in man_pages: +for page in conf.man_pages: rst_files = rst_files + ["{0:s}/{1:s}.rst".format(srcdir,page[0])] roff_files = roff_files + ["{0:s}/man/{1:s}.{2:d}".format(builddir,page[0],page[4])] -- 1.9.1.353.gc66d89d