Make plugins import from the absolute poezio package.

This commit is contained in:
Emmanuel Gil Peyrot 2016-06-28 00:10:52 +01:00
parent a210303b01
commit 3a24d88353
47 changed files with 111 additions and 111 deletions

View file

@ -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):
"""

View file

@ -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):

View file

@ -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):

View file

@ -45,7 +45,7 @@ This variant is useful if you dont want to care about regular expressions
"""
from plugin import BasePlugin
from poezio.plugin import BasePlugin
import re
allowed_separators = '/#!:;'

View file

@ -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

View file

@ -1,8 +1,8 @@
"""
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):

View file

@ -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

View file

@ -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):

View file

@ -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):

View file

@ -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

View file

@ -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):

View file

@ -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):

View file

@ -1,7 +1,7 @@
"""
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):

View file

@ -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):

View file

@ -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):

View file

@ -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

View file

@ -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):

View file

@ -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 = {

View file

@ -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)

View file

@ -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):

View file

@ -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):

View file

@ -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')

View file

@ -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):

View file

@ -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

View file

@ -19,7 +19,7 @@ Configuration
"""
from plugin import BasePlugin
from poezio.plugin import BasePlugin
import os
import stat
import logging

View file

@ -33,7 +33,7 @@ Command
"""
from plugin import BasePlugin
from poezio.plugin import BasePlugin
from random import randrange
class Plugin(BasePlugin):

View file

@ -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__)

View file

@ -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))

View file

@ -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):

View file

@ -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

View file

@ -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):

View file

@ -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,

View file

@ -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

View file

@ -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):

View file

@ -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):

View file

@ -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

View file

@ -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):

View file

@ -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):

View file

@ -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):

View file

@ -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):

View file

@ -11,7 +11,7 @@ Configuration
"""
from plugin import BasePlugin
from poezio.plugin import BasePlugin
class Plugin(BasePlugin):
def init(self):

View file

@ -25,7 +25,7 @@ Aliases
Set your status to ``xa``
"""
from plugin import BasePlugin
from poezio.plugin import BasePlugin
class Plugin(BasePlugin):
"""

View file

@ -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+' ’„“”…«»'

View file

@ -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):

View file

@ -1,5 +1,5 @@
from plugin import BasePlugin
import tabs
from poezio.plugin import BasePlugin
from poezio import tabs
class Plugin(BasePlugin):
def init(self):

View file

@ -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):

View file

@ -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):