Replace all ASCII ' with Unicode ’ in comments and docstrings

This commit is contained in:
ZyX 2014-09-20 17:48:15 +04:00
parent 2b5e9e0dc1
commit 77b0695caf
20 changed files with 31 additions and 31 deletions

View File

@ -22,7 +22,7 @@ html_show_copyright = False
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 were building docs locally
try:
import sphinx_rtd_theme
html_theme = 'sphinx_rtd_theme'

View File

@ -1,7 +1,7 @@
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
# support these options likely won't work well with powerline
# Dont version-check for this core functionality -- anything too old to
# support these options likely wont work well with powerline
set -g status on
set -g status-utf8 on
set -g status-interval 2

View File

@ -66,7 +66,7 @@ def print_cycles(objects, outstream=sys.stdout, show_progress=False):
referents = gc.get_referents(obj)
for referent in referents:
# If we've found our way back to the start, this is
# If weve found our way back to the start, this is
# a cycle, so print it out
if referent is start:
try:
@ -78,13 +78,13 @@ def print_cycles(objects, outstream=sys.stdout, show_progress=False):
outstream.write('Cyclic reference: %i\n' % id(referent))
print_path(current_path)
# Don't go back through the original list of objects, or
# Dont go back through the original list of objects, or
# through temporary references to the object, since those
# are just an artifact of the cycle detector itself.
elif referent is objects or isinstance(referent, FrameType):
continue
# We haven't seen this object before, so recurse
# We havent seen this object before, so recurse
elif id(referent) not in all:
recurse(referent, start, all, current_path + (obj,))

View File

@ -85,7 +85,7 @@ except ImportError:
and not os.path.isdir(fn)
)
# If we're given a path with a directory part, look it up directly rather
# If were given a path with a directory part, look it up directly rather
# than referring to PATH directories. This includes checking relative to the
# current directory, e.g. ./script
if os.path.dirname(cmd):
@ -115,7 +115,7 @@ except ImportError:
else:
files = [cmd + ext for ext in pathext]
else:
# On other platforms you don't have things like PATHEXT to tell you
# On other platforms you dont have things like PATHEXT to tell you
# what file suffixes are executable, so just pass on cmd as-is.
files = [cmd]

View File

@ -102,7 +102,7 @@ class ThreadedSegment(Segment, MultiRunnedThread):
def shutdown(self):
self.shutdown_event.set()
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 dont block for
# too long
self.join(0.01)

View File

