diff options
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/API/SConscript | 6 | ||||
-rw-r--r-- | Documentation/SConscript | 2 | ||||
-rw-r--r-- | Documentation/SwiftAPI/SConscript | 6 | ||||
-rw-r--r-- | Documentation/SwiftUserGuide/SConscript | 2 | ||||
-rw-r--r-- | Documentation/SwiftenDevelopersGuide/Examples/EchoBot/SConscript | 8 | ||||
-rw-r--r-- | Documentation/SwiftenDevelopersGuide/SConscript | 138 |
6 files changed, 81 insertions, 81 deletions
diff --git a/Documentation/API/SConscript b/Documentation/API/SConscript index df20b27..a8a8b1b 100644 --- a/Documentation/API/SConscript +++ b/Documentation/API/SConscript @@ -1,6 +1,6 @@ Import("env") if "doc" in ARGUMENTS : - myenv = env.Clone() - myenv.Tool("DoxyGen", toolpath = ["#/BuildTools/SCons/Tools"]) - myenv.DoxyGen("Doxyfile") + myenv = env.Clone() + myenv.Tool("DoxyGen", toolpath = ["#/BuildTools/SCons/Tools"]) + myenv.DoxyGen("Doxyfile") diff --git a/Documentation/SConscript b/Documentation/SConscript index 161cd83..e2f6393 100644 --- a/Documentation/SConscript +++ b/Documentation/SConscript @@ -1,4 +1,4 @@ Import("env") if env["SCONS_STAGE"] == "build" : - SConscript(dirs = ["SwiftenDevelopersGuide", "SwiftUserGuide", "API", "SwiftAPI"]) + SConscript(dirs = ["SwiftenDevelopersGuide", "SwiftUserGuide", "API", "SwiftAPI"]) diff --git a/Documentation/SwiftAPI/SConscript b/Documentation/SwiftAPI/SConscript index df20b27..a8a8b1b 100644 --- a/Documentation/SwiftAPI/SConscript +++ b/Documentation/SwiftAPI/SConscript @@ -1,6 +1,6 @@ Import("env") if "doc" in ARGUMENTS : - myenv = env.Clone() - myenv.Tool("DoxyGen", toolpath = ["#/BuildTools/SCons/Tools"]) - myenv.DoxyGen("Doxyfile") + myenv = env.Clone() + myenv.Tool("DoxyGen", toolpath = ["#/BuildTools/SCons/Tools"]) + myenv.DoxyGen("Doxyfile") diff --git a/Documentation/SwiftUserGuide/SConscript b/Documentation/SwiftUserGuide/SConscript index 50f60bc..1577b83 100644 --- a/Documentation/SwiftUserGuide/SConscript +++ b/Documentation/SwiftUserGuide/SConscript @@ -11,5 +11,5 @@ import sys, re, os.path ################################################################################ if "doc" in ARGUMENTS : - env.DocBook("Swift Users Guide.xml") + env.DocBook("Swift Users Guide.xml") diff --git a/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/SConscript b/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/SConscript index f3cb0d7..268ab9a 100644 --- a/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/SConscript +++ b/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/SConscript @@ -7,11 +7,11 @@ example_env.UseFlags(example_env["SWIFTEN_DEP_FLAGS"]) # Precompile Swiften header # This is useful to slightly speed up compilation. # if example_env["PLATFORM"] == "win32": -# example_env.WriteVal("Swiften.cpp", example_env.Value("#include <Swiften/Swiften.h>\n")) -# example_env["PCH"] = example_env.PCH("Swiften.cpp")[0] -# example_env["PCHSTOP"] = "Swiften/Swiften.h" +# example_env.WriteVal("Swiften.cpp", example_env.Value("#include <Swiften/Swiften.h>\n")) +# example_env["PCH"] = example_env.PCH("Swiften.cpp")[0] +# example_env["PCHSTOP"] = "Swiften/Swiften.h" for i in range(1,7) : - example_env.Program("EchoBot" + str(i), ["EchoBot" + str(i) + ".cpp"]) + example_env.Program("EchoBot" + str(i), ["EchoBot" + str(i) + ".cpp"]) example_env.Program("EchoBot0x", "EchoBot0x.cpp") example_env.Program("EchoComponent", "EchoComponent.cpp") diff --git a/Documentation/SwiftenDevelopersGuide/SConscript b/Documentation/SwiftenDevelopersGuide/SConscript index ba0eb0b..ac7c67a 100644 --- a/Documentation/SwiftenDevelopersGuide/SConscript +++ b/Documentation/SwiftenDevelopersGuide/SConscript @@ -9,89 +9,89 @@ env.Tool("DocBook", toolpath = ["#/BuildTools/DocBook/SCons"]) import sys, re, os.path def generateDocBookCode(env, target, source) : - # Strips empty lines from the beginning & end of a program - def stripEmptyLines(program) : - programLines = program.split('\n') - newProgramLines = [] - inProgram = False - for line in programLines : - if not re.match("^\s*$", line) or inProgram : - inProgram = True - newProgramLines.append(line) - return '\n'.join(newProgramLines).rstrip() + # Strips empty lines from the beginning & end of a program + def stripEmptyLines(program) : + programLines = program.split('\n') + newProgramLines = [] + inProgram = False + for line in programLines : + if not re.match("^\s*$", line) or inProgram : + inProgram = True + newProgramLines.append(line) + return '\n'.join(newProgramLines).rstrip() - def createCallouts(program, calloutPrefix) : - newProgramLines = [] - calloutLines = [] - nextID = 0 - for line in program.split("\n") : - # FIXME: Takes the largest match - m = re.match(".*\/* \(\*\) (.*) \*/.*", line) - if m : - cobID = "cob-" + calloutPrefix + "-" + str(nextID) - coID = "co-" + calloutPrefix + "-" + str(nextID) - nextID += 1 - line = re.sub("/\*.*\*/", "]]><co id=\"%(cobID)s\" linkends=\"%(coID)s\"/><![CDATA[" % {"cobID" : cobID, "coID" : coID}, line) - calloutLines.append("<callout arearefs=\"%(cobID)s\" id=\"%(coID)s\"><para>%(text)s</para></callout>" % {"cobID": cobID, "coID": coID, "text": m.group(1)}) - newProgramLines.append(line) - callouts = "" - if len(calloutLines) > 0 : - callouts = "<calloutlist>" + "\n".join(calloutLines) + "</calloutlist>" - return ("\n".join(newProgramLines), callouts) + def createCallouts(program, calloutPrefix) : + newProgramLines = [] + calloutLines = [] + nextID = 0 + for line in program.split("\n") : + # FIXME: Takes the largest match + m = re.match(".*\/* \(\*\) (.*) \*/.*", line) + if m : + cobID = "cob-" + calloutPrefix + "-" + str(nextID) + coID = "co-" + calloutPrefix + "-" + str(nextID) + nextID += 1 + line = re.sub("/\*.*\*/", "]]><co id=\"%(cobID)s\" linkends=\"%(coID)s\"/><![CDATA[" % {"cobID" : cobID, "coID" : coID}, line) + calloutLines.append("<callout arearefs=\"%(cobID)s\" id=\"%(coID)s\"><para>%(text)s</para></callout>" % {"cobID": cobID, "coID": coID, "text": m.group(1)}) + newProgramLines.append(line) + callouts = "" + if len(calloutLines) > 0 : + callouts = "<calloutlist>" + "\n".join(calloutLines) + "</calloutlist>" + return ("\n".join(newProgramLines), callouts) - # Parse program - filename = source[0].abspath - filenameBase = os.path.basename(filename).replace(".cpp", "") - inputfile = open(filename) - program = "" - programs = {} - programName = "" - inEllipsis = False - for line in inputfile.readlines() : - if inEllipsis : - if "//..." in line : - inEllipsis = False - else : - if line.startswith("/*") or line.startswith(" *") : - continue - if "//..." in line : - inEllipsis = True - line = line.replace("//...", "]]>…<![CDATA[") - else : - m = re.match("^/// (.*)", line) - if m : - if programName : - programs[programName] = program - program = "" - programName = m.group(1).strip().replace(" ", "") - continue - line = re.sub("\t", " ", line) - program += line - programs[programName] = program - inputfile.close() + # Parse program + filename = source[0].abspath + filenameBase = os.path.basename(filename).replace(".cpp", "") + inputfile = open(filename) + program = "" + programs = {} + programName = "" + inEllipsis = False + for line in inputfile.readlines() : + if inEllipsis : + if "//..." in line : + inEllipsis = False + else : + if line.startswith("/*") or line.startswith(" *") : + continue + if "//..." in line : + inEllipsis = True + line = line.replace("//...", "]]>…<![CDATA[") + else : + m = re.match("^/// (.*)", line) + if m : + if programName : + programs[programName] = program + program = "" + programName = m.group(1).strip().replace(" ", "") + continue + line = re.sub("\t", " ", line) + program += line + programs[programName] = program + inputfile.close() - for programName, program in programs.items() : - program = stripEmptyLines(program) - (program, callouts) = createCallouts(program, filenameBase + "-" + programName) + for programName, program in programs.items() : + program = stripEmptyLines(program) + (program, callouts) = createCallouts(program, filenameBase + "-" + programName) - document = "<foo><programlisting><![CDATA[" + program + "]]></programlisting>" + callouts + "</foo>" + document = "<foo><programlisting><![CDATA[" + program + "]]></programlisting>" + callouts + "</foo>" - # Generate code - output = open(target[0].abspath, 'w') - output.write(document) - output.close() + # Generate code + output = open(target[0].abspath, 'w') + output.write(document) + output.close() ################################################################################ if "doc" in ARGUMENTS : - env.DocBook("Swiften Developers Guide.xml") + env.DocBook("Swiften Developers Guide.xml") sources = [] for i in range(1, 7) : - sources.append("Examples/EchoBot/EchoBot" + str(i) + ".cpp") + sources.append("Examples/EchoBot/EchoBot" + str(i) + ".cpp") sources.append("Examples/EchoBot/EchoBot0x.cpp") sources += ["Examples/EchoBot/" + i for i in ["EchoPayloadParserFactory.h", "EchoPayloadSerializer.h", "EchoPayload.h", "EchoComponent.cpp"]] for source in sources : - env.Command(source + ".xml", source, Action(generateDocBookCode, cmdstr = "$GENCOMSTR")) + env.Command(source + ".xml", source, Action(generateDocBookCode, cmdstr = "$GENCOMSTR")) SConscript(dirs = ["Examples"]) |