Skip to content

Commit ceb7b6b

Browse files
tonyjoseph-flinn
authored andcommitted
Rename PluginInterface -> Plugin
1 parent 823245e commit ceb7b6b

File tree

13 files changed

+53
-52
lines changed

13 files changed

+53
-52
lines changed

docs/plugin_system.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,10 @@ The `plugin.py` file could contain something like the following:
8181

8282
.. code-block:: python
8383
84-
from tmuxp.plugin import TmuxpPluginInterface
84+
from tmuxp.plugin import TmuxpPlugin
8585
import datetime
8686
87-
class MyTmuxpPlugin(TmuxpPluginInterface):
87+
class MyTmuxpPlugin(TmuxpPlugin):
8888
def __init__(self):
8989
"""
9090
Initialize my custom plugin.
@@ -95,7 +95,7 @@ The `plugin.py` file could contain something like the following:
9595
'tmuxp_min_version' = '1.6.2'
9696
}
9797
98-
TmuxpPluginInterface.__init__(
98+
TmuxpPlugin.__init__(
9999
self,
100100
plugin_name='tmuxp-plugin-my-tmuxp-plugin',
101101
**config
@@ -123,8 +123,8 @@ in a configuration file like the following:
123123
Plugin API
124124
----------
125125

126-
.. automethod:: tmuxp.plugin.TmuxpPluginInterface.before_workspace_builder
127-
.. automethod:: tmuxp.plugin.TmuxpPluginInterface.on_window_create
128-
.. automethod:: tmuxp.plugin.TmuxpPluginInterface.after_window_finished
129-
.. automethod:: tmuxp.plugin.TmuxpPluginInterface.before_script
130-
.. automethod:: tmuxp.plugin.TmuxpPluginInterface.reattach
126+
.. automethod:: tmuxp.plugin.TmuxpPlugin.before_workspace_builder
127+
.. automethod:: tmuxp.plugin.TmuxpPlugin.on_window_create
128+
.. automethod:: tmuxp.plugin.TmuxpPlugin.after_window_finished
129+
.. automethod:: tmuxp.plugin.TmuxpPlugin.before_script
130+
.. automethod:: tmuxp.plugin.TmuxpPlugin.reattach

tests/fixtures/pluginsystem/partials/all_pass.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
from .test_plugin_helpers import MyTestTmuxpPluginInterface
1+
from .test_plugin_helpers import MyTestTmuxpPlugin
22

33

4-
class AllVersionPassPlugin(MyTestTmuxpPluginInterface):
4+
class AllVersionPassPlugin(MyTestTmuxpPlugin):
55
def __init__(self):
66
config = {
77
'plugin_name': 'tmuxp-plugin-my-tmuxp-plugin',
@@ -17,4 +17,4 @@ def __init__(self):
1717
'tmux_version': '3.0',
1818
'tmuxp_version': '1.6.0',
1919
}
20-
MyTestTmuxpPluginInterface.__init__(self, config)
20+
MyTestTmuxpPlugin.__init__(self, config)
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
1-
from .test_plugin_helpers import MyTestTmuxpPluginInterface
1+
from .test_plugin_helpers import MyTestTmuxpPlugin
22

33

4-
class LibtmuxVersionFailMinPlugin(MyTestTmuxpPluginInterface):
4+
class LibtmuxVersionFailMinPlugin(MyTestTmuxpPlugin):
55
def __init__(self):
66
config = {
77
'plugin_name': 'libtmux-min-version-fail',
88
'libtmux_min_version': '0.8.3',
99
'libtmux_version': '0.7.0',
1010
}
11-
MyTestTmuxpPluginInterface.__init__(self, config)
11+
MyTestTmuxpPlugin.__init__(self, config)
1212

1313

14-
class LibtmuxVersionFailMaxPlugin(MyTestTmuxpPluginInterface):
14+
class LibtmuxVersionFailMaxPlugin(MyTestTmuxpPlugin):
1515
def __init__(self):
1616
config = {
1717
'plugin_name': 'libtmux-max-version-fail',
1818
'libtmux_max_version': '3.0',
1919
'libtmux_version': '3.5',
2020
}
21-
MyTestTmuxpPluginInterface.__init__(self, config)
21+
MyTestTmuxpPlugin.__init__(self, config)
2222

2323

24-
class LibtmuxVersionFailIncompatiblePlugin(MyTestTmuxpPluginInterface):
24+
class LibtmuxVersionFailIncompatiblePlugin(MyTestTmuxpPlugin):
2525
def __init__(self):
2626
config = {
2727
'plugin_name': 'libtmux-incompatible-version-fail',
2828
'libtmux_version_incompatible': ['0.7.1'],
2929
'libtmux_version': '0.7.1',
3030
}
31-
MyTestTmuxpPluginInterface.__init__(self, config)
31+
MyTestTmuxpPlugin.__init__(self, config)

tests/fixtures/pluginsystem/partials/test_plugin_helpers.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
from tmuxp.plugin import TmuxpPluginInterface
1+
from tmuxp.plugin import TmuxpPlugin
22

33

4-
class MyTestTmuxpPluginInterface(TmuxpPluginInterface):
4+
class MyTestTmuxpPlugin(TmuxpPlugin):
55
def __init__(self, config):
66
tmux_version = config.pop('tmux_version', None)
77
libtmux_version = config.pop('libtmux_version', None)
88
tmuxp_version = config.pop('tmuxp_version', None)
99

10-
TmuxpPluginInterface.__init__(self, **config)
10+
TmuxpPlugin.__init__(self, **config)
1111

1212
# WARNING! This should not be done in anything but a test
1313
if tmux_version:
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
1-
from .test_plugin_helpers import MyTestTmuxpPluginInterface
1+
from .test_plugin_helpers import MyTestTmuxpPlugin
22

33

4-
class TmuxVersionFailMinPlugin(MyTestTmuxpPluginInterface):
4+
class TmuxVersionFailMinPlugin(MyTestTmuxpPlugin):
55
def __init__(self):
66
config = {
77
'plugin_name': 'tmux-min-version-fail',
88
'tmux_min_version': '1.8',
99
'tmux_version': '1.7',
1010
}
11-
MyTestTmuxpPluginInterface.__init__(self, config)
11+
MyTestTmuxpPlugin.__init__(self, config)
1212

1313

14-
class TmuxVersionFailMaxPlugin(MyTestTmuxpPluginInterface):
14+
class TmuxVersionFailMaxPlugin(MyTestTmuxpPlugin):
1515
def __init__(self):
1616
config = {
1717
'plugin_name': 'tmux-max-version-fail',
1818
'tmux_max_version': '3.0',
1919
'tmux_version': '3.5',
2020
}
21-
MyTestTmuxpPluginInterface.__init__(self, config)
21+
MyTestTmuxpPlugin.__init__(self, config)
2222

2323

24-
class TmuxVersionFailIncompatiblePlugin(MyTestTmuxpPluginInterface):
24+
class TmuxVersionFailIncompatiblePlugin(MyTestTmuxpPlugin):
2525
def __init__(self):
2626
config = {
2727
'plugin_name': 'tmux-incompatible-version-fail',
2828
'tmux_version_incompatible': ['2.3'],
2929
'tmux_version': '2.3',
3030
}
3131

32-
MyTestTmuxpPluginInterface.__init__(self, config)
32+
MyTestTmuxpPlugin.__init__(self, config)
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
1-
from .test_plugin_helpers import MyTestTmuxpPluginInterface
1+
from .test_plugin_helpers import MyTestTmuxpPlugin
22

33

4-
class TmuxpVersionFailMinPlugin(MyTestTmuxpPluginInterface):
4+
class TmuxpVersionFailMinPlugin(MyTestTmuxpPlugin):
55
def __init__(self):
66
config = {
77
'plugin_name': 'tmuxp-min-version-fail',
88
'tmuxp_min_version': '1.6.0',
99
'tmuxp_version': '1.5.6',
1010
}
11-
MyTestTmuxpPluginInterface.__init__(self, config)
11+
MyTestTmuxpPlugin.__init__(self, config)
1212

1313

14-
class TmuxpVersionFailMaxPlugin(MyTestTmuxpPluginInterface):
14+
class TmuxpVersionFailMaxPlugin(MyTestTmuxpPlugin):
1515
def __init__(self):
1616
config = {
1717
'plugin_name': 'tmuxp-max-version-fail',
1818
'tmuxp_max_version': '2.0.0',
1919
'tmuxp_version': '2.5',
2020
}
21-
MyTestTmuxpPluginInterface.__init__(self, config)
21+
MyTestTmuxpPlugin.__init__(self, config)
2222

2323

24-
class TmuxpVersionFailIncompatiblePlugin(MyTestTmuxpPluginInterface):
24+
class TmuxpVersionFailIncompatiblePlugin(MyTestTmuxpPlugin):
2525
def __init__(self):
2626
config = {
2727
'plugin_name': 'tmuxp-incompatible-version-fail',
2828
'tmuxp_version_incompatible': ['1.5.0'],
2929
'tmuxp_version': '1.5.0',
3030
}
31-
MyTestTmuxpPluginInterface.__init__(self, config)
31+
MyTestTmuxpPlugin.__init__(self, config)

tests/fixtures/pluginsystem/plugins/tmuxp_test_plugin_awf/tmuxp_test_plugin_awf/plugin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
from tmuxp.plugin import TmuxpPluginInterface
1+
from tmuxp.plugin import TmuxpPlugin
22

33

4-
class PluginAfterWindowFinished(TmuxpPluginInterface):
4+
class PluginAfterWindowFinished(TmuxpPlugin):
55
def __init__(self):
66
self.message = '[+] This is the Tmuxp Test Plugin'
77

tests/fixtures/pluginsystem/plugins/tmuxp_test_plugin_bs/tmuxp_test_plugin_bs/plugin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
from tmuxp.plugin import TmuxpPluginInterface
1+
from tmuxp.plugin import TmuxpPlugin
22

33

4-
class PluginBeforeScript(TmuxpPluginInterface):
4+
class PluginBeforeScript(TmuxpPlugin):
55
def __init__(self):
66
self.message = '[+] This is the Tmuxp Test Plugin'
77

tests/fixtures/pluginsystem/plugins/tmuxp_test_plugin_bwb/tmuxp_test_plugin_bwb/plugin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
from tmuxp.plugin import TmuxpPluginInterface
1+
from tmuxp.plugin import TmuxpPlugin
22

33

4-
class PluginBeforeWorkspaceBuilder(TmuxpPluginInterface):
4+
class PluginBeforeWorkspaceBuilder(TmuxpPlugin):
55
def __init__(self):
66
self.message = '[+] This is the Tmuxp Test Plugin'
77

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
from tmuxp.plugin import TmuxpPluginInterface
1+
from tmuxp.plugin import TmuxpPlugin
22

33

4-
class PluginFailVersion(TmuxpPluginInterface):
4+
class PluginFailVersion(TmuxpPlugin):
55
def __init__(self):
66
config = {
77
'plugin_name': 'tmuxp-plugin-fail-version',
88
'tmuxp_max_version': '0.0.0',
99
}
10-
TmuxpPluginInterface.__init__(self, **config)
10+
TmuxpPlugin.__init__(self, **config)

tests/fixtures/pluginsystem/plugins/tmuxp_test_plugin_owc/tmuxp_test_plugin_owc/plugin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
from tmuxp.plugin import TmuxpPluginInterface
1+
from tmuxp.plugin import TmuxpPlugin
22

33

4-
class PluginOnWindowCreate(TmuxpPluginInterface):
4+
class PluginOnWindowCreate(TmuxpPlugin):
55
def __init__(self):
66
self.message = '[+] This is the Tmuxp Test Plugin'
77

tests/fixtures/pluginsystem/plugins/tmuxp_test_plugin_r/tmuxp_test_plugin_r/plugin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
from tmuxp.plugin import TmuxpPluginInterface
1+
from tmuxp.plugin import TmuxpPlugin
22

33

4-
class PluginReattach(TmuxpPluginInterface):
4+
class PluginReattach(TmuxpPlugin):
55
def __init__(self):
66
self.message = '[+] This is the Tmuxp Test Plugin'
77

tmuxp/plugin.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
import libtmux
21
from distutils.version import LooseVersion
2+
3+
import libtmux
34
from libtmux.common import get_version
45

56
from .__about__ import __version__
@@ -24,10 +25,10 @@
2425
TMUXP_MAX_VERSION = None
2526

2627

27-
class TmuxpPluginInterface:
28+
class TmuxpPlugin:
2829
def __init__(
2930
self,
30-
plugin_name='tmuxp-plugin-interface',
31+
plugin_name='tmuxp-plugin',
3132
tmux_min_version=TMUX_MIN_VERSION,
3233
tmux_max_version=TMUX_MAX_VERSION,
3334
tmux_version_incompatible=None,
@@ -39,7 +40,7 @@ def __init__(
3940
tmuxp_version_incompatible=None,
4041
):
4142
"""
42-
Initialize plugin interface.
43+
Initialize plugin.
4344
4445
The default version values are set to the versions that the plugin
4546
system requires.

0 commit comments

Comments
 (0)