diff options
author | Florent Le Coz <louiz@louiz.org> | 2013-09-06 16:05:58 +0200 |
---|---|---|
committer | Florent Le Coz <louiz@louiz.org> | 2013-09-06 16:10:33 +0200 |
commit | 2f6324571e147d427eae0851f4ebf94e8cfed6a7 (patch) | |
tree | 91953dd4f29b410fa3c56c7ec128a77a10c1c610 | |
parent | 4b662ffa6787ac81a62e28e5e23b859cc9ed68a9 (diff) | |
download | poezio-2f6324571e147d427eae0851f4ebf94e8cfed6a7.tar.gz poezio-2f6324571e147d427eae0851f4ebf94e8cfed6a7.tar.bz2 poezio-2f6324571e147d427eae0851f4ebf94e8cfed6a7.tar.xz poezio-2f6324571e147d427eae0851f4ebf94e8cfed6a7.zip |
Add the pointpoint plugin
-rw-r--r-- | doc/source/plugins/index.rst | 6 | ||||
-rw-r--r-- | doc/source/plugins/pointpoint.py | 6 | ||||
-rw-r--r-- | plugins/pointpoint.py | 46 |
3 files changed, 58 insertions, 0 deletions
diff --git a/doc/source/plugins/index.rst b/doc/source/plugins/index.rst index 5fbbfdc2..ce758537 100644 --- a/doc/source/plugins/index.rst +++ b/doc/source/plugins/index.rst @@ -207,6 +207,11 @@ Plugin index Double the first word of each sentence. + PointPoint + :ref:`Documention <pointpoint-plugin>` + + Insert dots in your messages. + .. toctree:: :hidden: @@ -240,3 +245,4 @@ Plugin index shuffle iq_show regex_admin + pointpoint diff --git a/doc/source/plugins/pointpoint.py b/doc/source/plugins/pointpoint.py new file mode 100644 index 00000000..b6dc9088 --- /dev/null +++ b/doc/source/plugins/pointpoint.py @@ -0,0 +1,6 @@ +.. _pointpoint-plugin: + +Pointpoint +========== + +.. automodule:: pointpoint diff --git a/plugins/pointpoint.py b/plugins/pointpoint.py new file mode 100644 index 00000000..51b2662c --- /dev/null +++ b/plugins/pointpoint.py @@ -0,0 +1,46 @@ +""" +This plugin adds a command (that can be bound to a key) that adds a random +number of dots in the input, making you look depressed, or overly thinking... + +.. note:: ....... + +Installation +------------ +Load the plugin.:: + + /load pointpoint + +Then use the command: :: + + /pointpoint + +But since the goal is to be able to add the dots while typing a message, +entering a command is not really useful. To be useful, this plugin needs to +be used through a bound key, for example like this: :: + + /bind M-. _exc_pointpoint + +You just need to press Alt+. and this will insert dots in your message. + +Command +------- + +.. glossary:: + + /pointpoint + **Usage:** ``/pointpoint`` + + +""" + +from plugin import BasePlugin +from random import randrange + +class Plugin(BasePlugin): + def init(self): + self.api.add_command('pointpoint', self.command_pointpoint, + help='Insert a random number of dots in the input') + + def command_pointpoint(self, args): + for i in range(randrange(8, 25)): + self.core.current_tab().input.do_command(".") |