mirror of
https://github.com/powerline/powerline.git
synced 2025-09-25 19:09:10 +02:00
Replace all ASCII ' with Unicode ’ in comments and docstrings
This commit is contained in:
parent
2b5e9e0dc1
commit
77b0695caf
@ -22,7 +22,7 @@ html_show_copyright = False
|
|||||||
|
|
||||||
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
|
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
|
||||||
|
|
||||||
if not on_rtd: # only import and set the theme if we're building docs locally
|
if not on_rtd: # only import and set the theme if we’re building docs locally
|
||||||
try:
|
try:
|
||||||
import sphinx_rtd_theme
|
import sphinx_rtd_theme
|
||||||
html_theme = 'sphinx_rtd_theme'
|
html_theme = 'sphinx_rtd_theme'
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
if-shell 'test -z "$POWERLINE_CONFIG_COMMAND"' 'set-environment -g POWERLINE_CONFIG_COMMAND powerline-config'
|
if-shell 'test -z "$POWERLINE_CONFIG_COMMAND"' 'set-environment -g POWERLINE_CONFIG_COMMAND powerline-config'
|
||||||
|
|
||||||
# Don't version-check for this core functionality -- anything too old to
|
# Don’t version-check for this core functionality -- anything too old to
|
||||||
# support these options likely won't work well with powerline
|
# support these options likely won’t work well with powerline
|
||||||
set -g status on
|
set -g status on
|
||||||
set -g status-utf8 on
|
set -g status-utf8 on
|
||||||
set -g status-interval 2
|
set -g status-interval 2
|
||||||
|
@ -66,7 +66,7 @@ def print_cycles(objects, outstream=sys.stdout, show_progress=False):
|
|||||||
|
|
||||||
referents = gc.get_referents(obj)
|
referents = gc.get_referents(obj)
|
||||||
for referent in referents:
|
for referent in referents:
|
||||||
# If we've found our way back to the start, this is
|
# If we’ve found our way back to the start, this is
|
||||||
# a cycle, so print it out
|
# a cycle, so print it out
|
||||||
if referent is start:
|
if referent is start:
|
||||||
try:
|
try:
|
||||||
@ -78,13 +78,13 @@ def print_cycles(objects, outstream=sys.stdout, show_progress=False):
|
|||||||
outstream.write('Cyclic reference: %i\n' % id(referent))
|
outstream.write('Cyclic reference: %i\n' % id(referent))
|
||||||
print_path(current_path)
|
print_path(current_path)
|
||||||
|
|
||||||
# Don't go back through the original list of objects, or
|
# Don’t go back through the original list of objects, or
|
||||||
# through temporary references to the object, since those
|
# through temporary references to the object, since those
|
||||||
# are just an artifact of the cycle detector itself.
|
# are just an artifact of the cycle detector itself.
|
||||||
elif referent is objects or isinstance(referent, FrameType):
|
elif referent is objects or isinstance(referent, FrameType):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# We haven't seen this object before, so recurse
|
# We haven’t seen this object before, so recurse
|
||||||
elif id(referent) not in all:
|
elif id(referent) not in all:
|
||||||
recurse(referent, start, all, current_path + (obj,))
|
recurse(referent, start, all, current_path + (obj,))
|
||||||
|
|
||||||
|
@ -85,7 +85,7 @@ except ImportError:
|
|||||||
and not os.path.isdir(fn)
|
and not os.path.isdir(fn)
|
||||||
)
|
)
|
||||||
|
|
||||||
# If we're given a path with a directory part, look it up directly rather
|
# If we’re given a path with a directory part, look it up directly rather
|
||||||
# than referring to PATH directories. This includes checking relative to the
|
# than referring to PATH directories. This includes checking relative to the
|
||||||
# current directory, e.g. ./script
|
# current directory, e.g. ./script
|
||||||
if os.path.dirname(cmd):
|
if os.path.dirname(cmd):
|
||||||
@ -115,7 +115,7 @@ except ImportError:
|
|||||||
else:
|
else:
|
||||||
files = [cmd + ext for ext in pathext]
|
files = [cmd + ext for ext in pathext]
|
||||||
else:
|
else:
|
||||||
# On other platforms you don't have things like PATHEXT to tell you
|
# On other platforms you don’t have things like PATHEXT to tell you
|
||||||
# what file suffixes are executable, so just pass on cmd as-is.
|
# what file suffixes are executable, so just pass on cmd as-is.
|
||||||
files = [cmd]
|
files = [cmd]
|
||||||
|
|
||||||
|
@ -102,7 +102,7 @@ class ThreadedSegment(Segment, MultiRunnedThread):
|
|||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
self.shutdown_event.set()
|
self.shutdown_event.set()
|
||||||
if self.daemon and self.is_alive():
|
if self.daemon and self.is_alive():
|
||||||
# Give the worker thread a chance to shutdown, but don't block for
|
# Give the worker thread a chance to shutdown, but don’t block for
|
||||||
# too long
|
# too long
|
||||||
self.join(0.01)
|
self.join(0.01)
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ class GitRepository(object):
|
|||||||
if path:
|
if path:
|
||||||
gitd = git_directory(self.directory)
|
gitd = git_directory(self.directory)
|
||||||
# We need HEAD as without it using fugitive to commit causes the
|
# We need HEAD as without it using fugitive to commit causes the
|
||||||
# current file's status (and only the current file) to not be updated
|
# current file’s status (and only the current file) to not be updated
|
||||||
# for some reason I cannot be bothered to figure out.
|
# for some reason I cannot be bothered to figure out.
|
||||||
return get_file_status(
|
return get_file_status(
|
||||||
directory=self.directory,
|
directory=self.directory,
|
||||||
|
@ -7,7 +7,7 @@ from powerline.lint.markedjson.error import MarkedError, Mark, NON_PRINTABLE
|
|||||||
from powerline.lib.unicode import unicode
|
from powerline.lib.unicode import unicode
|
||||||
|
|
||||||
|
|
||||||
# This module contains abstractions for the input stream. You don't have to
|
# This module contains abstractions for the input stream. You don’t have to
|
||||||
# looks further, there are no pretty code.
|
# looks further, there are no pretty code.
|
||||||
|
|
||||||
|
|
||||||
@ -24,7 +24,7 @@ class Reader(object):
|
|||||||
# Reader accepts
|
# Reader accepts
|
||||||
# - a file-like object with its `read` method returning `str`,
|
# - a file-like object with its `read` method returning `str`,
|
||||||
|
|
||||||
# Yeah, it's ugly and slow.
|
# Yeah, it’s ugly and slow.
|
||||||
def __init__(self, stream):
|
def __init__(self, stream):
|
||||||
self.name = None
|
self.name = None
|
||||||
self.stream = None
|
self.stream = None
|
||||||
|
@ -175,7 +175,7 @@ class Scanner:
|
|||||||
if self.check_plain():
|
if self.check_plain():
|
||||||
return self.fetch_plain()
|
return self.fetch_plain()
|
||||||
|
|
||||||
# No? It's an error. Let's produce a nice error message.
|
# No? It’s an error. Let’s produce a nice error message.
|
||||||
raise ScannerError(
|
raise ScannerError(
|
||||||
"while scanning for the next token", None,
|
"while scanning for the next token", None,
|
||||||
"found character %r that cannot start any token" % ch,
|
"found character %r that cannot start any token" % ch,
|
||||||
@ -186,7 +186,7 @@ class Scanner:
|
|||||||
|
|
||||||
def next_possible_simple_key(self):
|
def next_possible_simple_key(self):
|
||||||
# Return the number of the nearest possible simple key. Actually we
|
# Return the number of the nearest possible simple key. Actually we
|
||||||
# don't need to loop through the whole dictionary. We may replace it
|
# don’t need to loop through the whole dictionary. We may replace it
|
||||||
# with the following code:
|
# with the following code:
|
||||||
# if not self.possible_simple_keys:
|
# if not self.possible_simple_keys:
|
||||||
# return None
|
# return None
|
||||||
@ -211,11 +211,11 @@ class Scanner:
|
|||||||
del self.possible_simple_keys[level]
|
del self.possible_simple_keys[level]
|
||||||
|
|
||||||
def save_possible_simple_key(self):
|
def save_possible_simple_key(self):
|
||||||
# The next token may start a simple key. We check if it's possible
|
# The next token may start a simple key. We check if it’s possible
|
||||||
# and save its position. This function is called for
|
# and save its position. This function is called for
|
||||||
# SCALAR(flow), '[', and '{'.
|
# SCALAR(flow), '[', and '{'.
|
||||||
|
|
||||||
# The next token might be a simple key. Let's save it's number and
|
# The next token might be a simple key. Let’s save it’s number and
|
||||||
# position.
|
# position.
|
||||||
if self.allow_simple_key:
|
if self.allow_simple_key:
|
||||||
self.remove_possible_simple_key()
|
self.remove_possible_simple_key()
|
||||||
@ -364,7 +364,7 @@ class Scanner:
|
|||||||
def scan_flow_scalar(self):
|
def scan_flow_scalar(self):
|
||||||
# See the specification for details.
|
# See the specification for details.
|
||||||
# Note that we loose indentation rules for quoted scalars. Quoted
|
# Note that we loose indentation rules for quoted scalars. Quoted
|
||||||
# scalars don't need to adhere indentation because " and ' clearly
|
# scalars don’t need to adhere indentation because " and ' clearly
|
||||||
# mark the beginning and the end of them. Therefore we are less
|
# mark the beginning and the end of them. Therefore we are less
|
||||||
# restrictive then the specification requires. We only need to check
|
# restrictive then the specification requires. We only need to check
|
||||||
# that document separators are not included in scalars.
|
# that document separators are not included in scalars.
|
||||||
|
@ -248,7 +248,7 @@ class Renderer(object):
|
|||||||
current_width = 0
|
current_width = 0
|
||||||
|
|
||||||
if not width:
|
if not width:
|
||||||
# No width specified, so we don't need to crop or pad anything
|
# No width specified, so we don’t need to crop or pad anything
|
||||||
if output_width:
|
if output_width:
|
||||||
current_width = self._render_length(theme, segments, self.compute_divider_widths(theme))
|
current_width = self._render_length(theme, segments, self.compute_divider_widths(theme))
|
||||||
return construct_returned_value(''.join([
|
return construct_returned_value(''.join([
|
||||||
|
@ -14,7 +14,7 @@ class I3barRenderer(Renderer):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def hlstyle(*args, **kwargs):
|
def hlstyle(*args, **kwargs):
|
||||||
# We don't need to explicitly reset attributes, so skip those calls
|
# We don’t need to explicitly reset attributes, so skip those calls
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
def hl(self, contents, fg=None, bg=None, attr=None):
|
def hl(self, contents, fg=None, bg=None, attr=None):
|
||||||
|
@ -12,7 +12,7 @@ class PangoMarkupRenderer(Renderer):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def hlstyle(*args, **kwargs):
|
def hlstyle(*args, **kwargs):
|
||||||
# We don't need to explicitly reset attributes, so skip those calls
|
# We don’t need to explicitly reset attributes, so skip those calls
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
def hl(self, contents, fg=None, bg=None, attr=None):
|
def hl(self, contents, fg=None, bg=None, attr=None):
|
||||||
|
@ -82,7 +82,7 @@ class ShellRenderer(Renderer):
|
|||||||
|
|
||||||
If an argument is None, the argument is ignored. If an argument is
|
If an argument is None, the argument is ignored. If an argument is
|
||||||
False, the argument is reset to the terminal defaults. If an argument
|
False, the argument is reset to the terminal defaults. If an argument
|
||||||
is a valid color or attribute, it's added to the ANSI escape code.
|
is a valid color or attribute, it’s added to the ANSI escape code.
|
||||||
'''
|
'''
|
||||||
ansi = [0]
|
ansi = [0]
|
||||||
if fg is not None:
|
if fg is not None:
|
||||||
|
@ -13,7 +13,7 @@ class TmuxRenderer(Renderer):
|
|||||||
|
|
||||||
def hlstyle(self, fg=None, bg=None, attr=None):
|
def hlstyle(self, fg=None, bg=None, attr=None):
|
||||||
'''Highlight a segment.'''
|
'''Highlight a segment.'''
|
||||||
# We don't need to explicitly reset attributes, so skip those calls
|
# We don’t need to explicitly reset attributes, so skip those calls
|
||||||
if not attr and not bg and not fg:
|
if not attr and not bg and not fg:
|
||||||
return ''
|
return ''
|
||||||
tmux_attr = []
|
tmux_attr = []
|
||||||
|
@ -128,7 +128,7 @@ class VimRenderer(Renderer):
|
|||||||
|
|
||||||
If an argument is None, the argument is ignored. If an argument is
|
If an argument is None, the argument is ignored. If an argument is
|
||||||
False, the argument is reset to the terminal defaults. If an argument
|
False, the argument is reset to the terminal defaults. If an argument
|
||||||
is a valid color or attribute, it's added to the vim highlight group.
|
is a valid color or attribute, it’s added to the vim highlight group.
|
||||||
'''
|
'''
|
||||||
# In order not to hit E541 two consequent identical highlighting
|
# In order not to hit E541 two consequent identical highlighting
|
||||||
# specifiers may be squashed into one.
|
# specifiers may be squashed into one.
|
||||||
@ -137,7 +137,7 @@ class VimRenderer(Renderer):
|
|||||||
return ''
|
return ''
|
||||||
self.prev_highlight = (fg, bg, attr)
|
self.prev_highlight = (fg, bg, attr)
|
||||||
|
|
||||||
# We don't need to explicitly reset attributes in vim, so skip those
|
# We don’t need to explicitly reset attributes in vim, so skip those
|
||||||
# calls
|
# calls
|
||||||
if not attr and not bg and not fg:
|
if not attr and not bg and not fg:
|
||||||
return ''
|
return ''
|
||||||
|
@ -549,7 +549,7 @@ weather = with_docstring(WeatherSegment(),
|
|||||||
'''Return weather from Yahoo! Weather.
|
'''Return weather from Yahoo! Weather.
|
||||||
|
|
||||||
Uses GeoIP lookup from http://freegeoip.net/ to automatically determine
|
Uses GeoIP lookup from http://freegeoip.net/ to automatically determine
|
||||||
your current location. This should be changed if you're in a VPN or if your
|
your current location. This should be changed if you’re in a VPN or if your
|
||||||
IP address is registered at another location.
|
IP address is registered at another location.
|
||||||
|
|
||||||
Returns a list of colorized icon and temperature segments depending on
|
Returns a list of colorized icon and temperature segments depending on
|
||||||
@ -1060,7 +1060,7 @@ class NowPlayingSegment(Segment):
|
|||||||
set ..
|
set ..
|
||||||
set n
|
set n
|
||||||
|
|
||||||
For the information we are looking for we don't really care if we're on
|
For the information we are looking for we don’t really care if we’re on
|
||||||
the tag level or the set level. The dictionary comprehension in this
|
the tag level or the set level. The dictionary comprehension in this
|
||||||
method takes anything in ignore_levels and brings the key inside that
|
method takes anything in ignore_levels and brings the key inside that
|
||||||
to the first level of the dictionary.
|
to the first level of the dictionary.
|
||||||
|
@ -304,7 +304,7 @@ def file_size(pl, suffix='B', si_prefix=False):
|
|||||||
string appended to the file size
|
string appended to the file size
|
||||||
:param bool si_prefix:
|
:param bool si_prefix:
|
||||||
use SI prefix, e.g. MB instead of MiB
|
use SI prefix, e.g. MB instead of MiB
|
||||||
:return: file size or None if the file isn't saved or if the size is too big to fit in a number
|
:return: file size or None if the file isn’t saved or if the size is too big to fit in a number
|
||||||
'''
|
'''
|
||||||
# Note: returns file size in &encoding, not in &fileencoding. But returned
|
# Note: returns file size in &encoding, not in &fileencoding. But returned
|
||||||
# size is updated immediately; and it is valid for any buffer
|
# size is updated immediately; and it is valid for any buffer
|
||||||
|
@ -163,6 +163,6 @@ class Theme(object):
|
|||||||
elif segment['align'] == 'c':
|
elif segment['align'] == 'c':
|
||||||
segment['contents'] = segment['contents'].center(segment['width'])
|
segment['contents'] = segment['contents'].center(segment['width'])
|
||||||
# We need to yield a copy of the segment, or else mode-dependent
|
# We need to yield a copy of the segment, or else mode-dependent
|
||||||
# segment contents can't be cached correctly e.g. when caching
|
# segment contents can’t be cached correctly e.g. when caching
|
||||||
# non-current window contents for vim statuslines
|
# non-current window contents for vim statuslines
|
||||||
yield segment.copy()
|
yield segment.copy()
|
||||||
|
@ -398,7 +398,7 @@ def main():
|
|||||||
daemonize()
|
daemonize()
|
||||||
|
|
||||||
if use_filesystem:
|
if use_filesystem:
|
||||||
# Create a locked pid file containing the daemon's PID
|
# Create a locked pid file containing the daemon’s PID
|
||||||
if lockpidfile() is None:
|
if lockpidfile() is None:
|
||||||
if not args.quiet:
|
if not args.quiet:
|
||||||
sys.stderr.write(
|
sys.stderr.write(
|
||||||
|
2
setup.py
2
setup.py
@ -79,7 +79,7 @@ setup(
|
|||||||
author_email='kim.silkebaekken+vim@gmail.com',
|
author_email='kim.silkebaekken+vim@gmail.com',
|
||||||
url='https://github.com/Lokaltog/powerline',
|
url='https://github.com/Lokaltog/powerline',
|
||||||
license='MIT',
|
license='MIT',
|
||||||
# XXX Python 3 doesn't allow compiled C files to be included in the scripts
|
# XXX Python 3 doesn’t allow compiled C files to be included in the scripts
|
||||||
# list below. This is because Python 3 distutils tries to decode the file to
|
# list below. This is because Python 3 distutils tries to decode the file to
|
||||||
# ASCII, and fails when powerline-client is a binary.
|
# ASCII, and fails when powerline-client is a binary.
|
||||||
#
|
#
|
||||||
|
@ -33,7 +33,7 @@ class TestVimConfig(TestCase):
|
|||||||
)
|
)
|
||||||
with open(os.path.join(cfg_path, 'config.json'), 'r') as f:
|
with open(os.path.join(cfg_path, 'config.json'), 'r') as f:
|
||||||
local_themes_raw = json.load(f)['ext']['vim']['local_themes']
|
local_themes_raw = json.load(f)['ext']['vim']['local_themes']
|
||||||
# Don't run tests on external/plugin segments
|
# Don’t run tests on external/plugin segments
|
||||||
local_themes = dict((k, v) for (k, v) in local_themes_raw.items())
|
local_themes = dict((k, v) for (k, v) in local_themes_raw.items())
|
||||||
self.assertEqual(len(buffers), len(local_themes) - 1)
|
self.assertEqual(len(buffers), len(local_themes) - 1)
|
||||||
outputs = {}
|
outputs = {}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user