Commit 8f7be37a authored by mathieui's avatar mathieui

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
......
......@@ -14,7 +14,7 @@ from poezio import windows
from poezio.common import safeJID
from poezio.decorators import refresh_wrapper
from . import Tab
from poezio.tabs import Tab
class ListTab(Tab):
......
......@@ -7,7 +7,7 @@ user to join the rooms.
import logging
log = logging.getLogger(__name__)
from . import ListTab
from poezio.tabs import ListTab
from slixmpp.plugins.xep_0030.stanza.items import DiscoItem
......
......@@ -17,7 +17,7 @@ import random
import re
from datetime import datetime
from . import ChatTab, Tab
from poezio.tabs import ChatTab, Tab
from poezio import common
from poezio import fixes
......
......@@ -15,7 +15,7 @@ log = logging.getLogger(__name__)
import curses
from . import OneToOneTab, MucTab, Tab
from poezio.tabs import OneToOneTab, MucTab, Tab
from poezio import fixes
from poezio import windows
......
......@@ -16,8 +16,6 @@ import ssl
from os import getenv, path
from functools import partial
from . import Tab
from poezio import common
from poezio import windows
from poezio.common import safeJID
......@@ -28,6 +26,9 @@ from poezio.roster import RosterGroup, roster
from poezio.theming import get_theme, dump_tuple
from poezio.decorators import command_args_parser
from poezio.tabs import Tab
class RosterInfoTab(Tab):
"""
A tab, splitted in two, containing the roster and infos
......
......@@ -15,7 +15,7 @@ from slixmpp.xmlstream.tostring import tostring
from slixmpp.xmlstream.stanzabase import ElementBase
from xml.etree import ElementTree as ET
from . import Tab
from poezio.tabs import Tab
from poezio import text_buffer
from poezio import windows
......
......@@ -12,8 +12,8 @@ import logging
log = logging.getLogger(__name__)
from datetime import datetime
from . config import config
from . theming import get_theme, dump_tuple
from poezio.config import config
from poezio.theming import get_theme, dump_tuple
class Message:
__slots__ = ('txt', 'nick_color', 'time', 'str_time', 'nickname', 'user',
......
......@@ -13,9 +13,9 @@ An user is a MUC participant, not a roster contact (see contact.py)
from random import choice
from datetime import timedelta, datetime
from hashlib import md5
from . import xhtml
from poezio import xhtml
from . theming import get_theme
from poezio.theming import get_theme
import logging
log = logging.getLogger(__name__)
......
......@@ -3,18 +3,18 @@ Module exporting all the Windows, which are wrappers around curses wins
used to display information on the screen
"""
from . base_wins import Win
from . data_forms import FormWin
from . bookmark_forms import BookmarksWin
from . info_bar import GlobalInfoBar, VerticalGlobalInfoBar
from . info_wins import InfoWin, XMLInfoWin, PrivateInfoWin, MucListInfoWin, \
from poezio.windows.base_wins import Win
from poezio.windows.data_forms import FormWin
from poezio.windows.bookmark_forms import BookmarksWin
from poezio.windows.info_bar import GlobalInfoBar, VerticalGlobalInfoBar
from poezio.windows.info_wins import InfoWin, XMLInfoWin, PrivateInfoWin, MucListInfoWin, \
ConversationInfoWin, DynamicConversationInfoWin, MucInfoWin, \
ConversationStatusMessageWin, BookmarksInfoWin
from . input_placeholders import HelpText, YesNoInput
from . inputs import Input, HistoryInput, MessageInput, CommandInput
from . list import ListWin, ColumnHeaderWin
from . misc import VerticalSeparator
from . muc import UserList, Topic
from . roster_win import RosterWin, ContactInfoWin
from . text_win import TextWin, XMLTextWin
from poezio.windows.input_placeholders import HelpText, YesNoInput
from poezio.windows.inputs import Input, HistoryInput, MessageInput, CommandInput
from poezio.windows.list import ListWin, ColumnHeaderWin
from poezio.windows.misc import VerticalSeparator
from poezio.windows.muc import UserList, Topic
from poezio.windows.roster_win import RosterWin, ContactInfoWin
from poezio.windows.text_win import TextWin, XMLTextWin
......@@ -3,9 +3,9 @@ Windows used inthe bookmarkstab
"""
import curses
from . import Win
from . inputs import Input
from . data_forms import FieldInput
from poezio.windows import Win
from poezio.windows.inputs import Input
from poezio.windows.data_forms import FieldInput
from poezio.theming import to_curses_attr, get_theme
from poezio.common import safeJID
......
......@@ -6,8 +6,8 @@ does not inherit from the Win base class), as it will create the
others when needed.
"""
from . import Win
from . inputs import Input
from poezio.windows import Win
from poezio.windows.inputs import Input
from poezio.theming import to_curses_attr, get_theme
......
......@@ -4,7 +4,7 @@ Standalone functions used by the modules
import string
from . base_wins import FORMAT_CHAR, format_chars
from poezio.windows.base_wins import FORMAT_CHAR, format_chars
def find_first_format_char(text, chars=None):
if chars is None:
......
......@@ -12,7 +12,7 @@ import curses
from poezio.config import config
from . import Win
from poezio.windows import Win
from poezio.theming import get_theme, to_curses_attr
class GlobalInfoBar(Win):
......
......@@ -9,8 +9,8 @@ log = logging.getLogger(__name__)
from poezio.common import safeJID
from poezio.config import config
from . import Win
from . funcs import truncate_nick
from poezio.windows import Win
from poezio.windows.funcs import truncate_nick
from poezio.theming import get_theme, to_curses_attr
class InfoWin(Win):
......
......@@ -7,7 +7,7 @@ import logging
log = logging.getLogger(__name__)
from . import Win
from poezio.windows import Win
from poezio.theming import get_theme, to_curses_attr
......
......@@ -11,9 +11,9 @@ import string
from poezio import keyboard
from poezio import common
from poezio import poopt
from . import Win
from . base_wins import format_chars
from . funcs import find_first_format_char
from poezio.windows import Win
from poezio.windows.base_wins import format_chars
from poezio.windows.funcs import find_first_format_char
from poezio.config import config
from poezio.theming import to_curses_attr
......
......@@ -7,7 +7,7 @@ log = logging.getLogger(__name__)
import curses
from . import Win
from poezio.windows import Win
from poezio.theming import to_curses_attr, get_theme
......
......@@ -7,7 +7,7 @@ log = logging.getLogger(__name__)
import curses
from . import Win
from poezio.windows import Win
from poezio.theming import get_theme, to_curses_attr
class VerticalSeparator(Win):
......
......@@ -7,7 +7,7 @@ log = logging.getLogger(__name__)
import curses
from . import Win
from poezio.windows import Win
from poezio import poopt
from poezio.config import config
......
......@@ -7,7 +7,7 @@ log = logging.getLogger(__name__)
from datetime import datetime
from . import Win
from poezio.windows import Win
from poezio import common
from poezio.config import config
......
......@@ -9,9 +9,9 @@ log = logging.getLogger(__name__)
import curses
from math import ceil, log10
from . import Win
from . base_wins import FORMAT_CHAR
from . funcs import truncate_nick, parse_attrs
from poezio.windows import Win
from poezio.windows.base_wins import FORMAT_CHAR
from poezio.windows.funcs import truncate_nick, parse_attrs
from poezio import poopt
from poezio.config import config
......
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