Commit ab86e799 authored by mathieui's avatar mathieui

Use absolute imports instead of relative ones

All this crap is very brittle due to circular deps and python handling
them badly. This appears to be fixing some stuff, at the very least.

This is sed, so cleanup of imports (which can now be grouped together)
is not done yet.
parent 5680d158
......@@ -14,18 +14,18 @@ from slixmpp.xmlstream.stanzabase import StanzaBase
from slixmpp.xmlstream.handler import Callback
from slixmpp.xmlstream.matcher import StanzaPath
from .. import common
from .. import fixes
from .. import pep
from .. import tabs
from .. bookmarks import Bookmark
from .. common import safeJID
from .. config import config, DEFAULT_CONFIG, options as config_opts
from .. import multiuserchat as muc
from .. plugin import PluginConfig
from .. roster import roster
from .. theming import dump_tuple, get_theme
from .. decorators import command_args_parser
from poezio import common
from poezio import fixes
from poezio import pep
from poezio import tabs
from poezio.bookmarks import Bookmark
from poezio.common import safeJID
from poezio.config import config, DEFAULT_CONFIG, options as config_opts
from poezio import multiuserchat as muc
from poezio.plugin import PluginConfig
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
......
......@@ -8,12 +8,12 @@ log = logging.getLogger(__name__)
import os
from functools import reduce
from .. import common
from .. import pep
from .. import tabs
from .. common import safeJID
from .. config import config
from .. roster import roster
from poezio import common
from poezio import pep
from poezio import tabs
from poezio.common import safeJID
from poezio.config import config
from poezio.roster import roster
from . structs import POSSIBLE_SHOW
......
......@@ -19,29 +19,29 @@ import time
from slixmpp.xmlstream.handler import Callback
from .. import connection
from .. import decorators
from .. import events
from .. import multiuserchat as muc
from .. import tabs
from .. import theming
from .. import timed_events
from .. import windows
from .. bookmarks import BookmarkList
from .. common import safeJID
from .. config import config, firstrun
from .. contact import Contact, Resource
from .. daemon import Executor
from .. fifo import Fifo
from .. logger import logger
from .. plugin_manager import PluginManager
from .. roster import roster
from .. singleton import Singleton
from .. size_manager import SizeManager
from .. text_buffer import TextBuffer
from .. theming import get_theme
from .. import keyboard
from poezio import connection
from poezio import decorators
from poezio import events
from poezio import multiuserchat as muc
from poezio import tabs
from poezio import theming
from poezio import timed_events
from poezio import windows
from poezio.bookmarks import BookmarkList
from poezio.common import safeJID
from poezio.config import config, firstrun
from poezio.contact import Contact, Resource
from poezio.daemon import Executor
from poezio.fifo import Fifo
from poezio.logger import logger
from poezio.plugin_manager import PluginManager
from poezio.roster import roster
from poezio.singleton import Singleton
from poezio.size_manager import SizeManager
from poezio.text_buffer import TextBuffer
from poezio.theming import get_theme
from poezio import keyboard
from . completions import CompletionCore
from . commands import CommandCore
......
......@@ -19,20 +19,20 @@ from slixmpp import InvalidJID
from slixmpp.xmlstream.stanzabase import StanzaBase, ElementBase
from xml.etree import ElementTree as ET
from .. import common
from .. import fixes
from .. import pep
from .. import tabs
from .. import windows
from .. import xhtml
from .. import multiuserchat as muc
from .. common import safeJID
from .. config import config, CACHE_DIR
from .. contact import Resource
from .. logger import logger
from .. roster import roster
from .. text_buffer import CorrectionError, AckError
from .. theming import dump_tuple, get_theme
from poezio import common
from poezio import fixes
from poezio import pep
from poezio import tabs
from poezio import windows
from poezio import xhtml
from poezio import multiuserchat as muc
from poezio.common import safeJID
from poezio.config import config, CACHE_DIR
from poezio.contact import Resource
from poezio.logger import logger
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
......
......@@ -22,18 +22,18 @@ import weakref
from datetime import datetime, timedelta
from xml.etree import cElementTree as ET
from .. import core
from .. import timed_events
from .. import windows
from .. import xhtml
from .. common import safeJID
from .. config import config
from .. decorators import refresh_wrapper
from .. logger import logger
from .. singleton import Singleton
from .. text_buffer import TextBuffer
from .. theming import get_theme, dump_tuple
from .. decorators import command_args_parser
from poezio import core
from poezio import timed_events
from poezio import windows
from poezio import xhtml
from poezio.common import safeJID
from poezio.config import config
from poezio.decorators import refresh_wrapper
from poezio.logger import logger
from poezio.singleton import Singleton
from poezio.text_buffer import TextBuffer
from poezio.theming import get_theme, dump_tuple
from poezio.decorators import command_args_parser
# getters for tab colors (lambdas, so that they are dynamic)
STATE_COLORS = {
......
......@@ -5,10 +5,10 @@ Defines the data-forms Tab
import logging
log = logging.getLogger(__name__)
from .. import windows
from .. bookmarks import Bookmark, BookmarkList, stanza_storage
from .. tabs import Tab
from .. common import safeJID
from poezio import windows
from poezio.bookmarks import Bookmark, BookmarkList, stanza_storage
from poezio.tabs import Tab
from poezio.common import safeJID
class BookmarksTab(Tab):
......
......@@ -18,16 +18,16 @@ import curses
from . basetabs import OneToOneTab, Tab
from .. import common
from .. import fixes
from .. import windows
from .. import xhtml
from .. common import safeJID
from .. config import config
from .. decorators import refresh_wrapper
from .. roster import roster
from .. theming import get_theme, dump_tuple
from .. decorators import command_args_parser
from poezio import common
from poezio import fixes
from poezio import windows
from poezio import xhtml
from poezio.common import safeJID
from poezio.config import config
from poezio.decorators import refresh_wrapper
from poezio.roster import roster
from poezio.theming import get_theme, dump_tuple
from poezio.decorators import command_args_parser
class ConversationTab(OneToOneTab):
"""
......
......@@ -5,8 +5,8 @@ Defines the data-forms Tab
import logging
log = logging.getLogger(__name__)
from .. import windows
from .. tabs import Tab
from poezio import windows
from poezio.tabs import Tab
class DataFormsTab(Tab):
"""
......
......@@ -10,9 +10,9 @@ log = logging.getLogger(__name__)
import curses
import collections
from .. import windows
from .. common import safeJID
from .. decorators import refresh_wrapper
from poezio import windows
from poezio.common import safeJID
from poezio.decorators import refresh_wrapper
from . import Tab
......
......@@ -19,19 +19,19 @@ from datetime import datetime
from . import ChatTab, Tab
from .. import common
from .. import fixes
from .. import multiuserchat as muc
from .. import timed_events
from .. import windows
from .. import xhtml
from .. common import safeJID
from .. config import config
from .. decorators import refresh_wrapper, command_args_parser
from .. logger import logger
from .. roster import roster
from .. theming import get_theme, dump_tuple
from .. user import User
from poezio import common
from poezio import fixes
from poezio import multiuserchat as muc
from poezio import timed_events
from poezio import windows
from poezio import xhtml
from poezio.common import safeJID
from poezio.config import config
from poezio.decorators import refresh_wrapper, command_args_parser
from poezio.logger import logger
from poezio.roster import roster
from poezio.theming import get_theme, dump_tuple
from poezio.user import User
SHOW_NAME = {
......
......@@ -17,15 +17,15 @@ import curses
from . import OneToOneTab, MucTab, Tab
from .. import fixes
from .. import windows
from .. import xhtml
from .. common import safeJID
from .. config import config
from .. decorators import refresh_wrapper
from .. logger import logger
from .. theming import get_theme, dump_tuple
from .. decorators import command_args_parser
from poezio import fixes
from poezio import windows
from poezio import xhtml
from poezio.common import safeJID
from poezio.config import config
from poezio.decorators import refresh_wrapper
from poezio.logger import logger
from poezio.theming import get_theme, dump_tuple
from poezio.decorators import command_args_parser
class PrivateTab(OneToOneTab):
"""
......
......@@ -18,15 +18,15 @@ from functools import partial
from . import Tab
from .. import common
from .. import windows
from .. common import safeJID
from .. config import config
from .. contact import Contact, Resource
from .. decorators import refresh_wrapper
from .. roster import RosterGroup, roster
from .. theming import get_theme, dump_tuple
from .. decorators import command_args_parser
from poezio import common
from poezio import windows
from poezio.common import safeJID
from poezio.config import config
from poezio.contact import Contact, Resource
from poezio.decorators import refresh_wrapper
from poezio.roster import RosterGroup, roster
from poezio.theming import get_theme, dump_tuple
from poezio.decorators import command_args_parser
class RosterInfoTab(Tab):
"""
......
......@@ -17,11 +17,11 @@ from xml.etree import ElementTree as ET
from . import Tab
from .. import text_buffer
from .. import windows
from .. xhtml import clean_text
from .. decorators import command_args_parser, refresh_wrapper
from .. common import safeJID
from poezio import text_buffer
from poezio import windows
from poezio.xhtml import clean_text
from poezio.decorators import command_args_parser, refresh_wrapper
from poezio.common import safeJID
class MatchJID(object):
......
......@@ -66,7 +66,7 @@ It is used for example to define color gradient, etc.
import logging
log = logging.getLogger(__name__)
from . config import config
from poezio.config import config
import curses
import os
......
......@@ -13,7 +13,7 @@ log = logging.getLogger(__name__)
import curses
import string
from .. theming import to_curses_attr, read_tuple
from poezio.theming import to_curses_attr, read_tuple
FORMAT_CHAR = '\x19'
# These are non-printable chars, so they should never appear in the input,
......
......@@ -6,8 +6,8 @@ import curses
from . import Win
from . inputs import Input
from . data_forms import FieldInput
from .. theming import to_curses_attr, get_theme
from .. common import safeJID
from poezio.theming import to_curses_attr, get_theme
from poezio.common import safeJID
class BookmarkJIDInput(FieldInput, Input):
def __init__(self, field):
......
......@@ -9,7 +9,7 @@ others when needed.
from . import Win
from . inputs import Input
from .. theming import to_curses_attr, get_theme
from poezio.theming import to_curses_attr, get_theme
class FieldInput(object):
"""
......
......@@ -11,9 +11,9 @@ log = logging.getLogger(__name__)
import curses
from .. config import config
from poezio.config import config
from . import Win
from .. theming import get_theme, to_curses_attr
from poezio.theming import get_theme, to_curses_attr
class GlobalInfoBar(Win):
def __init__(self, core):
......
......@@ -6,12 +6,12 @@ info buffer in normal tabs
import logging
log = logging.getLogger(__name__)
from .. common import safeJID
from .. config import config
from poezio.common import safeJID
from poezio.config import config
from . import Win
from . funcs import truncate_nick
from .. theming import get_theme, to_curses_attr
from poezio.theming import get_theme, to_curses_attr
class InfoWin(Win):
"""
......
......@@ -8,7 +8,7 @@ log = logging.getLogger(__name__)
from . import Win
from .. theming import get_theme, to_curses_attr
from poezio.theming import get_theme, to_curses_attr
class HelpText(Win):
......
......@@ -8,14 +8,14 @@ log = logging.getLogger(__name__)
import curses
import string
from .. import keyboard
from .. import common
from .. import poopt
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 .. config import config
from .. theming import to_curses_attr
from poezio.config import config
from poezio.theming import to_curses_attr
class Input(Win):
......
......@@ -8,7 +8,7 @@ log = logging.getLogger(__name__)
import curses
from . import Win
from .. theming import to_curses_attr, get_theme
from poezio.theming import to_curses_attr, get_theme
class ListWin(Win):
......
......@@ -8,7 +8,7 @@ log = logging.getLogger(__name__)
import curses
from . import Win
from .. theming import get_theme, to_curses_attr
from poezio.theming import get_theme, to_curses_attr
class VerticalSeparator(Win):
"""
......
......@@ -9,9 +9,9 @@ import curses
from . import Win
from .. import poopt
from .. config import config
from .. theming import to_curses_attr, get_theme
from poezio import poopt
from poezio.config import config
from poezio.theming import to_curses_attr, get_theme
def userlist_to_cache(userlist):
result = []
......
......@@ -9,11 +9,11 @@ from datetime import datetime
from . import Win
from .. import common
from .. config import config
from .. contact import Contact, Resource
from .. roster import RosterGroup
from .. theming import get_theme, to_curses_attr
from poezio import common
from poezio.config import config
from poezio.contact import Contact, Resource
from poezio.roster import RosterGroup
from poezio.theming import get_theme, to_curses_attr
class RosterWin(Win):
......
......@@ -13,9 +13,9 @@ from . import Win
from . base_wins import FORMAT_CHAR
from . funcs import truncate_nick, parse_attrs
from .. import poopt
from .. config import config
from .. theming import to_curses_attr, get_theme, dump_tuple
from poezio import poopt
from poezio.config import config
from poezio.theming import to_curses_attr, get_theme, dump_tuple
# msg is a reference to the corresponding Message object. text_start and
......
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