[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] PATCH makeref.py
- To: pygame-users@xxxxxxxx
- Subject: Re: [pygame] PATCH makeref.py
- From: "René Dudfield" <renesd@xxxxxxxxx>
- Date: Sat, 4 Aug 2007 17:39:10 +1000
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: pygame-users-outgoing@xxxxxxxx
- Delivered-to: pygame-users@xxxxxxxx
- Delivery-date: Sat, 04 Aug 2007 03:39:19 -0400
- Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=agwg8X6G8NoertVaGEHFnlOZQbCf7r3BCMiMzoIXQ8QjYMvbhuaO/0THFHjjbZjQS6tciF3NJm5crtOCXxJXavu5GiiZmf0NKXLwt4Y3PYtsWort4o6bwtpbSbwOMW9iLt4pV/g20OTCulaTOvuLZCknnP79YRXk6MUT6lT1ecg=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=FD+eKWr0zu5wbtUClOKJ2Rr2r10dEgkmtObdaEWo/8in+9kUQMBGxYdJPNT0kZBaZ/ozZtFiCURcvZOliOi3SAWIiDBwNPdfu06XYWRl85iKbedpoS6rKeX77QrjUAFD4o5uxvqDbl4g3LbpbJZsnIjeHZeBzGN3fcslqkZpIZY=
- In-reply-to: <46B42B4A.6050101@xxxxxxxxxx>
- References: <46B42B4A.6050101@xxxxxxxxxx>
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
cool, thanks.
I think it was just written incorrectly because it was used only from
unix. I can't see any reason for not using os.path.join.
Committed revision 1027.
On 8/4/07, DR0ID <dr0id@xxxxxxxxxx> wrote:
> Hello
>
>
> yesterday I wanted to make the new documentation for the SVN pygame and
> found that the makeref.py does not work under windows. I found out that
> it is because the paths where hardcoded like this "src/pygame.doc"
> instead of using os.path.join("src", "pygame.doc"). Is there a reason to
> not use os.path.join() ? If not I have added the patch to change all
> paths to use os.path.join()
>
>
> ~DR0ID
>
> Index: makeref.py
> ===================================================================
> --- makeref.py (revision 1026)
> +++ makeref.py (working copy)
> @@ -19,14 +19,16 @@
>
> def Run():
> # get files and shuffle ordering
> - files = glob.glob('src/*.doc') + glob.glob('lib/*.doc')
> - files.remove("src/pygame.doc")
> + files = glob.glob(os.path.join('src','*.doc')) + glob.glob(os.path.join('lib','*.doc'))
> + for file in files:
> + print file
> + files.remove(os.path.join("src","pygame.doc"))
>
> #XXX: sort(key=) is only available in >= python2.4
> #files.sort(key=sortkey)
> files = sort_list_by_keyfunc(files, sortkey)
>
> - files.insert(0, "src/pygame.doc")
> + files.insert(0, os.path.join("src","pygame.doc"))
> docs = []
> pages = []
> for f in files:
> @@ -47,7 +49,7 @@
> MakeIndex(name, doc, index)
>
> for name, doc in docs:
> - fullname = "docs/ref/%s.html" % name
> + fullname = os.path.join("docs","ref","%s.html") % name
> outFile = open(fullname, "w")
> outFile.write(HTMLHeader % name)
> WritePageLinks(outFile, pages)
> @@ -56,14 +58,14 @@
> outFile.write(HTMLFinish)
> outFile.close()
>
> - outFile = open("src/pygamedocs.h", "w")
> + outFile = open(os.path.join("src","pygamedocs.h"), "w")
> outFile.write("/* Auto generated file: with makeref.py . Docs go in src/ *.doc . */\n")
> for doc in justDocs:
> WriteDocHeader(outFile, doc)
>
> topDoc = LayoutDocs(justDocs)
>
> - outFile = open("docs/ref/index.html", "w")
> + outFile = open(os.path.join("docs","ref","index.html"), "w")
> outFile.write(HTMLHeader % "Index")
> WritePageLinks(outFile, pages)
> outFile.write(HTMLMid)
>
>