~ubuntu-branches/ubuntu/vivid/gedit-plugins/vivid-proposed

« back to all changes in this revision

Viewing changes to plugins/commander/commander/__init__.py

  • Committer: Package Import Robot
  • Author(s): Robert Ancell
  • Date: 2012-08-20 11:28:57 UTC
  • mfrom: (1.4.9)
  • Revision ID: package-import@ubuntu.com-20120820112857-b9o0cpx9enivzy8u
Tags: 3.5.1-0ubuntu1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
path = os.path.dirname(__file__)
26
26
 
27
27
if not path in sys.path:
28
 
        sys.path.insert(0, path)
 
28
    sys.path.insert(0, path)
29
29
 
30
30
from windowactivatable import WindowActivatable
31
31
import commander.commands as commands
32
32
from gi.repository import GObject, GLib, Gedit
33
33
 
34
34
class CommanderPlugin(GObject.Object, Gedit.AppActivatable):
35
 
        __gtype_name__ = "CommanderPlugin"
36
 
 
37
 
        app = GObject.property(type=Gedit.App)
38
 
 
39
 
        def __init__(self):
40
 
                GObject.Object.__init__(self)
41
 
 
42
 
        def do_activate(self):
43
 
                self._path = os.path.dirname(__file__)
44
 
 
45
 
                if not self._path in sys.path:
46
 
                        sys.path.insert(0, self._path)
47
 
 
48
 
                commands.Commands().set_dirs([
49
 
                        os.path.join(GLib.get_user_config_dir(), 'gedit/commander/modules'),
50
 
                        os.path.join(self.plugin_info.get_data_dir(), 'modules')
51
 
                ])
52
 
 
53
 
        def deactivate(self):
54
 
                commands.Commands().stop()
55
 
 
56
 
                if self._path in sys.path:
57
 
                        sys.path.remove(self._path)
 
35
    __gtype_name__ = "CommanderPlugin"
 
36
 
 
37
    app = GObject.property(type=Gedit.App)
 
38
 
 
39
    def __init__(self):
 
40
        GObject.Object.__init__(self)
 
41
 
 
42
    def do_activate(self):
 
43
        self._path = os.path.dirname(__file__)
 
44
 
 
45
        if not self._path in sys.path:
 
46
            sys.path.insert(0, self._path)
 
47
 
 
48
        commands.Commands().set_dirs([
 
49
            os.path.join(GLib.get_user_config_dir(), 'gedit/commander/modules'),
 
50
            os.path.join(self.plugin_info.get_data_dir(), 'modules')
 
51
        ])
 
52
 
 
53
    def deactivate(self):
 
54
        commands.Commands().stop()
 
55
 
 
56
        if self._path in sys.path:
 
57
            sys.path.remove(self._path)
 
58
 
 
59
# vi:ex:ts=4:et