#pragma once

#include <string>

#include "boost/python/object_fwd.hpp"

enum pp_status {
    PLUGIN_NO_SECTION = -1,
    PLUGIN_OK = 0,
    PLUGIN_NO_CALLABLE = 1,
    PLUGIN_EXCEPTION = 2
};

std::string handle_pyerror();

class PythonPlugin {
public:
    static PythonPlugin *instantiate(struct _inittab * = nullptr);
    int configure(const char * = nullptr, const char * = nullptr) { return PLUGIN_NO_SECTION; }
    bool is_callable(const char *, const char *) { return false; }
    int call(const char *, const char *, boost::python::object, boost::python::object,
             boost::python::object &) { return PLUGIN_NO_CALLABLE; }
    int run_string(const char *, boost::python::object &, bool = false) { return PLUGIN_NO_CALLABLE; }
    int call_method(boost::python::object, boost::python::object &) { return PLUGIN_NO_CALLABLE; }
    int plugin_status() const { return PLUGIN_NO_SECTION; }
    bool usable() const { return false; }
    int initialize() { return PLUGIN_NO_SECTION; }
    const std::string &last_exception() const {
        static std::string empty;
        return empty;
    }
    const std::string &last_errmsg() const {
        static std::string empty;
        return empty;
    }

    boost::python::object main_namespace;
};
