[meld] Actually start getting serious about import ordering



commit e1159056b8d77cbb5dd1af2c2c8be66c06a1a011
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Sat Dec 23 07:51:13 2017 +1000

    Actually start getting serious about import ordering

 meld/build_helpers.py         |  3 +--
 meld/diffgrid.py              |  2 +-
 meld/diffmap.py               |  1 -
 meld/dirdiff.py               | 13 ++++++-------
 meld/filediff.py              | 10 +++++-----
 meld/gutterrendererchunk.py   |  4 ++--
 meld/meldapp.py               |  3 +--
 meld/melddoc.py               |  9 ++++-----
 meld/meldwindow.py            |  2 +-
 meld/misc.py                  |  4 ++--
 meld/newdifftab.py            |  2 +-
 meld/recent.py                |  1 -
 meld/settings.py              |  2 +-
 meld/tree.py                  | 13 ++++++-------
 meld/ui/emblemcellrenderer.py |  2 +-
 meld/ui/util.py               |  1 -
 meld/vc/__init__.py           |  2 +-
 meld/vc/bzr.py                |  3 +--
 meld/vc/darcs.py              |  1 +
 meld/vc/git.py                |  1 -
 20 files changed, 35 insertions(+), 44 deletions(-)
---
diff --git a/meld/build_helpers.py b/meld/build_helpers.py
index e910b71f..ed875834 100644
--- a/meld/build_helpers.py
+++ b/meld/build_helpers.py
@@ -23,13 +23,12 @@ import distutils.command.build
 import distutils.command.build_py
 import distutils.command.install
 import distutils.command.install_data
-import distutils.dist
 import distutils.dir_util
+import distutils.dist
 import glob
 import os.path
 import platform
 import sys
-
 from distutils.log import info
 
 
diff --git a/meld/diffgrid.py b/meld/diffgrid.py
index d0aebeea..22c8e560 100644
--- a/meld/diffgrid.py
+++ b/meld/diffgrid.py
@@ -13,9 +13,9 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+from gi.repository import Gdk
 from gi.repository import GObject
 from gi.repository import Gtk
-from gi.repository import Gdk
 
 
 class DiffGrid(Gtk.Grid):
diff --git a/meld/diffmap.py b/meld/diffmap.py
index fac4276e..a1ddd37f 100644
--- a/meld/diffmap.py
+++ b/meld/diffmap.py
@@ -17,7 +17,6 @@
 import collections
 
 import cairo
-
 from gi.repository import Gdk
 from gi.repository import Gtk
 
diff --git a/meld/dirdiff.py b/meld/dirdiff.py
index e76417df..7af7e394 100644
--- a/meld/dirdiff.py
+++ b/meld/dirdiff.py
@@ -24,21 +24,20 @@ import os
 import shutil
 import stat
 import sys
+from collections import namedtuple
+from decimal import Decimal
 
-from gi.repository import GLib
+from gi.repository import Gdk
 from gi.repository import Gio
+from gi.repository import GLib
 from gi.repository import GObject
-from gi.repository import Gdk
 from gi.repository import Gtk
 
 from . import melddoc
-from . import tree
 from . import misc
-from .ui import gnomeglade
+from . import tree
 from .ui import emblemcellrenderer
-
-from collections import namedtuple
-from decimal import Decimal
+from .ui import gnomeglade
 
 from meld.conf import _
 from meld.misc import all_same
diff --git a/meld/filediff.py b/meld/filediff.py
index b97b59b6..b73764f9 100644
--- a/meld/filediff.py
+++ b/meld/filediff.py
@@ -19,14 +19,13 @@ import functools
 import math
 import os
 
+from gi.repository import Gdk
+from gi.repository import Gio
 from gi.repository import GLib
 from gi.repository import GObject
-from gi.repository import Gio
-from gi.repository import Gdk
 from gi.repository import Gtk
 from gi.repository import GtkSource
 
-from meld.conf import _
 from . import meldbuffer
 from . import melddoc
 from . import misc
@@ -34,7 +33,8 @@ from . import undo
 from .ui import filechooser
 from .ui import gnomeglade
 
-from meld.const import MODE_REPLACE, MODE_DELETE, MODE_INSERT, NEWLINES
+from meld.conf import _
+from meld.const import MODE_DELETE, MODE_INSERT, MODE_REPLACE, NEWLINES
 from meld.matchers.diffutil import Differ, merged_chunk_order
 from meld.matchers.helpers import CachedSequenceMatcher
 from meld.matchers.merge import Merger
