summaryrefslogtreecommitdiff
path: root/alot
diff options
context:
space:
mode:
authorLucas Hoffmann <l-m-h@web.de>2016-07-14 14:18:48 +0200
committerLucas Hoffmann <l-m-h@web.de>2016-12-09 11:26:19 +0100
commitfe748a7f47fb61d46dd88c270c2329e6ff19a895 (patch)
tree66bb5dc3145ef621db21e6505d91591e6b414d0f /alot
parentd89bbe11537abfceb3d0c7b62b9325fceaf51e32 (diff)
Clean up imports
- use relative imports if possible - group imports into standard library, third party, and alot modules - sort imports alphabetically
Diffstat (limited to 'alot')
-rw-r--r--alot/account.py8
-rw-r--r--alot/buffers.py30
-rw-r--r--alot/commands/__init__.py13
-rw-r--r--alot/commands/bufferlist.py2
-rw-r--r--alot/commands/envelope.py35
-rw-r--r--alot/commands/globals.py50
-rw-r--r--alot/commands/search.py12
-rw-r--r--alot/commands/taglist.py4
-rw-r--r--alot/commands/thread.py57
-rw-r--r--alot/commands/utils.py4
-rw-r--r--alot/completion.py22
-rw-r--r--alot/crypto.py3
-rw-r--r--alot/db/__init__.py4
-rw-r--r--alot/db/attachment.py9
-rw-r--r--alot/db/envelope.py18
-rw-r--r--alot/db/manager.py24
-rw-r--r--alot/db/message.py10
-rw-r--r--alot/db/thread.py4
-rw-r--r--alot/db/utils.py22
-rw-r--r--alot/helper.py11
-rw-r--r--alot/settings/__init__.py2
-rw-r--r--alot/settings/checks.py4
-rw-r--r--alot/settings/manager.py28
-rw-r--r--alot/settings/theme.py12
-rw-r--r--alot/settings/utils.py2
-rw-r--r--alot/ui.py22
-rw-r--r--alot/walker.py2
-rw-r--r--alot/widgets/globals.py10
-rw-r--r--alot/widgets/search.py10
-rw-r--r--alot/widgets/thread.py16
30 files changed, 225 insertions, 225 deletions
diff --git a/alot/account.py b/alot/account.py
index 9e83b54c..6687f13c 100644
--- a/alot/account.py
+++ b/alot/account.py
@@ -1,13 +1,13 @@
# Copyright (C) 2011-2012 Patrick Totzke <patricktotzke@gmail.com>
# This file is released under the GNU GPL, version 3 or a later revision.
# For further details see the COPYING file
-import mailbox
+import glob
import logging
+import mailbox
import os
-import glob
-from alot.helper import call_cmd_async
-from alot.helper import split_commandstring
+from .helper import call_cmd_async
+from .helper import split_commandstring
class SendingMailFailed(RuntimeError):
diff --git a/alot/buffers.py b/alot/buffers.py
index ba782f35..6b5cb9c7 100644
--- a/alot/buffers.py
+++ b/alot/buffers.py
@@ -1,24 +1,24 @@
# Copyright (C) 2011-2012 Patrick Totzke <patricktotzke@gmail.com>
# This file is released under the GNU GPL, version 3 or a later revision.
# For further details see the COPYING file
-import urwid
-import os
-from notmuch import NotmuchError
import logging
+import os
-from settings import settings
-import commands
-from walker import PipeWalker
-from helper import shorten_author_string
-from db.errors import NonexistantObjectError
-
-from alot.widgets.globals import TagWidget
-from alot.widgets.globals import HeadersList
-from alot.widgets.globals import AttachmentWidget
-from alot.widgets.bufferlist import BufferlineWidget
-from alot.widgets.search import ThreadlineWidget
-from alot.widgets.thread import ThreadTree
+import urwid
from urwidtrees import ArrowTree, TreeBox, NestedTree
+from notmuch import NotmuchError
+
+from .settings import settings
+from . import commands
+from .walker import PipeWalker
+from .helper import shorten_author_string
+from .db.errors import NonexistantObjectError
+from .widgets.globals import TagWidget
+from .widgets.globals import HeadersList
+from .widgets.globals import AttachmentWidget
+from .widgets.bufferlist import BufferlineWidget
+from .widgets.search import ThreadlineWidget
+from .widgets.thread import ThreadTree
class Buffer(object):
diff --git a/alot/commands/__init__.py b/alot/commands/__init__.py
index d19508ab..7fa83a07 100644
--- a/alot/commands/__init__.py
+++ b/alot/commands/__init__.py
@@ -1,15 +1,14 @@
# Copyright (C) 2011-2012 Patrick Totzke <patricktotzke@gmail.com>
# This file is released under the GNU GPL, version 3 or a later revision.
# For further details see the COPYING file
-import os
-import re
+import argparse
import glob
import logging
-import argparse
+import os
+import re
-from alot.settings import settings
-import alot.helper
-from alot.helper import split_commandstring
+from ..settings import settings
+from ..helper import split_commandstring, string_decode
class Command(object):
@@ -177,7 +176,7 @@ def commandfactory(cmdline, mode='global'):
args = split_commandstring(cmdline)
except ValueError as e:
raise CommandParseError(e.message)
- args = map(lambda x: alot.helper.string_decode(x, 'utf-8'), args)
+ args = map(lambda x: string_decode(x, 'utf-8'), args)
logging.debug('ARGS: %s', args)
cmdname = args[0]
args = args[1:]
diff --git a/alot/commands/bufferlist.py b/alot/commands/bufferlist.py
index ef58c6fc..e78663ec 100644
--- a/alot/commands/bufferlist.py
+++ b/alot/commands/bufferlist.py
@@ -1,7 +1,7 @@
# Copyright (C) 2011-2012 Patrick Totzke <patricktotzke@gmail.com>
# This file is released under the GNU GPL, version 3 or a later revision.
# For further details see the COPYING file
-from alot.commands import Command, registerCommand
+from ..commands import Command, registerCommand
from . import globals
MODE = 'bufferlist'
diff --git a/alot/commands/envelope.py b/alot/commands/envelope.py
index 712c2c76..64d5edea 100644
--- a/alot/commands/envelope.py
+++ b/alot/commands/envelope.py
@@ -2,28 +2,29 @@
# This file is released under the GNU GPL, version 3 or a later revision.
# For further details see the COPYING file
import argparse
-import os
-import re
+import datetime
+import email
import glob
import logging
-import email
+import os
+import re
import tempfile
+
from twisted.internet.defer import inlineCallbacks
-import datetime
-from alot.account import SendingMailFailed, StoreMailError
-from alot.errors import GPGProblem
-from alot import buffers
-from alot import commands
-from alot import crypto
-from alot.commands import Command, registerCommand
-from alot.commands import globals
-from alot.commands.utils import get_keys
-from alot.helper import string_decode
-from alot.helper import email_as_string
-from alot.settings import settings
-from alot.utils.booleanaction import BooleanAction
-from alot.db.errors import DatabaseError
+from . import Command, registerCommand
+from . import globals
+from .utils import get_keys
+from .. import buffers
+from .. import commands
+from .. import crypto
+from ..account import SendingMailFailed, StoreMailError
+from ..db.errors import DatabaseError
+from ..errors import GPGProblem
+from ..helper import email_as_string
+from ..helper import string_decode
+from ..settings import settings
+from ..utils.booleanaction import BooleanAction
MODE = 'envelope'
diff --git a/alot/commands/globals.py b/alot/commands/globals.py
index 6e4ac673..49906513 100644
--- a/alot/commands/globals.py
+++ b/alot/commands/globals.py
@@ -1,36 +1,38 @@
# Copyright (C) 2011-2012 Patrick Totzke <patricktotzke@gmail.com>
# This file is released under the GNU GPL, version 3 or a later revision.
# For further details see the COPYING file
+import argparse
+import code
+import email
+import glob
+import logging
import os
import re
-import code
-from twisted.internet import threads
import subprocess
-import email
+from StringIO import StringIO
+
import urwid
from twisted.internet.defer import inlineCallbacks
-import logging
-import argparse
-import glob
-from StringIO import StringIO
+from twisted.internet import threads
-from alot.commands import Command, registerCommand
-from alot.completion import CommandLineCompleter
-from alot.commands import CommandCanceled
-from alot.commands.utils import get_keys
-from alot import buffers
-from alot.widgets.utils import DialogBox
-from alot import helper
-from alot.db.errors import DatabaseLockedError
-from alot.completion import ContactsCompleter
-from alot.completion import AccountCompleter
-from alot.completion import TagsCompleter
-from alot.db.envelope import Envelope
-from alot import commands
-from alot.settings import settings
-from alot.helper import split_commandstring
-from alot.helper import mailto_to_envelope
-from alot.utils.booleanaction import BooleanAction
+from . import Command, registerCommand
+from . import CommandCanceled
+from .utils import get_keys
+from .. import commands
+
+from .. import buffers
+from .. import helper
+from ..helper import split_commandstring
+from ..helper import mailto_to_envelope
+from ..completion import CommandLineCompleter
+from ..completion import ContactsCompleter
+from ..completion import AccountCompleter
+from ..completion import TagsCompleter
+from ..widgets.utils import DialogBox
+from ..db.errors import DatabaseLockedError
+from ..db.envelope import Envelope
+from ..settings import settings
+from ..utils.booleanaction import BooleanAction
MODE = 'global'
diff --git a/alot/commands/search.py b/alot/commands/search.py
index 7a2184ae..b79ce831 100644
--- a/alot/commands/search.py
+++ b/alot/commands/search.py
@@ -4,13 +4,13 @@
import argparse
import logging
-from alot.commands import Command, registerCommand
-from alot.commands.globals import PromptCommand
-from alot.commands.globals import MoveCommand
+from . import Command, registerCommand
+from .globals import PromptCommand
+from .globals import MoveCommand
+from .. import commands
-from alot.db.errors import DatabaseROError
-from alot import commands
-from alot import buffers
+from .. import buffers
+from ..db.errors import DatabaseROError
MODE = 'search'
diff --git a/alot/commands/taglist.py b/alot/commands/taglist.py
index 6e588435..1fa01369 100644
--- a/alot/commands/taglist.py
+++ b/alot/commands/taglist.py
@@ -1,8 +1,8 @@
# Copyright (C) 2011-2012 Patrick Totzke <patricktotzke@gmail.com>
# This file is released under the GNU GPL, version 3 or a later revision.
# For further details see the COPYING file
-from alot.commands import Command, registerCommand
-from alot.commands.globals import SearchCommand
+from . import Command, registerCommand
+from .globals import SearchCommand
MODE = 'taglist'
diff --git a/alot/commands/thread.py b/alot/commands/thread.py
index f5c6141d..306f2619 100644
--- a/alot/commands/thread.py
+++ b/alot/commands/thread.py
@@ -1,41 +1,40 @@
# Copyright (C) 2011-2012 Patrick Totzke <patricktotzke@gmail.com>
# This file is released under the GNU GPL, version 3 or a later revision.
# For further details see the COPYING file
+import argparse
+import logging
+import mailcap
import os
import re
-import logging
-import tempfile
-import argparse
-from twisted.internet.defer import inlineCallbacks
import subprocess
+import tempfile
from email.Utils import getaddresses, parseaddr
from email.message import Message
-import mailcap
+
+from twisted.internet.defer import inlineCallbacks
from cStringIO import StringIO
-from alot.commands import Command, registerCommand
-from alot.commands.globals import ExternalCommand
-from alot.commands.globals import FlushCommand
-from alot.commands.globals import ComposeCommand
-from alot.commands.globals import MoveCommand
-from alot.commands.globals import CommandCanceled
-from alot.commands.envelope import SendCommand
-from alot import completion
-from alot.db.utils import decode_header
-from alot.db.utils import encode_header
-from alot.db.utils import extract_headers
-from alot.db.utils import extract_body
-from alot.db.envelope import Envelope
-from alot.db.attachment import Attachment
-from alot.db.errors import DatabaseROError
-from alot.settings import settings
-from alot.helper import parse_mailcap_nametemplate
-from alot.helper import split_commandstring
-from alot.helper import email_as_string
-from alot.utils.booleanaction import BooleanAction
-from alot.completion import ContactsCompleter
-
-from alot.widgets.globals import AttachmentWidget
+from . import Command, registerCommand
+from .globals import ExternalCommand
+from .globals import FlushCommand
+from .globals import ComposeCommand
+from .globals import MoveCommand
+from .globals import CommandCanceled
+from .envelope import SendCommand
+from ..completion import ContactsCompleter, PathCompleter
+from ..db.utils import decode_header
+from ..db.utils import encode_header
+from ..db.utils import extract_headers
+from ..db.utils import extract_body
+from ..db.envelope import Envelope
+from ..db.attachment import Attachment
+from ..db.errors import DatabaseROError
+from ..settings import settings
+from ..helper import parse_mailcap_nametemplate
+from ..helper import split_commandstring
+from ..helper import email_as_string
+from ..utils.booleanaction import BooleanAction
+from ..widgets.globals import AttachmentWidget
MODE = 'thread'
@@ -862,7 +861,7 @@ class SaveAttachmentCommand(Command):
@inlineCallbacks
def apply(self, ui):
- pcomplete = completion.PathCompleter()
+ pcomplete = PathCompleter()
savedir = settings.get('attachment_prefix', '~')
if self.all:
msg = ui.current_buffer.get_selected_message()
diff --git a/alot/commands/utils.py b/alot/commands/utils.py
index 48d7aac9..153c5028 100644
--- a/alot/commands/utils.py
+++ b/alot/commands/utils.py
@@ -3,8 +3,8 @@
# For further details see the COPYING file
from twisted.internet.defer import inlineCallbacks, returnValue
-from alot.errors import GPGProblem, GPGCode
-from alot import crypto
+from ..errors import GPGProblem, GPGCode
+from .. import crypto
@inlineCallbacks
diff --git a/alot/completion.py b/alot/completion.py
index d4f0cf13..67c6eeda 100644
--- a/alot/completion.py
+++ b/alot/completion.py
@@ -1,20 +1,20 @@
# Copyright (C) 2011-2012 Patrick Totzke <patricktotzke@gmail.com>
# This file is released under the GNU GPL, version 3 or a later revision.
# For further details see the COPYING file
-import re
-import os
+import argparse
import glob
import logging
-import argparse
+import os
+import re
-import alot.crypto as crypto
-import alot.commands as commands
-from alot.buffers import EnvelopeBuffer
-from alot.settings import settings
-from alot.utils.booleanaction import BooleanAction
-from alot.helper import split_commandline
-from alot.addressbook import AddressbookError
-from errors import CompletionError
+from . import crypto
+from . import commands
+from .buffers import EnvelopeBuffer
+from .settings import settings
+from .utils.booleanaction import BooleanAction
+from .helper import split_commandline
+from .addressbook import AddressbookError
+from .errors import CompletionError
class Completer(object):
diff --git a/alot/crypto.py b/alot/crypto.py
index 8efd0254..dc9a0077 100644
--- a/alot/crypto.py
+++ b/alot/crypto.py
@@ -2,10 +2,9 @@
# This file is released under the GNU GPL, version 3 or a later revision.
# For further details see the COPYING file
import os
-
from cStringIO import StringIO
-from alot.errors import GPGProblem, GPGCode
import gpgme
+from .errors import GPGProblem, GPGCode
def _hash_algo_name(hash_algo):
diff --git a/alot/db/__init__.py b/alot/db/__init__.py
index f61142ea..e3aded24 100644
--- a/alot/db/__init__.py
+++ b/alot/db/__init__.py
@@ -2,6 +2,6 @@
# This file is released under the GNU GPL, version 3 or a later revision.
# For further details see the COPYING file
-from thread import Thread
-from message import Message
+from .thread import Thread
+from .message import Message
DB_ENC = 'UTF-8'
diff --git a/alot/db/attachment.py b/alot/db/attachment.py
index 85358037..e192bba5 100644
--- a/alot/db/attachment.py
+++ b/alot/db/attachment.py
@@ -6,10 +6,9 @@ import tempfile
import email.charset as charset
from email.header import Header
from copy import deepcopy
-import alot.helper as helper
-from alot.helper import string_decode
-from alot.db.utils import decode_header
+from ..helper import string_decode, humanize_size, guess_mimetype
+from .utils import decode_header
charset.add_charset('utf-8', charset.QP, charset.QP, 'utf-8')
@@ -28,7 +27,7 @@ class Attachment(object):
def __str__(self):
desc = '%s:%s (%s)' % (self.get_content_type(),
self.get_filename(),
- helper.humanize_size(self.get_size()))
+ humanize_size(self.get_size()))
return string_decode(desc)
def get_filename(self):
@@ -50,7 +49,7 @@ class Attachment(object):
# replace underspecified mime description by a better guess
if ctype in ['octet/stream', 'application/octet-stream',
'application/octetstream']:
- ctype = helper.guess_mimetype(self.get_data())
+ ctype = guess_mimetype(self.get_data())
return ctype
def get_size(self):
diff --git a/alot/db/envelope.py b/alot/db/envelope.py
index 5de09967..abc4aa2b 100644
--- a/alot/db/envelope.py
+++ b/alot/db/envelope.py
@@ -1,27 +1,27 @@
# Copyright (C) 2011-2012 Patrick Totzke <patricktotzke@gmail.com>
# This file is released under the GNU GPL, version 3 or a later revision.
# For further details see the COPYING file
+import glob
+import logging
import os
-import email
import re
-import glob
+import email
from email.encoders import encode_7or8bit
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
from email.mime.application import MIMEApplication
+import email.charset as charset
-from alot import __version__
-import logging
-import alot.helper as helper
-import alot.crypto as crypto
import gpgme
-from alot.settings import settings
-from alot.errors import GPGProblem, GPGCode
from .attachment import Attachment
from .utils import encode_header
+from .. import __version__
+from .. import helper
+from .. import crypto
+from ..settings import settings
+from ..errors import GPGProblem, GPGCode
-import email.charset as charset
charset.add_charset('utf-8', charset.QP, charset.QP, 'utf-8')
diff --git a/alot/db/manager.py b/alot/db/manager.py
index 6dce8c44..3e84a6b1 100644
--- a/alot/db/manager.py
+++ b/alot/db/manager.py
@@ -1,27 +1,27 @@
# Copyright (C) 2011-2012 Patrick Totzke <patricktotzke@gmail.com>
# This file is released under the GNU GPL, version 3 or a later revision.
# For further details see the COPYING file
-from notmuch import Database, NotmuchError, XapianError
-import notmuch
-import multiprocessing
+from collections import deque
+import errno
import logging
-import sys
+import multiprocessing
import os
-import errno
import signal
-from twisted.internet import reactor
+import sys
-from collections import deque
+from notmuch import Database, NotmuchError, XapianError
+import notmuch
+from twisted.internet import reactor
-from message import Message
-from alot.settings import settings
-from thread import Thread
+from . import DB_ENC
from .errors import DatabaseError
from .errors import DatabaseLockedError
from .errors import DatabaseROError
from .errors import NonexistantObjectError
-from alot.db import DB_ENC
-from alot.db.utils import is_subdir_of
+from .message import Message
+from .thread import Thread
+from .utils import is_subdir_of
+from ..settings import settings
class FillPipeProcess(multiprocessing.Process):
diff --git a/alot/db/message.py b/alot/db/message.py
index 6d6e6455..91a0f420 100644
--- a/alot/db/message.py
+++ b/alot/db/message.py
@@ -2,17 +2,17 @@
# This file is released under the GNU GPL, version 3 or a later revision.
# For further details see the COPYING file
import email
+import email.charset as charset
from datetime import datetime
-from notmuch import NullPointerError
-import alot.helper as helper
-from alot.settings import settings
+from notmuch import NullPointerError
from .utils import extract_headers, extract_body, message_from_file
-from alot.db.utils import decode_header
+from .utils import decode_header
from .attachment import Attachment
+from .. import helper
+from ..settings import settings
-import email.charset as charset
charset.add_charset('utf-8', charset.QP, charset.QP, 'utf-8')
diff --git a/alot/db/thread.py b/alot/db/thread.py
index d3cd0757..a1af1cd1 100644
--- a/alot/db/thread.py
+++ b/alot/db/thread.py
@@ -4,8 +4,8 @@
import operator
from datetime import datetime
-from message import Message
-from alot.settings import settings
+from .message import Message
+from ..settings import settings
class Thread(object):
diff --git a/alot/db/utils.py b/alot/db/utils.py
index eb5d4d2d..62a7b3cf 100644
--- a/alot/db/utils.py
+++ b/alot/db/utils.py
@@ -3,24 +3,24 @@
# For further details see the COPYING file
import os
import email
-import tempfile
-import re
+import email.charset as charset
from email.header import Header
from email.iterators import typed_subpart_iterator
+import tempfile
+import re
import logging
import mailcap
from cStringIO import StringIO
-import alot.crypto as crypto
-import alot.helper as helper
-from alot.errors import GPGProblem
-from alot.settings import settings
-from alot.helper import string_sanitize
-from alot.helper import string_decode
-from alot.helper import parse_mailcap_nametemplate
-from alot.helper import split_commandstring
+from .. import crypto
+from .. import helper
+from ..errors import GPGProblem
+from ..settings import settings
+from ..helper import string_sanitize
+from ..helper import string_decode
+from ..helper import parse_mailcap_nametemplate
+from ..helper import split_commandstring
-import email.charset as charset
charset.add_charset('utf-8', charset.QP, charset.QP, 'utf-8')
X_SIGNATURE_VALID_HEADER = 'X-Alot-OpenPGP-Signature-Valid'
diff --git a/alot/helper.py b/alot/helper.py
index 1d114187..f968306d 100644
--- a/alot/helper.py
+++ b/alot/helper.py
@@ -5,25 +5,26 @@
from datetime import timedelta
from datetime import datetime
from collections import deque
-import subprocess
-import shlex
-import email
+from cStringIO import StringIO
+import logging
import mimetypes
import os
import re
+import shlex
+import subprocess
+import email
from email.generator import Generator
from email.mime.audio import MIMEAudio
from email.mime.base import MIMEBase
from email.mime.image import MIMEImage
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
+
import urwid
import magic
from twisted.internet import reactor
from twisted.internet.protocol import ProcessProtocol
from twisted.internet.defer import Deferred
-from cStringIO import StringIO
-import logging
def split_commandline(s, comments=False, posix=True):
diff --git a/alot/settings/__init__.py b/alot/settings/__init__.py
index 57c351b7..b1449c29 100644
--- a/alot/settings/__init__.py
+++ b/alot/settings/__init__.py
@@ -1,6 +1,6 @@
# Copyright (C) 2011-2012 Patrick Totzke <patricktotzke@gmail.com>
# This file is released under the GNU GPL, version 3 or a later revision.
# For further details see the COPYING file
-from alot.settings.manager import SettingsManager
+from .manager import SettingsManager
settings = SettingsManager()
diff --git a/alot/settings/checks.py b/alot/settings/checks.py
index 76d22780..fd44fe66 100644
--- a/alot/settings/checks.py
+++ b/alot/settings/checks.py
@@ -9,8 +9,8 @@ from validate import VdtTypeError
from validate import is_list
from validate import ValidateError, VdtValueTooLongError, VdtValueError
-from alot import crypto
-from alot.errors import GPGProblem
+from .. import crypto
+from ..errors import GPGProblem
def attr_triple(value):
diff --git a/alot/settings/manager.py b/alot/settings/manager.py
index bd810514..1aaffa4f 100644
--- a/alot/settings/manager.py
+++ b/alot/settings/manager.py
@@ -8,20 +8,20 @@ import mailcap
import logging
from configobj import ConfigObj, Section
-from alot.account import SendmailAccount
-from alot.addressbook.abook import AbookAddressBook
-from alot.addressbook.external import ExternalAddressbook
-from alot.helper import pretty_datetime, string_decode
-
-from errors import ConfigError
-from utils import read_config
-from utils import resolve_att
-from checks import force_list
-from checks import mail_container
-from checks import gpg_key
-from checks import attr_triple
-from checks import align_mode
-from theme import Theme
+from ..account import SendmailAccount
+from ..addressbook.abook import AbookAddressBook
+from ..addressbook.external import ExternalAddressbook
+from ..helper import pretty_datetime, string_decode
+
+from .errors import ConfigError
+from .utils import read_config
+from .utils import resolve_att
+from .checks import force_list
+from .checks import mail_container
+from .checks import gpg_key
+from .checks import attr_triple
+from .checks import align_mode
+from .theme import Theme
DEFAULTSPATH = os.path.join(os.path.dirname(__file__), '..', 'defaults')
diff --git a/alot/settings/theme.py b/alot/settings/theme.py
index 308ec660..0e9ced2a 100644
--- a/alot/settings/theme.py
+++ b/alot/settings/theme.py
@@ -3,12 +3,12 @@
# For further details see the COPYING file
import os
-from utils import read_config
-from checks import align_mode
-from checks import attr_triple
-from checks import width_tuple
-from checks import force_list
-from errors import ConfigError
+from .utils import read_config
+from .checks import align_mode
+from .checks import attr_triple
+from .checks import width_tuple
+from .checks import force_list
+from .errors import ConfigError
DEFAULTSPATH = os.path.join(os.path.dirname(__file__), '..', 'defaults')
DUMMYDEFAULT = ('default',) * 6
diff --git a/alot/settings/utils.py b/alot/settings/utils.py
index b6984a7f..f46a8caf 100644
--- a/alot/settings/utils.py
+++ b/alot/settings/utils.py
@@ -3,9 +3,9 @@
# For further details see the COPYING file
from configobj import ConfigObj, ConfigObjError, flatten_errors
from validate import Validator
-from errors import ConfigError
from urwid import AttrSpec
+from .errors import ConfigError
def read_config(configpath=None, specpath=None, checks={}):
"""
diff --git a/alot/ui.py b/alot/ui.py
index 0bde8100..03aa7d92 100644
--- a/alot/ui.py
+++ b/alot/ui.py
@@ -1,21 +1,21 @@
# Copyright (C) 2011-2012 Patrick Totzke <patricktotzke@gmail.com>
# This file is released under the GNU GPL, version 3 or a later revision.
# For further details see the COPYING file
-import urwid
import logging
import signal
from twisted.internet import reactor, defer
+import urwid
-from settings import settings
-from buffers import BufferlistBuffer, SearchBuffer
-from commands import globals
-from commands import commandfactory
-from commands import CommandCanceled
-from alot.commands import CommandParseError
-from alot.helper import split_commandline
-from alot.helper import string_decode
-from alot.widgets.globals import CompleteEdit
-from alot.widgets.globals import ChoiceWidget
+from .settings import settings
+from .buffers import BufferlistBuffer, SearchBuffer
+from .commands import globals
+from .commands import commandfactory
+from .commands import CommandCanceled
+from .commands import CommandParseError
+from .helper import split_commandline
+from .helper import string_decode
+from .widgets.globals import CompleteEdit
+from .widgets.globals import ChoiceWidget
class UI(object):
diff --git a/alot/walker.py b/alot/walker.py
index beaf255e..feba99b6 100644
--- a/alot/walker.py
+++ b/alot/walker.py
@@ -1,8 +1,8 @@
# Copyright (C) 2011-2012 Patrick Totzke <patricktotzke@gmail.com>
# This file is released under the GNU GPL, version 3 or a later revision.
# For further details see the COPYING file
-import urwid
import logging
+import urwid
class PipeWalker(urwid.ListWalker):
diff --git a/alot/widgets/globals.py b/alot/widgets/globals.py
index b72c742e..f4a5659e 100644
--- a/alot/widgets/globals.py
+++ b/alot/widgets/globals.py
@@ -5,14 +5,14 @@
"""
This contains alot-specific :class:`urwid.Widget` used in more than one mode.
"""
-import urwid
import re
import operator
+import urwid
-from alot.helper import string_decode
-from alot.settings import settings
-from alot.db.attachment import Attachment
-from alot.errors import CompletionError
+from ..helper import string_decode
+from ..settings import settings
+from ..db.attachment import Attachment
+from ..errors import CompletionError
class AttachmentWidget(urwid.WidgetWrap):
diff --git a/alot/widgets/search.py b/alot/widgets/search.py
index 6c351f4a..c0b12007 100644
--- a/alot/widgets/search.py
+++ b/alot/widgets/search.py
@@ -6,11 +6,11 @@ Widgets specific to search mode
"""
import urwid
-from alot.settings import settings
-from alot.helper import shorten_author_string
-from alot.helper import tag_cmp
-from alot.widgets.utils import AttrFlipWidget
-from alot.widgets.globals import TagWidget
+from ..settings import settings
+from ..helper import shorten_author_string
+from ..helper import tag_cmp
+from .utils import AttrFlipWidget
+from .globals import TagWidget
class ThreadlineWidget(urwid.AttrMap):
diff --git a/alot/widgets/thread.py b/alot/widgets/thread.py
index 44424992..29d5d7fe 100644
--- a/alot/widgets/thread.py
+++ b/alot/widgets/thread.py
@@ -4,16 +4,16 @@
"""
Widgets specific to thread mode
"""
-import urwid
import logging
-
-from alot.settings import settings
-from alot.db.utils import decode_header, X_SIGNATURE_MESSAGE_HEADER
-from alot.helper import tag_cmp
-from alot.widgets.globals import TagWidget
-from alot.widgets.globals import AttachmentWidget
+import urwid
from urwidtrees import Tree, SimpleTree, CollapsibleTree
-from alot.db.utils import extract_body
+
+from .globals import TagWidget
+from .globals import AttachmentWidget
+from ..settings import settings
+from ..db.utils import decode_header, X_SIGNATURE_MESSAGE_HEADER
+from ..db.utils import extract_body
+from ..helper import tag_cmp
class MessageSummaryWidget(urwid.WidgetWrap):