Missing ini files
This commit is contained in:
parent
c28f983c3f
commit
ab000dd92a
@ -458,42 +458,41 @@ typedef MooPluginLoaderClass MooPythonPluginLoaderClass;
|
||||
G_DEFINE_TYPE (MooPythonPluginLoader, _moo_python_plugin_loader, MOO_TYPE_PLUGIN_LOADER)
|
||||
|
||||
|
||||
// static gboolean
|
||||
// push_path_dir (const char *filename)
|
||||
// {
|
||||
// PyObject *sys = NULL, *path = NULL;
|
||||
// char *dirname;
|
||||
//
|
||||
// /* XXX encoding */
|
||||
// dirname = g_path_get_dirname (filename);
|
||||
// g_return_val_if_fail (dirname != NULL, FALSE);
|
||||
//
|
||||
// sys = PyImport_ImportModule ((char*) "sys");
|
||||
//
|
||||
// if (sys)
|
||||
// path = PyObject_GetAttrString (sys, (char*) "path");
|
||||
//
|
||||
// if (!path || !PyList_Check (path))
|
||||
// {
|
||||
// g_critical ("%s: oops", G_STRLOC);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// for (d = dirs; d && *d; ++d)
|
||||
// {
|
||||
// char *libdir = g_build_filename (*d, LIBDIR, NULL);
|
||||
// PyObject *s = PyString_FromString (libdir);
|
||||
// PyList_Append (path, s);
|
||||
// Py_XDECREF (s);
|
||||
// g_free (libdir);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// for (d = dirs; d && *d; ++d)
|
||||
// moo_python_plugin_read_dir (*d);
|
||||
//
|
||||
// g_strfreev (dirs);
|
||||
// }
|
||||
static void
|
||||
sys_path_add_plugin_dirs (void)
|
||||
{
|
||||
char **d;
|
||||
char **dirs = moo_plugin_get_dirs ();
|
||||
PyObject *sys = NULL, *path = NULL;
|
||||
static gboolean been_here = FALSE;
|
||||
|
||||
if (been_here)
|
||||
return;
|
||||
|
||||
been_here = TRUE;
|
||||
sys = PyImport_ImportModule ((char*) "sys");
|
||||
|
||||
if (sys)
|
||||
path = PyObject_GetAttrString (sys, (char*) "path");
|
||||
|
||||
if (!path || !PyList_Check (path))
|
||||
{
|
||||
g_critical ("%s: oops", G_STRLOC);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (d = dirs; d && *d; ++d)
|
||||
{
|
||||
char *libdir = g_build_filename (*d, LIBDIR, NULL);
|
||||
PyObject *s = PyString_FromString (libdir);
|
||||
PyList_Append (path, s);
|
||||
Py_XDECREF (s);
|
||||
g_free (libdir);
|
||||
}
|
||||
}
|
||||
|
||||
g_strfreev (dirs);
|
||||
}
|
||||
|
||||
|
||||
static PyObject *
|
||||
@ -509,6 +508,8 @@ load_file (const char *path)
|
||||
if (!moo_python_stuff_init ())
|
||||
return NULL;
|
||||
|
||||
sys_path_add_plugin_dirs ();
|
||||
|
||||
if (!g_file_get_contents (path, &content, NULL, &error))
|
||||
{
|
||||
g_warning ("could not read file '%s': %s", path, error->message);
|
||||
|
@ -3,7 +3,7 @@ SUBDIRS = pyproject
|
||||
moopython_pluginsdir = $(MOO_LIB_DIR)/plugins
|
||||
moopython_plugins_libdir = $(MOO_LIB_DIR)/plugins/lib
|
||||
|
||||
ini_in_files = console.ini.in
|
||||
ini_in_files = console.ini.in python.ini.in
|
||||
%.ini: %.ini.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@
|
||||
ini_files = $(ini_in_files:.ini.in=.ini)
|
||||
|
||||
|
@ -1,6 +1,11 @@
|
||||
ini_in_files = project-plugin.ini.in
|
||||
%.ini: %.ini.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@
|
||||
ini_files = $(ini_in_files:.ini.in=.ini)
|
||||
|
||||
pluginsdir = $(MOO_LIB_DIR)/plugins
|
||||
plugins_DATA = \
|
||||
project-plugin.py
|
||||
project-plugin.py \
|
||||
$(ini_files)
|
||||
|
||||
mprojdir = $(pluginsdir)/lib/mproj
|
||||
mproj_DATA = \
|
||||
@ -31,7 +36,8 @@ ltxproj_DATA = \
|
||||
projects/ltxproj/__init__.py
|
||||
|
||||
EXTRA_DIST = \
|
||||
$(plugins_DATA) \
|
||||
project-plugin.py \
|
||||
$(ini_in_files) \
|
||||
$(projects_DATA) \
|
||||
$(mproj_DATA) \
|
||||
$(cproj_DATA) \
|
||||
|
13
moo/moopython/plugins/pyproject/project-plugin.ini.in
Normal file
13
moo/moopython/plugins/pyproject/project-plugin.ini.in
Normal file
@ -0,0 +1,13 @@
|
||||
[module]
|
||||
type=Python
|
||||
file=project-plugin.py
|
||||
version=0.7
|
||||
|
||||
[plugin]
|
||||
id=ProjectManager
|
||||
_name=Project Manager
|
||||
_description=Project manager
|
||||
author=Yevgen Muntyan <muntyan@math.tamu.edu>
|
||||
version=3.1415926
|
||||
enabled=false
|
||||
visible=false
|
@ -4,9 +4,7 @@ import traceback
|
||||
import gobject
|
||||
from mproj.manager import Manager
|
||||
|
||||
_PLUGIN_ID = "ProjectManager"
|
||||
|
||||
class _Plugin(moo.edit.Plugin):
|
||||
class __plugin__(moo.edit.Plugin):
|
||||
__gproperties__ = { 'project' : (str, 'project to open', 'project to open', None, gobject.PARAM_READWRITE) }
|
||||
|
||||
def do_set_property(self, prop, value):
|
||||
@ -28,13 +26,3 @@ class _Plugin(moo.edit.Plugin):
|
||||
|
||||
def do_detach_win(self, window):
|
||||
self.mgr.detach_win(window)
|
||||
|
||||
|
||||
if __name__.startswith("moo_plugin_") and moo.edit.module_check_version(2, 0):
|
||||
#gobject.type_register(_Plugin)
|
||||
info = moo.edit.PluginInfo(_PLUGIN_ID, "Project Manager",
|
||||
description="Project Manager",
|
||||
author="Yevgen Muntyan <muntyan@math.tamu.edu>",
|
||||
version="3.1415926")
|
||||
params = moo.edit.PluginParams(False, False)
|
||||
moo.edit.plugin_register(_Plugin, info, params)
|
||||
|
11
moo/moopython/plugins/python.ini.in
Normal file
11
moo/moopython/plugins/python.ini.in
Normal file
@ -0,0 +1,11 @@
|
||||
[module]
|
||||
type=Python
|
||||
file=python.py
|
||||
version=0.7
|
||||
|
||||
[plugin]
|
||||
id=Python
|
||||
_name=Python
|
||||
_description=Python support
|
||||
author=Yevgen Muntyan <muntyan@math.tamu.edu>
|
||||
version=3.1415926
|
@ -163,11 +163,5 @@ class Plugin(moo.edit.Plugin):
|
||||
window.remove_pane(PLUGIN_ID)
|
||||
|
||||
|
||||
if moo.edit.module_check_version(2, 0):
|
||||
gobject.type_register(Plugin)
|
||||
|
||||
info = moo.edit.PluginInfo(PLUGIN_ID, "Python",
|
||||
description="Python support",
|
||||
author="Yevgen Muntyan <muntyan@math.tamu.edu>",
|
||||
version="3.1415926")
|
||||
moo.edit.plugin_register(Plugin, info)
|
||||
gobject.type_register(Plugin)
|
||||
__plugin__ = Plugin
|
||||
|
Loading…
x
Reference in New Issue
Block a user