void outputProject(boolean files, boolean paths, boolean clss, boolean opts, IvyXmlWriter xw) {
    if (xw == null) return;

    xw.begin("PROJECT");
    xw.field("NAME", project_name);
    xw.field("PATH", base_directory.getPath());
    xw.field("WORKSPACE", project_manager.getWorkSpaceDirectory().getPath());
    if (python_interpreter != null) {
      xw.textElement("EXE", python_interpreter.getExecutable().getPath());
    }

    if (paths) {
      for (IPathSpec ps : project_paths) {
        ps.outputXml(xw);
      }
    }
    if (files) {
      for (IFileSpec fs : project_files) {
        fs.outputXml(xw);
      }
    }

    if (opts) pybase_prefs.outputXml(xw, true);

    xw.end("PROJECT");
  }
  void setupDefaults() {
    python_interpreter = project_manager.findInterpreter(null);
    if (python_interpreter == null) PybaseMain.logE("No interpreter found");
    else PybaseMain.logD("Found interpreter " + python_interpreter.getName());

    File src = new File(base_directory, "src");
    if (src.isDirectory() || src.mkdir()) {
      File rsrc = new File("/src");
      IPathSpec ps = project_manager.createPathSpec(rsrc, true, true, true);
      project_paths.add(ps);
    }
  }
 void outputXml(IvyXmlWriter xw) {
   xw.begin("PROJECT");
   xw.field("NAME", project_name);
   xw.field("BASE", base_directory.getPath());
   if (python_interpreter != null) {
     xw.textElement("EXE", python_interpreter.getExecutable().getPath());
   }
   for (IPathSpec ps : project_paths) {
     ps.outputXml(xw);
   }
   for (IFileSpec fs : project_files) {
     fs.outputXml(xw);
   }
   pybase_prefs.outputXml(xw, false);
   xw.end("PROJECT");
 }
 String getVersionName() {
   String nm = python_interpreter.getPythonVersion().toString();
   if (nm.startsWith("VERSION_")) nm = nm.substring(8);
   nm = nm.replace("_", ".");
   return "python " + nm;
 }
 PybaseVersion getVersion() {
   return python_interpreter.getPythonVersion();
 }
 public File getBinary() {
   return python_interpreter.getExecutable();
 }