@@ -42,7 +42,7 @@ from meld.patchdialog import PatchDialog
 from meld.recent import RecentType
 from meld.settings import bind_settings, meldsettings
 from meld.sourceview import (
-    LanguageManager, TextviewLineAnimationType, get_custom_encoding_candidates)
+    get_custom_encoding_candidates, LanguageManager, TextviewLineAnimationType)
 from meld.ui.findbar import FindBar
 
 
diff --git a/meld/gutterrendererchunk.py b/meld/gutterrendererchunk.py
index 945a29a0..f6a370ae 100644
--- a/meld/gutterrendererchunk.py
+++ b/meld/gutterrendererchunk.py
@@ -15,13 +15,13 @@
 
 import math
 
-from gi.repository import Pango
 from gi.repository import Gdk
 from gi.repository import Gtk
 from gi.repository import GtkSource
+from gi.repository import Pango
 
 from meld.conf import _
-from meld.const import MODE_REPLACE, MODE_DELETE, MODE_INSERT
+from meld.const import MODE_DELETE, MODE_INSERT, MODE_REPLACE
 from meld.misc import get_common_theme
 from meld.settings import meldsettings
 from meld.ui.gtkcompat import get_style
diff --git a/meld/meldapp.py b/meld/meldapp.py
index 6d8252a0..a4336aae 100644
--- a/meld/meldapp.py
+++ b/meld/meldapp.py
@@ -19,15 +19,14 @@ import logging
 import optparse
 import os
 
+from gi.repository import Gdk
 from gi.repository import Gio
 from gi.repository import GLib
-from gi.repository import Gdk
 from gi.repository import Gtk
 
 import meld.conf
 import meld.preferences
 import meld.ui.util
-
 from meld.conf import _
 
 log = logging.getLogger(__name__)
diff --git a/meld/melddoc.py b/meld/melddoc.py
index e36c9abb..cbca6e09 100644
--- a/meld/melddoc.py
+++ b/meld/melddoc.py
@@ -22,16 +22,15 @@ import subprocess
 import sys
 
 from gi.repository import Gdk
+from gi.repository import Gio
 from gi.repository import GLib
 from gi.repository import GObject
-from gi.repository import Gio
 from gi.repository import Gtk
 
-from . import task
-
 from meld.conf import _
-from meld.settings import settings
 from meld.recent import RecentType
+from meld.settings import settings
+from meld.task import FifoScheduler
 
 log = logging.getLogger(__name__)
 
@@ -91,7 +90,7 @@ class MeldDoc(LabeledObjectMixin, GObject.GObject):
 
     def __init__(self):
         GObject.GObject.__init__(self)
-        self.scheduler = task.FifoScheduler()
+        self.scheduler = FifoScheduler()
         self.num_panes = 0
         self.main_actiongroup = None
         self._state = STATE_NORMAL
diff --git a/meld/meldwindow.py b/meld/meldwindow.py
index 467e4e99..9fe3283c 100644
--- a/meld/meldwindow.py
+++ b/meld/meldwindow.py
@@ -31,7 +31,7 @@ from .ui import gnomeglade
 from .ui import notebooklabel
 
 from meld.conf import _
-from meld.recent import RecentType, recent_comparisons
+from meld.recent import recent_comparisons, RecentType
 from meld.settings import interface_settings, settings
 from meld.windowstate import SavedWindowState
 
