Commit 8f7be37a authored by mathieui's avatar mathieui
Browse files

Absolute imports everywhere

parent 945035fc
......@@ -33,8 +33,8 @@ import logging
from slixmpp.plugins.xep_0048 import Bookmarks, Conference, URL
from slixmpp import JID
from . common import safeJID
from . config import config
from poezio.common import safeJID
from poezio.config import config
log = logging.getLogger(__name__)
......
......@@ -11,7 +11,7 @@ Various useful functions.
from datetime import datetime, timedelta
from slixmpp import JID, InvalidJID
from . poezio_shlex import shlex
from poezio.poezio_shlex import shlex
import base64
import os
......
......@@ -21,7 +21,7 @@ import pkg_resources
from configparser import RawConfigParser, NoOptionError, NoSectionError
from os import environ, makedirs, path, remove
from shutil import copy2
from . args import parse_args
from poezio.args import parse_args
DEFAULT_CONFIG = {
'Poezio': {
......@@ -642,7 +642,7 @@ def setup_logging():
def post_logging_setup():
# common imports slixmpp, which creates then its loggers, so
# it needs to be after logger configuration
from . common import safeJID as JID
from poezio.common import safeJID as JID
global safeJID
safeJID = JID
......
......@@ -20,10 +20,10 @@ import sys
import slixmpp
from slixmpp.plugins.xep_0184 import XEP_0184
from . import common
from . import fixes
from . common import safeJID
from . config import config, options
from poezio import common
from poezio import fixes
from poezio.common import safeJID
from poezio.config import config, options
class Connection(slixmpp.ClientXMPP):
"""
......
......@@ -13,7 +13,7 @@ the roster.
import logging
log = logging.getLogger(__name__)
from . common import safeJID
from poezio.common import safeJID
from collections import defaultdict
class Resource(object):
......
"""
Core class, split into smaller chunks
"""
__all__ = ['Core', 'Command', 'Status']
from . core import Core
from . structs import Command, Status
from poezio.core.core import Core
from poezio.core.structs import Command, Status
......@@ -27,7 +27,7 @@ from poezio.roster import roster
from poezio.theming import dump_tuple, get_theme
from poezio.decorators import command_args_parser
from . structs import Command, POSSIBLE_SHOW
from poezio.core.structs import Command, POSSIBLE_SHOW
class CommandCore:
......
......@@ -15,7 +15,7 @@ from poezio.common import safeJID
from poezio.config import config
from poezio.roster import roster
from . structs import POSSIBLE_SHOW
from poezio.core.structs import POSSIBLE_SHOW
class CompletionCore:
......
......@@ -43,10 +43,10 @@ from poezio.text_buffer import TextBuffer
from poezio.theming import get_theme
from poezio import keyboard
from . completions import CompletionCore
from . commands import CommandCore
from . handlers import HandlerCore
from . structs import POSSIBLE_SHOW, DEPRECATED_ERRORS, \
from poezio.core.completions import CompletionCore
from poezio.core.commands import CommandCore
from poezio.core.handlers import HandlerCore
from poezio.core.structs import POSSIBLE_SHOW, DEPRECATED_ERRORS, \
ERROR_AND_STATUS_CODES, Command, Status
......
......@@ -34,7 +34,7 @@ from poezio.roster import roster
from poezio.text_buffer import CorrectionError, AckError
from poezio.theming import dump_tuple, get_theme
from . commands import dumb_callback
from poezio.core.commands import dumb_callback
try:
from pygments import highlight
......
......@@ -2,7 +2,7 @@
Module containing various decorators
"""
from . import common
from poezio import common
class RefreshWrapper(object):
def __init__(self):
......
......@@ -16,16 +16,16 @@ import re
from os import makedirs
from datetime import datetime
from . import common
from . config import config
from . xhtml import clean_text
from . theming import dump_tuple, get_theme
from poezio import common
from poezio.config import config
from poezio.xhtml import clean_text
from poezio.theming import dump_tuple, get_theme
import logging
log = logging.getLogger(__name__)
from . config import LOG_DIR as log_dir
from poezio.config import LOG_DIR as log_dir
message_log_re = re.compile(r'MR (\d{4})(\d{2})(\d{2})T'
r'(\d{2}):(\d{2}):(\d{2})Z '
......
......@@ -13,7 +13,7 @@ slix plugin
from xml.etree import cElementTree as ET
from . common import safeJID
from poezio.common import safeJID
import logging
log = logging.getLogger(__name__)
......
......@@ -6,8 +6,8 @@ These are used in the plugin system added in poezio 0.7.5
import os
from functools import partial
from configparser import RawConfigParser
from . timed_events import TimedEvent, DelayedEvent
from . import config
from poezio.timed_events import TimedEvent, DelayedEvent
from poezio import config
import inspect
import traceback
import logging
......
......@@ -9,10 +9,10 @@ import os
from os import path
import logging
from . import core
from . import tabs
from . plugin import PluginAPI
from . config import config
from poezio import core
from poezio import tabs
from poezio.plugin import PluginAPI
from poezio.config import config
log = logging.getLogger(__name__)
......@@ -375,7 +375,7 @@ class PluginManager(object):
self.load_path.append(self.plugins_dir)
try:
from . import poezio_plugins
from poezio import poezio_plugins
except:
pass
else:
......
......@@ -17,7 +17,7 @@ import logging
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
from . singleton import Singleton
from poezio.singleton import Singleton
def test_curses():
"""
......@@ -48,7 +48,7 @@ def main():
"""
sys.stdout.write("\x1b]0;poezio\x07")
sys.stdout.flush()
from . import config
from poezio import config
config_path = config.check_create_config_dir()
config.run_cmdline_args(config_path)
config.create_global_config()
......@@ -57,22 +57,22 @@ def main():
config.setup_logging()
config.post_logging_setup()
from . config import options
from poezio.config import options
if options.check_config:
config.check_config()
sys.exit(0)
from . import theming
from poezio import theming
theming.update_themes_dir()
from . import logger
from poezio import logger
logger.create_logger()
from . import roster
from poezio import roster
roster.create_roster()
from . import core
from poezio import core
log = logging.getLogger('')
......
......@@ -12,13 +12,13 @@ Defines the Roster and RosterGroup classes
import logging
log = logging.getLogger(__name__)
from . config import config
from . contact import Contact
from . roster_sorting import SORTING_METHODS, GROUP_SORTING_METHODS
from poezio.config import config
from poezio.contact import Contact
from poezio.roster_sorting import SORTING_METHODS, GROUP_SORTING_METHODS
from os import path as p
from datetime import datetime
from . common import safeJID
from poezio.common import safeJID
from slixmpp.exceptions import IqError, IqTimeout
......
from . basetabs import Tab, ChatTab, GapTab, OneToOneTab
from . basetabs import STATE_PRIORITY
from . rostertab import RosterInfoTab
from . muctab import MucTab, NS_MUC_USER
from . privatetab import PrivateTab
from . conversationtab import ConversationTab, StaticConversationTab,\
from poezio.tabs.basetabs import Tab, ChatTab, GapTab, OneToOneTab
from poezio.tabs.basetabs import STATE_PRIORITY
from poezio.tabs.rostertab import RosterInfoTab
from poezio.tabs.muctab import MucTab, NS_MUC_USER
from poezio.tabs.privatetab import PrivateTab
from poezio.tabs.conversationtab import ConversationTab, StaticConversationTab,\
DynamicConversationTab
from . xmltab import XMLTab
from . listtab import ListTab
from . muclisttab import MucListTab
from . adhoc_commands_list import AdhocCommandsListTab
from . data_forms import DataFormsTab
from . bookmarkstab import BookmarksTab
from poezio.tabs.xmltab import XMLTab
from poezio.tabs.listtab import ListTab
from poezio.tabs.muclisttab import MucListTab
from poezio.tabs.adhoc_commands_list import AdhocCommandsListTab
from poezio.tabs.data_forms import DataFormsTab
from poezio.tabs.bookmarkstab import BookmarksTab
......@@ -7,7 +7,7 @@ nothing.
import logging
log = logging.getLogger(__name__)
from . import ListTab
from poezio.tabs import ListTab
from slixmpp.plugins.xep_0030.stanza.items import DiscoItem
......
......@@ -16,7 +16,7 @@ log = logging.getLogger(__name__)
import curses
from . basetabs import OneToOneTab, Tab
from poezio.tabs.basetabs import OneToOneTab, Tab
from poezio import common
from poezio import fixes
......
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