Skip to content

Commit

Permalink
WIP geanypy pluxy
Browse files Browse the repository at this point in the history
  • Loading branch information
kugel- committed Aug 27, 2015
1 parent 4b01b16 commit 9c27df0
Show file tree
Hide file tree
Showing 11 changed files with 321 additions and 137 deletions.
1 change: 0 additions & 1 deletion geanypy/geany/Makefile.am
@@ -1,6 +1,5 @@
geanypy_sources = __init__.py \
console.py \
manager.py \
loader.py \
plugin.py \
signalmanager.py
Expand Down
1 change: 0 additions & 1 deletion geanypy/geany/__init__.py
Expand Up @@ -17,7 +17,6 @@
import highlighting
import loader
import main
import manager
import msgwindow
import navqueue
import prefs
Expand Down
10 changes: 6 additions & 4 deletions geanypy/geany/plugin.py
Expand Up @@ -36,8 +36,9 @@ def cleanup(self):
files with a `.py` extension will be loaded.
"""

import pluginbase

class Plugin(object):
class Plugin(pluginbase.PluginBase):
"""
Base class for all plugins. All plugins must inherit from this in order
to be properly detected.
Expand All @@ -49,7 +50,6 @@ class Plugin(object):
#__plugin_version__ = None
#__plugin_author__ = None


_events = {
"document-open": [],
# TODO: add more events here
Expand All @@ -61,8 +61,7 @@ def __init__(self):
When the plugin is loaded its __init__() function will be called
so that's a good place to put plugin initialization code.
"""


super(Plugin, self).__init__()

def cleanup(self):
"""
Expand Down Expand Up @@ -121,3 +120,6 @@ def author(self):
return self.__plugin_author__
else:
return ""

def test_method(self):
pluginbase.PluginBase.test_method(self)
2 changes: 1 addition & 1 deletion geanypy/plugins/Makefile.am
@@ -1,4 +1,4 @@
geanypy_plugins = demo.py hello.py console.py
geanypydir = $(datadir)/geany/geanypy/plugins
geanypydir = $(libdir)/geany
geanypy_DATA = $(geanypy_plugins)
EXTRA_DIST = $(geanypy_plugins)
3 changes: 3 additions & 0 deletions geanypy/plugins/console.py
Expand Up @@ -52,6 +52,9 @@ def save_config(self):


def on_save_config_timeout(self, data=None):
directory = os.path.join(geany.app.configdir, "plugins")

This comment has been minimized.

Copy link
@b4n

b4n Oct 5, 2015

should rather be os.path.dirname(self.cfg_path) -- if this ends up a real fix and not a hot quickie

if not os.path.exists(directory):
os.makedirs(directory)
self.cfg.write(open(self.cfg_path, 'w'))
return False

Expand Down
2 changes: 1 addition & 1 deletion geanypy/src/Makefile.am
Expand Up @@ -6,7 +6,7 @@ geanyplugindir = $(libdir)/geany
geanypy_la_LDFLAGS = -module -avoid-version -Wl,--export-dynamic
geanypy_la_CPPFLAGS = @GEANY_CFLAGS@ @PYGTK_CFLAGS@ @PYTHON_CPPFLAGS@ \
-DGEANYPY_PYTHON_DIR="\"$(libdir)/geany/geanypy\"" \
-DGEANYPY_PLUGIN_DIR="\"$(datadir)/geany/geanypy/plugins\""
-DGEANYPY_PLUGIN_DIR="\"$(libdir)/geany\""
geanypy_la_CFLAGS = @GEANYPY_CFLAGS@ @GMODULE_CFLAGS@
geanypy_la_LIBADD = @GEANY_LIBS@ @PYGTK_LIBS@ @PYTHON_LDFLAGS@ \
@PYTHON_EXTRA_LIBS@ @PYTHON_EXTRA_LDFLAGS@ \
Expand Down
1 change: 0 additions & 1 deletion geanypy/src/geanypy-app.c
Expand Up @@ -4,7 +4,6 @@

#include "geanypy.h"


typedef struct
{
PyObject_HEAD
Expand Down

0 comments on commit 9c27df0

Please sign in to comment.