diff --git a/meld/misc.py b/meld/misc.py
index e7671410..51951279 100644
--- a/meld/misc.py
+++ b/meld/misc.py
@@ -19,10 +19,10 @@
 """
 
 import collections
-import os
 import errno
-import shutil
+import os
 import re
+import shutil
 import subprocess
 
 from gi.repository import Gdk
diff --git a/meld/newdifftab.py b/meld/newdifftab.py
index 6e347145..3309e6a2 100644
--- a/meld/newdifftab.py
+++ b/meld/newdifftab.py
@@ -20,10 +20,10 @@ from gi.repository import GLib
 from gi.repository import GObject
 from gi.repository import Gtk
 
-from .ui import gnomeglade
 from meld.conf import _
 from meld.melddoc import LabeledObjectMixin
 from meld.recent import recent_comparisons
+from meld.ui import gnomeglade
 
 
 class NewDiffTab(LabeledObjectMixin, GObject.GObject, gnomeglade.Component):
diff --git a/meld/recent.py b/meld/recent.py
index 7fd9c678..3b396de1 100644
--- a/meld/recent.py
+++ b/meld/recent.py
@@ -35,7 +35,6 @@ from gi.repository import GLib
 from gi.repository import Gtk
 
 import meld.misc
-
 from meld.conf import _
 
 
diff --git a/meld/settings.py b/meld/settings.py
index ee4d02f6..03ceac84 100644
--- a/meld/settings.py
+++ b/meld/settings.py
@@ -15,8 +15,8 @@
 
 from gi.repository import Gio
 from gi.repository import GObject
-from gi.repository import Pango
 from gi.repository import GtkSource
+from gi.repository import Pango
 
 import meld.conf
 import meld.filters
diff --git a/meld/tree.py b/meld/tree.py
index e4b2df30..0b1c34f8 100644
--- a/meld/tree.py
+++ b/meld/tree.py
@@ -15,20 +15,19 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 import os
-from gi.repository import GLib
+
 from gi.repository import Gdk
+from gi.repository import GLib
 from gi.repository import Gtk
 from gi.repository import Pango
 
 from meld.misc import colour_lookup_with_fallback
 from meld.treehelpers import SearchableTreeStore
 from meld.vc._vc import (
-    STATE_IGNORED, STATE_NONE, STATE_NORMAL, STATE_NOCHANGE,
-    STATE_ERROR, STATE_EMPTY, STATE_NEW,
-    STATE_MODIFIED, STATE_CONFLICT, STATE_REMOVED,
-    STATE_MISSING, STATE_NONEXIST, STATE_MAX,
-    CONFLICT_BASE, CONFLICT_LOCAL, CONFLICT_REMOTE,
-    CONFLICT_MERGED, CONFLICT_OTHER, CONFLICT_THIS,
+    CONFLICT_BASE, CONFLICT_LOCAL, CONFLICT_MERGED, CONFLICT_OTHER,
+    CONFLICT_REMOTE, CONFLICT_THIS, STATE_CONFLICT, STATE_EMPTY, STATE_ERROR,
+    STATE_IGNORED, STATE_MAX, STATE_MISSING, STATE_MODIFIED, STATE_NEW,
+    STATE_NOCHANGE, STATE_NONE, STATE_NONEXIST, STATE_NORMAL, STATE_REMOVED,
 )
 
 COL_PATH, COL_STATE, COL_TEXT, COL_ICON, COL_TINT, COL_FG, COL_STYLE, \
diff --git a/meld/ui/emblemcellrenderer.py b/meld/ui/emblemcellrenderer.py
index f9fee222..0d5cd420 100644
--- a/meld/ui/emblemcellrenderer.py
+++ b/meld/ui/emblemcellrenderer.py
@@ -15,8 +15,8 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 import cairo
-from gi.repository import GObject
 from gi.repository import Gdk
+from gi.repository import GObject
 from gi.repository import Gtk
 
 
diff --git a/meld/ui/util.py b/meld/ui/util.py
index 7c5d127e..55e80883 100644
--- a/meld/ui/util.py
+++ b/meld/ui/util.py
@@ -16,7 +16,6 @@
 from gi.repository import Gtk
 
 import meld.conf
-
 # Import support module to get all builder-constructed widgets in the namespace
 from meld.ui import gladesupport
 
diff --git a/meld/vc/__init__.py b/meld/vc/__init__.py
index d69e288b..ca86d688 100644
--- a/meld/vc/__init__.py
+++ b/meld/vc/__init__.py
@@ -23,7 +23,7 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-from . import git, mercurial, bzr, svn, darcs, _null
+from . import _null, bzr, darcs, git, mercurial, svn
 
 # Tuple of plugins, ordered according to best-guess as to which VC a
 # user is likely to want by default in a multiple-VC situation.
diff --git a/meld/vc/bzr.py b/meld/vc/bzr.py
index fb175e78..7792cbe3 100644
--- a/meld/vc/bzr.py
+++ b/meld/vc/bzr.py
@@ -24,11 +24,10 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-from collections import defaultdict
-
 import errno
 import os
 import re
+from collections import defaultdict
 
 from . import _vc
 
diff --git a/meld/vc/darcs.py b/meld/vc/darcs.py
index 5693de99..dbefef0e 100644
--- a/meld/vc/darcs.py
+++ b/meld/vc/darcs.py
@@ -28,6 +28,7 @@ import shutil
 import subprocess
 import tempfile
 from collections import defaultdict
+
 from . import _vc
 
 
diff --git a/meld/vc/git.py b/meld/vc/git.py
index ce82ff20..3f66880a 100644
--- a/meld/vc/git.py
+++ b/meld/vc/git.py
@@ -36,7 +36,6 @@ import tempfile
 from collections import defaultdict
 
 from meld.conf import _, ngettext
-
 from . import _vc
 
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]