1 #include <boost/filesystem/operations.hpp>
3 #include <boost/python.hpp>
4 namespace py = boost::python;
5 extern "C" void initmussa();
8 using namespace boost::filesystem;
12 #include <QApplication>
14 #include "qui/MussaWindow.hpp"
15 #include "alg/parse_options.hpp"
16 #include "mussa_exceptions.hpp"
18 int main(int argc, char **argv)
22 // if we're under unix and don't have a display, see if we can still run
24 opts.useGUI = getenv("DISPLAY") != 0;
25 if (opts.useGUI == false) {
26 std::clog << "DISPLAY not set, running in console mode only" << std::endl;
30 QApplication app(argc, argv, opts.useGUI);
31 Q_INIT_RESOURCE(icons);
33 initialize_mussa(opts, argc, argv);
35 if (opts.analysis == 0) {
41 if (opts.runAsPythonInterpeter) {
42 PyImport_AppendInittab("mussa", &initmussa);
44 PyRun_InteractiveLoop(stdin, "mussa");
46 #endif /* USE_PYTHON */
48 MussaWindow win(opts.analysis);
53 } catch (mussa_error e) {
55 } catch (boost::filesystem::filesystem_error e) {
59 catch (py::error_already_set e) {
62 #endif /* USE_PYTHON */
63 catch (std::runtime_error e) {
66 qFatal("unrecognized exception");