Commit 6a1bd5f9 authored by Link Mauve's avatar Link Mauve

Make all relative imports explicit.

parent 7e51947f
......@@ -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 . common import safeJID
from . 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_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 . 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 . 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
import common
import fixes
from common import safeJID
from config import config, options
from . import common
from . import fixes
from . common import safeJID
from . 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 . common import safeJID
from collections import defaultdict
class Resource(object):
......
......@@ -14,18 +14,18 @@ from slixmpp.xmlstream.stanzabase import StanzaBase
from slixmpp.xmlstream.handler import Callback
from slixmpp.xmlstream.matcher import StanzaPath
import common
import fixes
import pep
import tabs
from bookmarks import Bookmark
from common import safeJID
from config import config, DEFAULT_CONFIG, options as config_opts
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 .. 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 . structs import Command, POSSIBLE_SHOW
......
......@@ -8,12 +8,12 @@ log = logging.getLogger(__name__)
import os
from functools import reduce
import common
import pep
import tabs
from common import safeJID
from config import config
from roster import roster
from .. import common
from .. import pep
from .. import tabs
from .. common import safeJID
from .. config import config
from .. roster import roster
from . structs import POSSIBLE_SHOW
......
......@@ -19,29 +19,29 @@ import time
from slixmpp.xmlstream.handler import Callback
import connection
import decorators
import events
import multiuserchat as muc
import singleton
import tabs
import theming
import timed_events
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 size_manager import SizeManager
from text_buffer import TextBuffer
from theming import get_theme
import keyboard
from .. import connection
from .. import decorators
from .. import events
from .. import multiuserchat as muc
from .. import singleton
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 .. size_manager import SizeManager
from .. text_buffer import TextBuffer
from .. theming import get_theme
from .. 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
import common
import fixes
import pep
import tabs
import windows
import xhtml
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 .. 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 . commands import dumb_callback
......
......@@ -2,7 +2,7 @@
Module containing various decorators
"""
import common
from . import common
class RefreshWrapper(object):
def __init__(self):
......
......@@ -16,16 +16,16 @@ import re
from os import makedirs
from datetime import datetime
import common
from config import config
from xhtml import clean_text
from theming import dump_tuple, get_theme
from . import common
from . config import config
from . xhtml import clean_text
from . theming import dump_tuple, get_theme
import logging
log = logging.getLogger(__name__)
from config import LOG_DIR as log_dir
from . 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 . 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
import config
from . timed_events import TimedEvent, DelayedEvent
from . import config
import inspect
import traceback
import logging
......
......@@ -9,10 +9,10 @@ import os
from os import path
import logging
import core
import tabs
from plugin import PluginAPI
from config import config
from . import core
from . import tabs
from . plugin import PluginAPI
from . config import config
log = logging.getLogger(__name__)
......@@ -375,7 +375,7 @@ class PluginManager(object):
self.load_path.append(self.plugins_dir)
try:
import poezio_plugins
from . import poezio_plugins
except:
pass
else:
......
......@@ -17,7 +17,7 @@ import logging
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
import singleton
from . import singleton
def test_curses():
"""
......@@ -48,7 +48,7 @@ def main():
"""
sys.stdout.write("\x1b]0;poezio\x07")
sys.stdout.flush()
import config
from . 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 . config import options
if options.check_config:
config.check_config()
sys.exit(0)
import theming
from . import theming
theming.update_themes_dir()
import logger
from . import logger
logger.create_logger()
import roster
from . import roster
roster.create_roster()
import core
from . 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 . config import config
from . contact import Contact
from . roster_sorting import SORTING_METHODS, GROUP_SORTING_METHODS
from os import path as p
from datetime import datetime
from common import safeJID
from . common import safeJID
from slixmpp.exceptions import IqError, IqTimeout
......
......@@ -16,24 +16,24 @@ revolving around chats.
import logging
log = logging.getLogger(__name__)
import singleton
from .. import singleton
import string
import time
import weakref
from datetime import datetime, timedelta
from xml.etree import cElementTree as ET
import core
import timed_events
import windows
import xhtml
from common import safeJID
from config import config
from decorators import refresh_wrapper
from logger import logger
from text_buffer import TextBuffer
from theming import get_theme, dump_tuple
from decorators import command_args_parser
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 .. text_buffer import TextBuffer
from .. theming import get_theme, dump_tuple
from .. 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__)
import windows
from bookmarks import Bookmark, BookmarkList, stanza_storage
from tabs import Tab
from common import safeJID
from .. import windows
from .. bookmarks import Bookmark, BookmarkList, stanza_storage
from .. tabs import Tab
from .. common import safeJID
class BookmarksTab(Tab):
......
......@@ -18,16 +18,16 @@ import curses
from . basetabs import OneToOneTab, Tab
import common
import fixes
import windows
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 .. 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
class ConversationTab(OneToOneTab):
"""
......
......@@ -5,8 +5,8 @@ Defines the data-forms Tab
import logging
log = logging.getLogger(__name__)
import windows
from tabs import Tab
from .. import windows
from .. tabs import Tab
class DataFormsTab(Tab):
"""
......
......@@ -10,9 +10,9 @@ log = logging.getLogger(__name__)
import curses
import collections
import windows
from common import safeJID
from decorators import refresh_wrapper
from .. import windows
from .. common import safeJID
from .. decorators import refresh_wrapper
from . import Tab
......
......@@ -19,19 +19,19 @@ from datetime import datetime
from . import ChatTab, Tab
import common
import fixes
import multiuserchat as muc
import timed_events
import windows
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 .. 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
SHOW_NAME = {
......
......@@ -17,15 +17,15 @@ import curses
from . import OneToOneTab, MucTab, Tab
import fixes
import windows
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 .. 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
class PrivateTab(OneToOneTab):
"""
......
......@@ -18,15 +18,15 @@ from functools import partial
from . import Tab
import common
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 .. 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
class RosterInfoTab(Tab):
"""
......
......@@ -17,11 +17,11 @@ from xml.etree import ElementTree as ET
from . import Tab
import text_buffer
import windows
from xhtml import clean_text
from decorators import command_args_parser, refresh_wrapper
from common import safeJID
from .. import text_buffer
from .. import windows
from .. xhtml import clean_text
from .. decorators import command_args_parser, refresh_wrapper
from .. common import safeJID
class MatchJID(object):
......
......@@ -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 . config import config
from . theming import get_theme, dump_tuple
class Message:
__slots__ = ('txt', 'nick_color', 'time', 'str_time', 'nickname', 'user',
......
......@@ -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 . config import config
import curses
import os
......
......@@ -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
import xhtml
from . import xhtml
from theming import get_theme
from . theming import get_theme
import logging
log = logging.getLogger(__name__)
......
......@@ -14,9 +14,9 @@ import collections
import curses
import string
import core
import singleton
from theming import to_curses_attr, read_tuple
from .. import core
from .. import singleton
from .. 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 .. theming import to_curses_attr, get_theme
from .. 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 .. theming import to_curses_attr, get_theme
class FieldInput(object):
"""
......