From 111eaa27e81ecc46a77599124dcffbd76ca7a2c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kim=20Silkeb=C3=A6kken?= Date: Mon, 11 Mar 2013 10:40:09 +0100 Subject: [PATCH] Combine vim modelines and Python encoding declarations Ref #314 --- docs/source/conf.py | 3 +-- font/fontpatcher.py | 3 +-- powerline/__init__.py | 3 +-- powerline/bindings/ipython/post_0_11.py | 2 +- powerline/bindings/ipython/pre_0_11.py | 2 +- powerline/bindings/qtile/widget.py | 3 +-- powerline/bindings/vim/__init__.py | 3 +-- powerline/bindings/zsh/__init__.py | 2 +- powerline/colorscheme.py | 3 +-- powerline/ipython.py | 3 +-- powerline/lib/__init__.py | 2 +- powerline/lib/humanize_bytes.py | 3 +-- powerline/lib/memoize.py | 3 +-- powerline/lib/url.py | 3 +-- powerline/lib/vcs/__init__.py | 2 +- powerline/lib/vcs/bzr.py | 2 +- powerline/lib/vcs/git.py | 2 +- powerline/lib/vcs/mercurial.py | 2 +- powerline/matcher.py | 3 +-- powerline/matchers/vim.py | 3 +-- powerline/renderer.py | 3 +-- powerline/renderers/bash_prompt.py | 3 +-- powerline/renderers/ipython.py | 3 +-- powerline/renderers/pango_markup.py | 3 +-- powerline/renderers/shell.py | 3 +-- powerline/renderers/tmux.py | 3 +-- powerline/renderers/vim.py | 3 +-- powerline/renderers/zsh_prompt.py | 3 +-- powerline/segment.py | 3 +-- powerline/segments/common.py | 3 +-- powerline/segments/shell.py | 3 +-- powerline/segments/vim.py | 3 +-- powerline/shell.py | 3 +-- powerline/theme.py | 3 +-- powerline/vim.py | 3 +-- setup.py | 3 +-- tests/__init__.py | 2 +- tests/lib/__init__.py | 2 +- tests/path/vim.py | 2 +- tests/test_configuration.py | 3 +-- tests/test_lib.py | 2 +- tests/test_segments.py | 3 +-- tests/vim.py | 2 +- 43 files changed, 43 insertions(+), 73 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 3d9755d0..c2af72cb 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -1,5 +1,4 @@ -# -*- coding: utf-8 -*- -# vim:fenc=utf-8:noet +# vim:fileencoding=utf-8:noet import os import sys diff --git a/font/fontpatcher.py b/font/fontpatcher.py index fff9a2a6..e2bbf2a0 100755 --- a/font/fontpatcher.py +++ b/font/fontpatcher.py @@ -1,6 +1,5 @@ #!/usr/bin/env python2 -# -*- coding: utf-8 -*- -# vim:fenc=utf-8:noet +# vim:fileencoding=utf-8:noet import argparse import sys diff --git a/powerline/__init__.py b/powerline/__init__.py index 7a2eb5c8..65d132ff 100644 --- a/powerline/__init__.py +++ b/powerline/__init__.py @@ -1,5 +1,4 @@ -# -*- coding: utf-8 -*- -# vim:fenc=utf-8:noet +# vim:fileencoding=utf-8:noet from __future__ import absolute_import import json diff --git a/powerline/bindings/ipython/post_0_11.py b/powerline/bindings/ipython/post_0_11.py index 4ff79fb7..c0c40ce1 100644 --- a/powerline/bindings/ipython/post_0_11.py +++ b/powerline/bindings/ipython/post_0_11.py @@ -1,4 +1,4 @@ -# vim:fenc=utf-8:noet +# vim:fileencoding=utf-8:noet from powerline.ipython import IpythonPowerline from IPython.core.prompts import PromptManager diff --git a/powerline/bindings/ipython/pre_0_11.py b/powerline/bindings/ipython/pre_0_11.py index b47205a9..098ddb6b 100644 --- a/powerline/bindings/ipython/pre_0_11.py +++ b/powerline/bindings/ipython/pre_0_11.py @@ -1,4 +1,4 @@ -# vim:fenc=utf-8:noet +# vim:fileencoding=utf-8:noet from powerline.ipython import IpythonPowerline from IPython.Prompts import BasePrompt from IPython.ipapi import get as get_ipython diff --git a/powerline/bindings/qtile/widget.py b/powerline/bindings/qtile/widget.py index 5a8c98a2..71d8d3fa 100644 --- a/powerline/bindings/qtile/widget.py +++ b/powerline/bindings/qtile/widget.py @@ -1,5 +1,4 @@ -# -*- coding: utf-8 -*- -# vim:fenc=utf-8:noet +# vim:fileencoding=utf-8:noet from libqtile import bar from libqtile.widget import base diff --git a/powerline/bindings/vim/__init__.py b/powerline/bindings/vim/__init__.py index 5258ea05..f9741163 100644 --- a/powerline/bindings/vim/__init__.py +++ b/powerline/bindings/vim/__init__.py @@ -1,5 +1,4 @@ -# -*- coding: utf-8 -*- -# vim:fenc=utf-8:noet +# vim:fileencoding=utf-8:noet try: import vim diff --git a/powerline/bindings/zsh/__init__.py b/powerline/bindings/zsh/__init__.py index 87e32970..8be9f6f8 100644 --- a/powerline/bindings/zsh/__init__.py +++ b/powerline/bindings/zsh/__init__.py @@ -1,4 +1,4 @@ -# vim:fenc=utf-8:noet +# vim:fileencoding=utf-8:noet import zsh from powerline.shell import ShellPowerline from powerline.lib import parsedotval diff --git a/powerline/colorscheme.py b/powerline/colorscheme.py index 484cf7e9..c5d09f6f 100644 --- a/powerline/colorscheme.py +++ b/powerline/colorscheme.py @@ -1,5 +1,4 @@ -# -*- coding: utf-8 -*- -# vim:fenc=utf-8:noet +# vim:fileencoding=utf-8:noet from copy import copy diff --git a/powerline/ipython.py b/powerline/ipython.py index 62b296d5..e1fc4149 100644 --- a/powerline/ipython.py +++ b/powerline/ipython.py @@ -1,5 +1,4 @@ -# -*- coding: utf-8 -*- -# vim:fenc=utf-8:noet +# vim:fileencoding=utf-8:noet from powerline import Powerline from powerline.lib import mergedicts diff --git a/powerline/lib/__init__.py b/powerline/lib/__init__.py index b0a492c6..549d7455 100644 --- a/powerline/lib/__init__.py +++ b/powerline/lib/__init__.py @@ -1,4 +1,4 @@ -# vim:fenc=utf-8:noet +# vim:fileencoding=utf-8:noet from functools import wraps import json diff --git a/powerline/lib/humanize_bytes.py b/powerline/lib/humanize_bytes.py index 5c4c4ff5..769c7d13 100644 --- a/powerline/lib/humanize_bytes.py +++ b/powerline/lib/humanize_bytes.py @@ -1,5 +1,4 @@ -# -*- coding: utf-8 -*- -# vim:fenc=utf-8:noet +# vim:fileencoding=utf-8:noet from math import log unit_list = tuple(zip(['', 'k', 'M', 'G', 'T', 'P'], [0, 0, 1, 2, 2, 2])) diff --git a/powerline/lib/memoize.py b/powerline/lib/memoize.py index df705bd9..194cf69e 100644 --- a/powerline/lib/memoize.py +++ b/powerline/lib/memoize.py @@ -1,5 +1,4 @@ -# -*- coding: utf-8 -*- -# vim:fenc=utf-8:noet +# vim:fileencoding=utf-8:noet from functools import wraps import time diff --git a/powerline/lib/url.py b/powerline/lib/url.py index 8164a981..ef46df70 100644 --- a/powerline/lib/url.py +++ b/powerline/lib/url.py @@ -1,5 +1,4 @@ -# -*- coding: utf-8 -*- -# vim:fenc=utf-8:noet +# vim:fileencoding=utf-8:noet def urllib_read(url): diff --git a/powerline/lib/vcs/__init__.py b/powerline/lib/vcs/__init__.py index d74ef5de..2bbc9bdf 100644 --- a/powerline/lib/vcs/__init__.py +++ b/powerline/lib/vcs/__init__.py @@ -1,4 +1,4 @@ -# vim:fenc=utf-8:noet +# vim:fileencoding=utf-8:noet from __future__ import absolute_import import os from powerline.lib.memoize import memoize diff --git a/powerline/lib/vcs/bzr.py b/powerline/lib/vcs/bzr.py index a35924ad..feb7844c 100644 --- a/powerline/lib/vcs/bzr.py +++ b/powerline/lib/vcs/bzr.py @@ -1,4 +1,4 @@ -# vim:fenc=utf-8:noet +# vim:fileencoding=utf-8:noet from __future__ import absolute_import, unicode_literals, division, print_function import sys diff --git a/powerline/lib/vcs/git.py b/powerline/lib/vcs/git.py index be18c266..ec99f0c6 100644 --- a/powerline/lib/vcs/git.py +++ b/powerline/lib/vcs/git.py @@ -1,4 +1,4 @@ -# vim:fenc=utf-8:noet +# vim:fileencoding=utf-8:noet try: import pygit2 as git diff --git a/powerline/lib/vcs/mercurial.py b/powerline/lib/vcs/mercurial.py index 71ce9243..246bdec2 100644 --- a/powerline/lib/vcs/mercurial.py +++ b/powerline/lib/vcs/mercurial.py @@ -1,4 +1,4 @@ -# vim:fenc=utf-8:noet +# vim:fileencoding=utf-8:noet from __future__ import absolute_import from mercurial import hg, ui, match diff --git a/powerline/matcher.py b/powerline/matcher.py index 571ee6ec..5578d282 100644 --- a/powerline/matcher.py +++ b/powerline/matcher.py @@ -1,5 +1,4 @@ -# -*- coding: utf-8 -*- -# vim:fenc=utf-8:noet +# vim:fileencoding=utf-8:noet from __future__ import absolute_import import sys diff --git a/powerline/matchers/vim.py b/powerline/matchers/vim.py index a908f590..fd1db4b6 100644 --- a/powerline/matchers/vim.py +++ b/powerline/matchers/vim.py @@ -1,5 +1,4 @@ -# -*- coding: utf-8 -*- -# vim:fenc=utf-8:noet +# vim:fileencoding=utf-8:noet from __future__ import absolute_import diff --git a/powerline/renderer.py b/powerline/renderer.py index 38a33663..dbaa04fc 100644 --- a/powerline/renderer.py +++ b/powerline/renderer.py @@ -1,5 +1,4 @@ -# -*- coding: utf-8 -*- -# vim:fenc=utf-8:noet +# vim:fileencoding=utf-8:noet from powerline.theme import Theme diff --git a/powerline/renderers/bash_prompt.py b/powerline/renderers/bash_prompt.py index b64194a7..b9f911ad 100644 --- a/powerline/renderers/bash_prompt.py +++ b/powerline/renderers/bash_prompt.py @@ -1,5 +1,4 @@ -# -*- coding: utf-8 -*- -# vim:fenc=utf-8:noet +# vim:fileencoding=utf-8:noet from powerline.renderers.shell import ShellRenderer diff --git a/powerline/renderers/ipython.py b/powerline/renderers/ipython.py index 17fcef8c..d1e4c7bd 100644 --- a/powerline/renderers/ipython.py +++ b/powerline/renderers/ipython.py @@ -1,5 +1,4 @@ -# -*- coding: utf-8 -*- -# vim:fenc=utf-8:noet +# vim:fileencoding=utf-8:noet from powerline.renderers.shell import ShellRenderer diff --git a/powerline/renderers/pango_markup.py b/powerline/renderers/pango_markup.py index edb4fb50..54e78868 100644 --- a/powerline/renderers/pango_markup.py +++ b/powerline/renderers/pango_markup.py @@ -1,5 +1,4 @@ -# -*- coding: utf-8 -*- -# vim:fenc=utf-8:noet +# vim:fileencoding=utf-8:noet from powerline.renderer import Renderer from powerline.colorscheme import ATTR_BOLD, ATTR_ITALIC, ATTR_UNDERLINE diff --git a/powerline/renderers/shell.py b/powerline/renderers/shell.py index fb995210..b2ad0197 100644 --- a/powerline/renderers/shell.py +++ b/powerline/renderers/shell.py @@ -1,5 +1,4 @@ -# -*- coding: utf-8 -*- -# vim:fenc=utf-8:noet +# vim:fileencoding=utf-8:noet from powerline.renderer import Renderer from powerline.colorscheme import ATTR_BOLD, ATTR_ITALIC, ATTR_UNDERLINE diff --git a/powerline/renderers/tmux.py b/powerline/renderers/tmux.py index ab5c1f34..57dd3cd8 100644 --- a/powerline/renderers/tmux.py +++ b/powerline/renderers/tmux.py @@ -1,5 +1,4 @@ -# -*- coding: utf-8 -*- -# vim:fenc=utf-8:noet +# vim:fileencoding=utf-8:noet from powerline.renderer import Renderer from powerline.colorscheme import ATTR_BOLD, ATTR_ITALIC, ATTR_UNDERLINE diff --git a/powerline/renderers/vim.py b/powerline/renderers/vim.py index 7c190e23..90047751 100644 --- a/powerline/renderers/vim.py +++ b/powerline/renderers/vim.py @@ -1,5 +1,4 @@ -# -*- coding: utf-8 -*- -# vim:fenc=utf-8:noet +# vim:fileencoding=utf-8:noet from __future__ import absolute_import diff --git a/powerline/renderers/zsh_prompt.py b/powerline/renderers/zsh_prompt.py index 0d777e02..f66f7359 100644 --- a/powerline/renderers/zsh_prompt.py +++ b/powerline/renderers/zsh_prompt.py @@ -1,5 +1,4 @@ -# -*- coding: utf-8 -*- -# vim:fenc=utf-8:noet +# vim:fileencoding=utf-8:noet from powerline.renderers.shell import ShellRenderer diff --git a/powerline/segment.py b/powerline/segment.py index 138e58b6..998d9939 100644 --- a/powerline/segment.py +++ b/powerline/segment.py @@ -1,5 +1,4 @@ -# -*- coding: utf-8 -*- -# vim:fenc=utf-8:noet +# vim:fileencoding=utf-8:noet from __future__ import absolute_import import sys diff --git a/powerline/segments/common.py b/powerline/segments/common.py index b42f11c3..5511a8cd 100644 --- a/powerline/segments/common.py +++ b/powerline/segments/common.py @@ -1,5 +1,4 @@ -# -*- coding: utf-8 -*- -# vim:fenc=utf-8:noet +# vim:fileencoding=utf-8:noet import os import sys diff --git a/powerline/segments/shell.py b/powerline/segments/shell.py index 8cbf881d..cd418361 100644 --- a/powerline/segments/shell.py +++ b/powerline/segments/shell.py @@ -1,5 +1,4 @@ -# -*- coding: utf-8 -*- -# vim:fenc=utf-8:noet +# vim:fileencoding=utf-8:noet from powerline.theme import requires_segment_info diff --git a/powerline/segments/vim.py b/powerline/segments/vim.py index f056cedc..99e3c1a0 100644 --- a/powerline/segments/vim.py +++ b/powerline/segments/vim.py @@ -1,5 +1,4 @@ -# -*- coding: utf-8 -*- -# vim:fenc=utf-8:noet +# vim:fileencoding=utf-8:noet from __future__ import absolute_import diff --git a/powerline/shell.py b/powerline/shell.py index c0ea10cc..f84157ae 100644 --- a/powerline/shell.py +++ b/powerline/shell.py @@ -1,5 +1,4 @@ -# -*- coding: utf-8 -*- -# vim:fenc=utf-8:noet +# vim:fileencoding=utf-8:noet from powerline import Powerline from powerline.lib import mergedicts, parsedotval diff --git a/powerline/theme.py b/powerline/theme.py index 60e6db17..5c2b0c4a 100644 --- a/powerline/theme.py +++ b/powerline/theme.py @@ -1,5 +1,4 @@ -# -*- coding: utf-8 -*- -# vim:fenc=utf-8:noet +# vim:fileencoding=utf-8:noet from copy import copy diff --git a/powerline/vim.py b/powerline/vim.py index 8e33576a..6fda5575 100644 --- a/powerline/vim.py +++ b/powerline/vim.py @@ -1,5 +1,4 @@ -# -*- coding: utf-8 -*- -# vim:fenc=utf-8:noet +# vim:fileencoding=utf-8:noet from __future__ import absolute_import diff --git a/setup.py b/setup.py index 5c526325..46c843a8 100755 --- a/setup.py +++ b/setup.py @@ -1,6 +1,5 @@ #!/usr/bin/env python -# -*- coding: utf-8 -*- -# vim:fenc=utf-8:noet +# vim:fileencoding=utf-8:noet import os import sys diff --git a/tests/__init__.py b/tests/__init__.py index bf960b9f..13b41550 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -1,4 +1,4 @@ -# vim:fenc=utf-8:noet +# vim:fileencoding=utf-8:noet import sys if sys.version_info < (2, 7): from unittest2 import TestCase, main # NOQA diff --git a/tests/lib/__init__.py b/tests/lib/__init__.py index de22d31d..872be033 100644 --- a/tests/lib/__init__.py +++ b/tests/lib/__init__.py @@ -1,4 +1,4 @@ -# vim:fenc=utf-8:noet +# vim:fileencoding=utf-8:noet import imp import sys import os diff --git a/tests/path/vim.py b/tests/path/vim.py index 8b3b218a..899678e5 100644 --- a/tests/path/vim.py +++ b/tests/path/vim.py @@ -1,4 +1,4 @@ -# vim:fenc=utf-8:noet +# vim:fileencoding=utf-8:noet from tests import vim diff --git a/tests/test_configuration.py b/tests/test_configuration.py index d60779c6..5851ec3f 100644 --- a/tests/test_configuration.py +++ b/tests/test_configuration.py @@ -1,5 +1,4 @@ -# -*- coding: utf-8 -*- -# vim:fenc=utf-8:noet +# vim:fileencoding=utf-8:noet '''Dynamic configuration files tests.''' diff --git a/tests/test_lib.py b/tests/test_lib.py index 416edefe..8dac5c5d 100644 --- a/tests/test_lib.py +++ b/tests/test_lib.py @@ -1,4 +1,4 @@ -# vim:fenc=utf-8:noet +# vim:fileencoding=utf-8:noet from powerline.lib import mergedicts, underscore_to_camelcase, add_divider_highlight_group, humanize_bytes from powerline.lib.vcs import guess from subprocess import call, PIPE diff --git a/tests/test_segments.py b/tests/test_segments.py index 9d9d84ac..d41c145e 100644 --- a/tests/test_segments.py +++ b/tests/test_segments.py @@ -1,5 +1,4 @@ -# -*- coding: utf-8 -*- -# vim:fenc=utf-8:noet +# vim:fileencoding=utf-8:noet from powerline.segments import shell, common import tests.vim as vim_module diff --git a/tests/vim.py b/tests/vim.py index 89b17aec..6253956f 100644 --- a/tests/vim.py +++ b/tests/vim.py @@ -1,4 +1,4 @@ -# vim:fenc=utf-8:noet +# vim:fileencoding=utf-8:noet _log = [] _g = {} _window = 0