Changeset 1096


Ignore:
Timestamp:
Jun 23, 2011, 10:50:19 PM (6 years ago)
Author:
stefan
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/src/jlatexeditor/tools/PackageParser.scala

    r1095 r1096  
    5757
    5858  def writeXmlFile(packages: MutableList[Package]) {
    59     println("<packages>")
     59    val out = new PrintStream("packages.xml")
     60    out.println("<packages>")
    6061    for (pack <- packages) {
    6162      val debPackageString = pack.debPackage.map( pack => " debPackage=\"" + pack.name + "\"").getOrElse("")
    62       println("  <package name=\"" + pack.name + "\"" + debPackageString + ">")
     63      out.println("  <package name=\"" + pack.name + "\"" + debPackageString + ">")
    6364      for (command <- pack.commands.values) {
    6465        val optArgString = if (command.optionalArgs.isEmpty) "" else " optionalArg=\"" + command.optionalArgs(0) + "\""
    65         println("    <command name=\"" + command.name + "\" argCount=\"" + command.argCount + "\"" + optArgString + " />")
     66        out.println("    <command name=\"" + command.name + "\" argCount=\"" + command.argCount + "\"" + optArgString + " />")
    6667      }
    6768      for (env <- pack.environments.values) {
    6869        val optArgString = if (env.optionalArgs.isEmpty) "" else " optionalArg=\"" + env.optionalArgs(0) + "\""
    69         println("    <environment name=\"" + env.name + "\" argCount=\"" + env.argCount + "\"" + optArgString + " />")
     70        out.println("    <environment name=\"" + env.name + "\" argCount=\"" + env.argCount + "\"" + optArgString + " />")
    7071      }
    71       println("  </package>")
     72      out.println("  </package>")
    7273    }
    73     println("</packages>")
     74    out.println("</packages>")
     75    out.flush()
     76    out.close()
    7477  }
    7578
Note: See TracChangeset for help on using the changeset viewer.