@ -70,7 +70,7 @@ class GitRepository(object):
if path:
gitd = git_directory(self.directory)
# 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 files status (and only the current file) to not be updated
# for some reason I cannot be bothered to figure out.
return get_file_status(
directory=self.directory,

View File

@ -7,7 +7,7 @@ from powerline.lint.markedjson.error import MarkedError, Mark, NON_PRINTABLE
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 dont have to
# looks further, there are no pretty code.
@ -24,7 +24,7 @@ class Reader(object):
# Reader accepts
# - a file-like object with its `read` method returning `str`,
# Yeah, it's ugly and slow.
# Yeah, its ugly and slow.
def __init__(self, stream):
self.name = None
self.stream = None

View File

@ -175,7 +175,7 @@ class Scanner:
if self.check_plain():
return self.fetch_plain()
# No? It's an error. Let's produce a nice error message.
# No? Its an error. Lets produce a nice error message.
raise ScannerError(
"while scanning for the next token", None,
"found character %r that cannot start any token" % ch,
@ -186,7 +186,7 @@ class Scanner:
def next_possible_simple_key(self):
# Return the number of the nearest possible simple key. Actually we
# don't need to loop through the whole dictionary. We may replace it
# dont need to loop through the whole dictionary. We may replace it
# with the following code:
# if not self.possible_simple_keys:
# return None
@ -211,11 +211,11 @@ class Scanner:
del self.possible_simple_keys[level]
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 its possible
# and save its position. This function is called for
# 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. Lets save its number and
# position.
if self.allow_simple_key:
self.remove_possible_simple_key()
@ -364,7 +364,7 @@ class Scanner:
def scan_flow_scalar(self):
# See the specification for details.
# Note that we loose indentation rules for quoted scalars. Quoted
# scalars don't need to adhere indentation because " and ' clearly
# scalars dont need to adhere indentation because " and ' clearly
# mark the beginning and the end of them. Therefore we are less
# restrictive then the specification requires. We only need to check
# that document separators are not included in scalars.

View File

@ -248,7 +248,7 @@ class Renderer(object):
current_width = 0
if not width:
# No width specified, so we don't need to crop or pad anything
# No width specified, so we dont need to crop or pad anything
if output_width:
current_width = self._render_length(theme, segments, self.compute_divider_widths(theme))
return construct_returned_value(''.join([

View File

@ -14,7 +14,7 @@ class I3barRenderer(Renderer):
@staticmethod
def hlstyle(*args, **kwargs):
# We don't need to explicitly reset attributes, so skip those calls
# We dont need to explicitly reset attributes, so skip those calls
return ''
def hl(self, contents, fg=None, bg=None, attr=None):

View File

@ -12,7 +12,7 @@ class PangoMarkupRenderer(Renderer):
@staticmethod
def hlstyle(*args, **kwargs):
# We don't need to explicitly reset attributes, so skip those calls
# We dont need to explicitly reset attributes, so skip those calls
return ''
def hl(self, contents, fg=None, bg=None, attr=None):

View File

@ -82,7 +82,7 @@ class ShellRenderer(Renderer):
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
is a valid color or attribute, it's added to the ANSI escape code.
is a valid color or attribute, its added to the ANSI escape code.
'''
ansi = [0]
if fg is not None:

View File

@ -13,7 +13,7 @@ class TmuxRenderer(Renderer):
def hlstyle(self, fg=None, bg=None, attr=None):
'''Highlight a segment.'''
# We don't need to explicitly reset attributes, so skip those calls
# We dont need to explicitly reset attributes, so skip those calls
if not attr and not bg and not fg:
return ''
tmux_attr = []

View File

@ -128,7 +128,7 @@ class VimRenderer(Renderer):
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
is a valid color or attribute, it's added to the vim highlight group.
is a valid color or attribute, its added to the vim highlight group.
'''
# In order not to hit E541 two consequent identical highlighting
# specifiers may be squashed into one.
@ -137,7 +137,7 @@ class VimRenderer(Renderer):
return ''
self.prev_highlight = (fg, bg, attr)
# We don't need to explicitly reset attributes in vim, so skip those
# We dont need to explicitly reset attributes in vim, so skip those
# calls
if not attr and not bg and not fg:
return ''

View File

@ -549,7 +549,7 @@ weather = with_docstring(WeatherSegment(),
'''Return weather from Yahoo! Weather.
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 youre in a VPN or if your
IP address is registered at another location.
Returns a list of colorized icon and temperature segments depending on
@ -1060,7 +1060,7 @@ class NowPlayingSegment(Segment):
set ..
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 dont really care if were on
the tag level or the set level. The dictionary comprehension in this
method takes anything in ignore_levels and brings the key inside that
to the first level of the dictionary.

View File

@ -304,7 +304,7 @@ def file_size(pl, suffix='B', si_prefix=False):
string appended to the file size
:param bool si_prefix:
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 isnt saved or if the size is too big to fit in a number
'''
# Note: returns file size in &encoding, not in &fileencoding. But returned
# size is updated immediately; and it is valid for any buffer

View File

@ -163,6 +163,6 @@ class Theme(object):
elif segment['align'] == 'c':
segment['contents'] = segment['contents'].center(segment['width'])
# 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 cant be cached correctly e.g. when caching
# non-current window contents for vim statuslines
yield segment.copy()

View File

@ -398,7 +398,7 @@ def main():
daemonize()
if use_filesystem:
# Create a locked pid file containing the daemon's PID
# Create a locked pid file containing the daemons PID
if lockpidfile() is None:
if not args.quiet:
sys.stderr.write(

View File

@ -79,7 +79,7 @@ setup(
author_email='kim.silkebaekken+vim@gmail.com',
url='https://github.com/Lokaltog/powerline',
license='MIT',
# XXX Python 3 doesn't allow compiled C files to be included in the scripts
# XXX Python 3 doesnt allow compiled C files to be included in the scripts
# list below. This is because Python 3 distutils tries to decode the file to
# ASCII, and fails when powerline-client is a binary.
#

View File

@ -33,7 +33,7 @@ class TestVimConfig(TestCase):
)
with open(os.path.join(cfg_path, 'config.json'), 'r') as f:
local_themes_raw = json.load(f)['ext']['vim']['local_themes']
# Don't run tests on external/plugin segments
# Dont run tests on external/plugin segments
local_themes = dict((k, v) for (k, v) in local_themes_raw.items())
self.assertEqual(len(buffers), len(local_themes) - 1)
outputs = {}