[pypy-svn] rev 1517 - pypy/trunk/doc/funding/makedoc

tismer at codespeak.net tismer at codespeak.net
Thu Oct 2 10:25:07 CEST 2003


Author: tismer
Date: Thu Oct  2 10:25:05 2003
New Revision: 1517

Removed:
   pypy/trunk/doc/funding/makedoc/mkdoclist.py
Modified:
   pypy/trunk/doc/funding/makedoc/part_b.pdf
   pypy/trunk/doc/funding/makedoc/part_b.sxw
   pypy/trunk/doc/funding/makedoc/prep_part_b.sxw
Log:
solved numbering probs, looks quite good already

Deleted: /pypy/trunk/doc/funding/makedoc/mkdoclist.py
==============================================================================
--- /pypy/trunk/doc/funding/makedoc/mkdoclist.py	Thu Oct  2 10:25:05 2003
+++ (empty file)
@@ -1,146 +0,0 @@
-import os, sys, re
-
-tempfiles = []
-class tempfile(file):
-    def __init__(self, name, *args, **kw):
-        tempfiles.append(name)
-        file.__init__(self, name, *args, **kw)
-
-def get_file_list():
-    flis = os.listdir("..")
-    pat = "[bB][0-9].[0-9]"
-    lis = []
-    for name in flis:
-        if re.match(pat, name):
-            pre, post = os.path.splitext(name)
-            if post.lower() == ".txt":
-                lis.append(pre)
-    lis.sort()
-    return lis
-
-HEAD1 = [
-    ":DELETE:BEGIN",
-    "",
-    "fake toplevel",
-    ".............",
-    "",
-    ":DELETE:END",
-    "",
-    ]
-
-HEAD2 = [
-    ":DELETE:BEGIN",
-    "",
-    "fake toplevel",
-    ".............",
-    "fake sublevel",
-    "'''''''''''''",
-    "",
-    ":DELETE:END",
-    "",
-    ]
-    
-
-def mangle_wp_file(txt, name):
-    lines = txt.split("\n")
-    for line in lines:
-        if line.startswith(".. |wp|"):
-            break
-    else:
-        # no WP file
-        pat = "[bB][0-9].0"
-        if re.match(pat, name):
-            head = HEAD1
-        else:
-            head = HEAD2
-        lines[:0] = head
-        txt = "\n".join(lines)
-        return txt
-    #.. |wp|    replace:: WP21
-    wp = line.split()[-1]
-    # make a local target
-    lines[:0] =[
-        ":DELETE:BEGIN",
-        "",
-        "fake toplevel",
-        ".............",
-        "fake sublevel",
-        "'''''''''''''",
-        "",
-        "This is the anchor %s_" % wp,
-        "",
-        ":DELETE:END",
-        "",
-        ".. _%s:" % wp.lower(),
-        "",
-        ]
-    # merge the crossref file in, with modifications
-    for line in lines:
-        if line.startswith(".. include:: crossreferences.asc"):
-            break
-    inset = []
-    matchline = line
-    for line in file("crossreferences.asc"):
-        parts = line.split()
-        if len(parts)>=2 and parts[1] == "_%s:" % wp:
-            continue
-        inset.append(line.rstrip())
-    p = lines.index(matchline)
-    lines[p:p+1] = inset
-    txt = "\n".join(lines)
-    return txt
-
-def make_new_files(names):
-    for name in names:
-        txt = file(os.path.join("..", name+".txt")).read()
-        txt = mangle_wp_file(txt, name)
-        tempfile(name+".txt", "w").write(txt)
-
-def make_doc_list(names):
-    f = tempfile("doclist.asc", "w")
-    for name in names:
-        print>>f, "%s.html" % name
-
-def build_xref_file():
-    lines = file("../crossreferences.asc").readlines()
-    for i in range(len(lines)):
-        parts = lines[i].split()
-        if len(parts) >= 2:
-            if parts[0] == ".." and parts[1].startswith("_") and parts[1].endswith(":"):
-                txt = parts[1][1:-1]
-                lines[i] = "%s %s %s\n" % (parts[0], parts[1], "#"+txt.lower())
-    tempfile("crossreferences.asc", "w").writelines(lines)
-
-def copy_ascfiles():
-    for name in os.listdir(".."):
-        if name.startswith("wp-") and name.endswith(".asc"):
-            tempfile(name, "w").write(file(os.path.join("..", name)).read())
-
-def create_oo_doc():
-    from win32com.client import Dispatch
-    objServiceManager= Dispatch("com.sun.star.ServiceManager")
-    objDesktop= objServiceManager.createInstance("com.sun.star.frame.Desktop")
-    objDocument= objDesktop.loadComponentFromURL(r"file:///D|/pypy/trunk/doc/funding/makedoc/prep_part_b.sxw", "_blank", 0, ())
-    #wonder = objDesktop.loadComponentFromURL(r"macro://./Standard.test_import.build_doc", "_blank", 0, ())
-    prog = r"E:\Programme\OpenOffice.org1.1.0\program\soffice.exe"
-    args = "macro://./Standard.test_import.build_doc"
-    os.system(prog+" "+args)
-    objDocument.close(1)   # 1 = give up ownership
-
-def make_doc():
-    build_xref_file()
-    copy_ascfiles()
-    names = get_file_list()
-    make_new_files(names)
-    make_doc_list(names)
-    os.system("python d:/python22/docutils/tools/buildhtml.py --no-xml-declaration")
-    #return
-    create_oo_doc()
-    for name in tempfiles:
-        os.unlink(name)
-        if name.endswith(".txt"):
-            os.unlink(os.path.splitext(name)[0]+".html")
-    os.system("python zipmod.py part_b.sxw")
-
-if __name__ == "__main__":
-    make_doc()
\ No newline at end of file

Modified: pypy/trunk/doc/funding/makedoc/part_b.pdf
==============================================================================
Binary files. No diff available.

Modified: pypy/trunk/doc/funding/makedoc/part_b.sxw
==============================================================================
Binary files. No diff available.

Modified: pypy/trunk/doc/funding/makedoc/prep_part_b.sxw
==============================================================================
Binary files. No diff available.


More information about the Pypy-commit mailing list