private void initFactory() {
    try {
      String theScript =
          Utils.readInputStream(FormatterFactory.class.getResourceAsStream("formatter.py"));
      itsInterpreter = new PythonInterpreter();
      itsInterpreter.setLocals(new PyStringMap());
      itsInterpreter.exec(theScript);

      PyObject f = itsInterpreter.get("factory");
      itsFactory = (IPyFormatterFactory) f.__tojava__(IPyFormatterFactory.class);
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
  }