Commit 3a24d883 authored by Link Mauve's avatar Link Mauve

Make plugins import from the absolute poezio package.

parent a210303b
......@@ -51,8 +51,8 @@ For affiliations
"""
from plugin import BasePlugin
from tabs import MucTab
from poezio.plugin import BasePlugin
from poezio.tabs import MucTab
class Plugin(BasePlugin):
"""
......
......@@ -64,8 +64,8 @@ Example of the syntax:
"""
from plugin import BasePlugin
from common import shell_split
from poezio.plugin import BasePlugin
from poezio.common import shell_split
class Plugin(BasePlugin):
......
......@@ -16,8 +16,8 @@ Command
"""
from plugin import BasePlugin
from tabs import MucTab
from poezio.plugin import BasePlugin
from poezio.tabs import MucTab
class Plugin(BasePlugin):
def init(self):
......
......@@ -45,7 +45,7 @@ This variant is useful if you don’t want to care about regular expressions
"""
from plugin import BasePlugin
from poezio.plugin import BasePlugin
import re
allowed_separators = '/#!:;'
......
......@@ -22,8 +22,8 @@ Configuration options
The time during which the file should stay in cache on the receiving side.
"""
from plugin import BasePlugin
import tabs
from poezio.plugin import BasePlugin
from poezio import tabs
from pathlib import Path
from glob import glob
......
"""
Once loaded, everything you will send will be IN CAPITAL LETTERS.
"""
from plugin import BasePlugin
import xhtml
from poezio.plugin import BasePlugin
from poezio import xhtml
class Plugin(BasePlugin):
def init(self):
......
......@@ -2,7 +2,7 @@
This plugin will set the title of your terminal to the name of the current tab.
"""
from plugin import BasePlugin
from poezio.plugin import BasePlugin
import sys
......
......@@ -11,9 +11,9 @@ Commands
Close all tabs except the roster and MUC tabs.
"""
from plugin import BasePlugin
import tabs
from decorators import command_args_parser
from poezio.plugin import BasePlugin
from poezio import tabs
from poezio.decorators import command_args_parser
class Plugin(BasePlugin):
......
......@@ -20,8 +20,8 @@ Commands
.. _CSI: https://xmpp.org/extensions/xep-0352.html
"""
from plugin import BasePlugin
import tabs
from poezio.plugin import BasePlugin
from poezio import tabs
class Plugin(BasePlugin):
def init(self):
......
......@@ -17,7 +17,7 @@ Configuration options
The percentage of the time the plugin will activate (randomly). 100 for every message, <= 0 for never.
"""
from plugin import BasePlugin
from poezio.plugin import BasePlugin
from random import choice, randint
import re
......
......@@ -5,10 +5,10 @@ date has changed.
"""
from gettext import gettext as _
from plugin import BasePlugin
from poezio.plugin import BasePlugin
import datetime
import tabs
import timed_events
from poezio import tabs
from poezio import timed_events
class Plugin(BasePlugin):
def init(self):
......
......@@ -22,9 +22,9 @@ Usage
"""
from plugin import BasePlugin
from common import shell_split
import tabs
from poezio.plugin import BasePlugin
from poezio.common import shell_split
from poezio import tabs
class Plugin(BasePlugin):
def init(self):
......
"""
Double the first word of any message you send in a :ref:`muctab`, making you appear retarded.
"""
from plugin import BasePlugin
from poezio.plugin import BasePlugin
class Plugin(BasePlugin):
def init(self):
......
......@@ -35,8 +35,8 @@ Usage
"""
from plugin import BasePlugin
import common
from poezio.plugin import BasePlugin
from poezio import common
import subprocess
class Plugin(BasePlugin):
......
......@@ -11,7 +11,7 @@ Say something in a Chat tab.
.. note:: Can create fun things when used with :ref:`The rainbow plugin <rainbow-plugin>`.
"""
from plugin import BasePlugin
from poezio.plugin import BasePlugin
import subprocess
class Plugin(BasePlugin):
......
......@@ -2,7 +2,7 @@
Show the exchanged IQs (useful for debugging).
"""
from plugin import BasePlugin
from poezio.plugin import BasePlugin
from slixmpp.xmlstream.matcher import StanzaPath
from slixmpp.xmlstream.handler import Callback
......
......@@ -129,10 +129,10 @@ Example configuration
"""
from plugin import BasePlugin
from decorators import command_args_parser
import common
import tabs
from poezio.plugin import BasePlugin
from poezio.decorators import command_args_parser
from poezio import common
from poezio import tabs
class Plugin(BasePlugin):
......
......@@ -82,10 +82,10 @@ Options
import platform
import re
from plugin import BasePlugin
from xhtml import clean_text
import common
import tabs
from poezio.plugin import BasePlugin
from poezio.xhtml import clean_text
from poezio import common
from poezio import tabs
url_pattern = re.compile(r'\b(http[s]?://(?:\S+))\b', re.I|re.U)
app_mapping = {
......
......@@ -34,10 +34,10 @@ Configuration
"""
from plugin import BasePlugin
import tabs
import xhtml
from decorators import command_args_parser
from poezio.plugin import BasePlugin
from poezio import tabs
from poezio import xhtml
from poezio.decorators import command_args_parser
def move(text, step, spacing):
new_text = text + (" " * spacing)
......
......@@ -10,8 +10,8 @@ Command
**Usage:** ``/mirror``
"""
from plugin import BasePlugin
import tabs
from poezio.plugin import BasePlugin
from poezio import tabs
class Plugin(BasePlugin):
def init(self):
......
......@@ -47,10 +47,10 @@ Usage
"""
from plugin import BasePlugin
from common import shell_split
from poezio.plugin import BasePlugin
from poezio.common import shell_split
from os.path import basename as base
import tabs
from poezio import tabs
import mpd
class Plugin(BasePlugin):
......
......@@ -186,14 +186,14 @@ import curses
from potr.context import NotEncryptedError, UnencryptedMessage, ErrorReceived, NotOTRMessage,\
STATE_ENCRYPTED, STATE_PLAINTEXT, STATE_FINISHED, Context, Account, crypt
import common
import xhtml
from common import safeJID
from config import config
from plugin import BasePlugin
from tabs import ConversationTab, DynamicConversationTab, PrivateTab
from theming import get_theme, dump_tuple
from decorators import command_args_parser
from poezio import common
from poezio import xhtml
from poezio.common import safeJID
from poezio.config import config
from poezio.plugin import BasePlugin
from poezio.tabs import ConversationTab, DynamicConversationTab, PrivateTab
from poezio.theming import get_theme, dump_tuple
from poezio.decorators import command_args_parser
OTR_DIR = os.path.join(os.getenv('XDG_DATA_HOME') or
'~/.local/share', 'poezio', 'otr')
......
......@@ -13,9 +13,9 @@ Usage
"""
from random import choice
from tabs import MucTab
from poezio.tabs import MucTab
from plugin import BasePlugin
from poezio.plugin import BasePlugin
class Plugin(BasePlugin):
def init(self):
......
......@@ -22,12 +22,12 @@ Command
the current interlocutor.
"""
from decorators import command_args_parser
from plugin import BasePlugin
from roster import roster
from common import safeJID
from contact import Contact, Resource
import tabs
from poezio.decorators import command_args_parser
from poezio.plugin import BasePlugin
from poezio.roster import roster
from poezio.common import safeJID
from poezio.contact import Contact, Resource
from poezio import tabs
import time
......
......@@ -19,7 +19,7 @@ Configuration
"""
from plugin import BasePlugin
from poezio.plugin import BasePlugin
import os
import stat
import logging
......
......@@ -33,7 +33,7 @@ Command
"""
from plugin import BasePlugin
from poezio.plugin import BasePlugin
from random import randrange
class Plugin(BasePlugin):
......
......@@ -44,10 +44,10 @@ Options
time of the message.
"""
from plugin import BasePlugin
from xhtml import clean_text
import common
import tabs
from poezio.plugin import BasePlugin
from poezio.xhtml import clean_text
from poezio import common
from poezio import tabs
import logging
log = logging.getLogger(__name__)
......
......@@ -12,8 +12,8 @@ Usage
.. note:: Can create fun things when used with :ref:`The figlet plugin <figlet-plugin>`.
"""
from plugin import BasePlugin
import xhtml
from poezio.plugin import BasePlugin
from poezio import xhtml
import random
possible_colors = list(range(256))
......
......@@ -11,7 +11,7 @@ automatically be changed to something random, for example: ::
"""
from plugin import BasePlugin
from poezio.plugin import BasePlugin
from random import choice
class Plugin(BasePlugin):
......
......@@ -26,8 +26,8 @@ Those commands take a regular expression (as defined in the
"""
from plugin import BasePlugin
from tabs import MucTab
from poezio.plugin import BasePlugin
from poezio.tabs import MucTab
import re
......
......@@ -47,10 +47,10 @@ Will remind you to get up every 1 hour 23 minutes.
"""
from plugin import BasePlugin
from poezio.plugin import BasePlugin
import curses
import common
import timed_events
from poezio import common
from poezio import timed_events
class Plugin(BasePlugin):
......
......@@ -54,9 +54,9 @@ And finally, the ``[tab name]`` must be:
- For a type ``dynamic``, the bare JID of the contact
- For a type ``static``, the full JID of the contact
"""
from plugin import BasePlugin
import tabs
from decorators import command_args_parser
from poezio.plugin import BasePlugin
from poezio import tabs
from poezio.decorators import command_args_parser
mapping = {
'muc': tabs.MucTab,
......
......@@ -53,8 +53,8 @@ For more convenience, you can read your nice words from a file, do whatever
you want in that function, as long as it returns a string.
"""
from plugin import BasePlugin
import tabs
from poezio.plugin import BasePlugin
from poezio import tabs
import datetime
import random
import re
......
......@@ -16,7 +16,7 @@ Just use the word in a message. It will be replaced automatically.
"""
from plugin import BasePlugin
from poezio.plugin import BasePlugin
import re
class Plugin(BasePlugin):
......
......@@ -2,8 +2,8 @@
Reverse everything you say (``Je proteste énergiquement`` will become
``tnemeuqigrené etsetorp eJ``)
"""
from plugin import BasePlugin
import xhtml
from poezio.plugin import BasePlugin
from poezio import xhtml
class Plugin(BasePlugin):
def init(self):
......
......@@ -26,7 +26,7 @@ Configuration options
.. _client state indication: https://xmpp.org/extensions/xep-0352.html
"""
from plugin import BasePlugin
from poezio.plugin import BasePlugin
import os
import stat
import pyinotify
......
......@@ -18,11 +18,11 @@ This plugin adds a command to the chat tabs.
"""
from plugin import BasePlugin
from decorators import command_args_parser
import tabs
import common
import timed_events
from poezio.plugin import BasePlugin
from poezio.decorators import command_args_parser
from poezio import tabs
from poezio import common
from poezio import timed_events
class Plugin(BasePlugin):
......
......@@ -2,9 +2,9 @@
Shuffle the words in every message you send in a :ref:`muctab`
(may/should confuse the reader).
"""
from plugin import BasePlugin
from poezio.plugin import BasePlugin
from random import shuffle
import xhtml
from poezio import xhtml
class Plugin(BasePlugin):
def init(self):
......
......@@ -84,11 +84,11 @@ Options defined
"""
from plugin import BasePlugin
from xhtml import get_body_from_message_stanza
from timed_events import DelayedEvent
from poezio.plugin import BasePlugin
from poezio.xhtml import get_body_from_message_stanza
from poezio.timed_events import DelayedEvent
import shlex
import common
from poezio import common
class Plugin(BasePlugin):
......
......@@ -2,8 +2,8 @@
Insert a space between each character, in messages that you send, making
them horrible to read.
"""
from plugin import BasePlugin
import xhtml
from poezio.plugin import BasePlugin
from poezio import xhtml
class Plugin(BasePlugin):
def init(self):
......
......@@ -11,7 +11,7 @@ Configuration
"""
from plugin import BasePlugin
from poezio.plugin import BasePlugin
class Plugin(BasePlugin):
def init(self):
......
......@@ -25,7 +25,7 @@ Aliases
Set your status to ``xa``
"""
from plugin import BasePlugin
from poezio.plugin import BasePlugin
class Plugin(BasePlugin):
"""
......
......@@ -17,10 +17,10 @@ You only have to load the plugin:
**Usage:** ``/stoi``
"""
from plugin import BasePlugin
import tabs
from poezio.plugin import BasePlugin
from poezio import tabs
import string
import xhtml
from poezio import xhtml
import random
char_we_dont_want = string.punctuation+' ’„“”…«»'
......
......@@ -19,9 +19,9 @@ This plugin defines two new commands for MUC tabs: :term:`/tell` and :term:`/unt
Cancel all scheduled messages to *nick*.
"""
from plugin import BasePlugin
from decorators import command_args_parser
import tabs
from poezio.plugin import BasePlugin
from poezio.decorators import command_args_parser
from poezio import tabs
class Plugin(BasePlugin):
def init(self):
......
from plugin import BasePlugin
import tabs
from poezio.plugin import BasePlugin
from poezio import tabs
class Plugin(BasePlugin):
def init(self):
......
......@@ -29,7 +29,7 @@ Messages like “2 hours, 25 minutes passed…” are automatically displayed in
"""
from plugin import BasePlugin
from poezio.plugin import BasePlugin
from datetime import datetime, timedelta
class Plugin(BasePlugin):
......
......@@ -11,8 +11,8 @@ Command
Retrieve the uptime of the server of ``jid``.
"""
from plugin import BasePlugin
from common import parse_secs_to_str, safeJID
from poezio.plugin import BasePlugin
from poezio.common import parse_secs_to_str, safeJID
from slixmpp.xmlstream import ET
class Plugin(BasePlugin):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment