mirror of
https://github.com/powerline/powerline.git
synced 2025-07-25 14:54:54 +02:00
doc: installation, fix typo (#2041)
* doc: installation, fix typo * Fix a lot of documentation/comment typos
This commit is contained in:
parent
d6c06e002a
commit
15c611ca46
@ -53,7 +53,7 @@ Common configuration is a subdictionary that is a value of ``common`` key in
|
|||||||
|
|
||||||
``ambiwidth``
|
``ambiwidth``
|
||||||
Tells powerline what to do with characters with East Asian Width Class
|
Tells powerline what to do with characters with East Asian Width Class
|
||||||
Ambigious (such as Euro, Registered Sign, Copyright Sign, Greek
|
Ambiguous (such as Euro, Registered Sign, Copyright Sign, Greek
|
||||||
letters, Cyrillic letters). Valid values: any positive integer; it is
|
letters, Cyrillic letters). Valid values: any positive integer; it is
|
||||||
suggested that this option is only set it to 1 (default) or 2.
|
suggested that this option is only set it to 1 (default) or 2.
|
||||||
|
|
||||||
@ -132,7 +132,7 @@ Common configuration is a subdictionary that is a value of ``common`` key in
|
|||||||
|
|
||||||
``interval``
|
``interval``
|
||||||
Number, determines time (in seconds) between checks for changed
|
Number, determines time (in seconds) between checks for changed
|
||||||
configuration. Checks are done in a seprate thread. Use ``null`` to check
|
configuration. Checks are done in a separate thread. Use ``null`` to check
|
||||||
for configuration changes on ``.render()`` call in main thread.
|
for configuration changes on ``.render()`` call in main thread.
|
||||||
Defaults to ``None``.
|
Defaults to ``None``.
|
||||||
|
|
||||||
@ -245,7 +245,7 @@ Color definitions
|
|||||||
gradient, and the value is a list containing one or two items, second item
|
gradient, and the value is a list containing one or two items, second item
|
||||||
is optional:
|
is optional:
|
||||||
|
|
||||||
* A list of cterm color indicies.
|
* A list of cterm color indices.
|
||||||
* A list of hex color strings.
|
* A list of hex color strings.
|
||||||
|
|
||||||
It is expected that gradients are defined from least alert color to most
|
It is expected that gradients are defined from least alert color to most
|
||||||
@ -388,7 +388,7 @@ ascii Theme without any unicode characters at all
|
|||||||
|
|
||||||
``cursor_columns``
|
``cursor_columns``
|
||||||
Space reserved for user input in shell bindings. Unlike :ref:`cursor_space
|
Space reserved for user input in shell bindings. Unlike :ref:`cursor_space
|
||||||
<config-themes-cursor_space>` it is measured in absolute amout of columns.
|
<config-themes-cursor_space>` it is measured in absolute amount of columns.
|
||||||
|
|
||||||
.. _config-themes-segment_data:
|
.. _config-themes-segment_data:
|
||||||
|
|
||||||
|
@ -62,7 +62,7 @@ with any coding font.
|
|||||||
|
|
||||||
mv PowerlineSymbols.otf ~/.local/share/fonts/
|
mv PowerlineSymbols.otf ~/.local/share/fonts/
|
||||||
|
|
||||||
#. Update font cache for the path the font was moved to (root priveleges may be
|
#. Update font cache for the path the font was moved to (root privileges may be
|
||||||
needed to update cache for the system-wide paths)::
|
needed to update cache for the system-wide paths)::
|
||||||
|
|
||||||
fc-cache -vf ~/.local/share/fonts/
|
fc-cache -vf ~/.local/share/fonts/
|
||||||
|
@ -53,7 +53,7 @@ diagnose this problem you may do the following:
|
|||||||
startup or, at least, that it was cleaned after update. While different
|
startup or, at least, that it was cleaned after update. While different
|
||||||
``$POWERLINE_COMMAND`` variable should not cause any troubles most of time
|
``$POWERLINE_COMMAND`` variable should not cause any troubles most of time
|
||||||
(and when it will cause troubles are rather trivial) spoiled
|
(and when it will cause troubles are rather trivial) spoiled
|
||||||
``$PROMPT_COMMAND`` may lead to strange error messages or absense of exit
|
``$PROMPT_COMMAND`` may lead to strange error messages or absence of exit
|
||||||
code reporting.
|
code reporting.
|
||||||
|
|
||||||
These are the sources which may keep outdated environment variables:
|
These are the sources which may keep outdated environment variables:
|
||||||
|
@ -380,8 +380,8 @@ def gen_module_attr_getter(pl, import_paths, imported_modules):
|
|||||||
|
|
||||||
:return:
|
:return:
|
||||||
Attribute value or ``None``. Note: there is no way to distinguish
|
Attribute value or ``None``. Note: there is no way to distinguish
|
||||||
between successfull import of attribute equal to ``None`` and
|
between successful import of attribute equal to ``None`` and
|
||||||
unsuccessfull import.
|
unsuccessful import.
|
||||||
'''
|
'''
|
||||||
oldpath = sys.path
|
oldpath = sys.path
|
||||||
sys.path = import_paths + sys.path
|
sys.path = import_paths + sys.path
|
||||||
@ -473,7 +473,7 @@ class Powerline(object):
|
|||||||
|
|
||||||
__init__ function only stores the arguments and runs this function. This
|
__init__ function only stores the arguments and runs this function. This
|
||||||
function exists for powerline to be able to reload itself: it is easier
|
function exists for powerline to be able to reload itself: it is easier
|
||||||
to make ``__init__`` store arguments and call overriddable ``init`` than
|
to make ``__init__`` store arguments and call overridable ``init`` than
|
||||||
tell developers that each time they override Powerline.__init__ in
|
tell developers that each time they override Powerline.__init__ in
|
||||||
subclasses they must store actual arguments.
|
subclasses they must store actual arguments.
|
||||||
'''
|
'''
|
||||||
@ -706,7 +706,7 @@ class Powerline(object):
|
|||||||
'''Run component-specific setup
|
'''Run component-specific setup
|
||||||
|
|
||||||
:param set components:
|
:param set components:
|
||||||
Set of the enabled componets or None.
|
Set of the enabled components or None.
|
||||||
|
|
||||||
Should be overridden by subclasses.
|
Should be overridden by subclasses.
|
||||||
'''
|
'''
|
||||||
|
@ -47,7 +47,7 @@ def get_argparser(ArgumentParser=ConfigArgParser):
|
|||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'-p', '--config-path', action='append', metavar='PATH',
|
'-p', '--config-path', action='append', metavar='PATH',
|
||||||
help='Path to configuration directory. If it is present '
|
help='Path to configuration directory. If it is present '
|
||||||
'then configuration files will only be seeked in the provided path. '
|
'then configuration files will only be sought in the provided path. '
|
||||||
'May be provided multiple times to search in a list of directories.'
|
'May be provided multiple times to search in a list of directories.'
|
||||||
)
|
)
|
||||||
subparsers = parser.add_subparsers()
|
subparsers = parser.add_subparsers()
|
||||||
|
@ -146,13 +146,13 @@ def get_argparser(ArgumentParser=argparse.ArgumentParser):
|
|||||||
help='Like above, but provides argument for renderer. Is supposed '
|
help='Like above, but provides argument for renderer. Is supposed '
|
||||||
'to be used only by shell bindings to provide various data like '
|
'to be used only by shell bindings to provide various data like '
|
||||||
'last-exit-code or last-pipe-status (they are not using '
|
'last-exit-code or last-pipe-status (they are not using '
|
||||||
'`--renderer-arg\' for historical resons: `--renderer-arg\' '
|
'`--renderer-arg\' for historical reasons: `--renderer-arg\' '
|
||||||
'was added later).'
|
'was added later).'
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'-p', '--config-path', action='append', metavar='PATH',
|
'-p', '--config-path', action='append', metavar='PATH',
|
||||||
help='Path to configuration directory. If it is present then '
|
help='Path to configuration directory. If it is present then '
|
||||||
'configuration files will only be seeked in the provided path. '
|
'configuration files will only be sought in the provided path. '
|
||||||
'May be provided multiple times to search in a list of directories.'
|
'May be provided multiple times to search in a list of directories.'
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
|
@ -227,7 +227,7 @@ _strwidth_documentation = (
|
|||||||
character sets because they have explicit fullwidth or wide
|
character sets because they have explicit fullwidth or wide
|
||||||
counterparts. All of ASCII is an example of East Asian
|
counterparts. All of ASCII is an example of East Asian
|
||||||
Narrow characters.
|
Narrow characters.
|
||||||
A 1 or 2 Ambigious: characters that may sometimes be wide and
|
A 1 or 2 Ambiguous: characters that may sometimes be wide and
|
||||||
sometimes narrow. Ambiguous characters require additional
|
sometimes narrow. Ambiguous characters require additional
|
||||||
information not contained in the character code to further
|
information not contained in the character code to further
|
||||||
resolve their width. This information is usually defined in
|
resolve their width. This information is usually defined in
|
||||||
|
@ -154,7 +154,7 @@ def get_file_status(directory, dirstate_file, file_path, ignore_file_name, get_f
|
|||||||
except OSError as e:
|
except OSError as e:
|
||||||
if getattr(e, 'errno', None) != errno.ENOENT:
|
if getattr(e, 'errno', None) != errno.ENOENT:
|
||||||
raise
|
raise
|
||||||
# Do not call get_func again for a non-existant file
|
# Do not call get_func again for a non-existent file
|
||||||
if keypath not in file_status_cache:
|
if keypath not in file_status_cache:
|
||||||
file_status_cache[keypath] = get_func(directory, file_path)
|
file_status_cache[keypath] = get_func(directory, file_path)
|
||||||
return file_status_cache[keypath]
|
return file_status_cache[keypath]
|
||||||
|
@ -171,7 +171,7 @@ except ImportError:
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def ignore_event(path, name):
|
def ignore_event(path, name):
|
||||||
# Ignore changes to the index.lock file, since they happen
|
# Ignore changes to the index.lock file, since they happen
|
||||||
# frequently and dont indicate an actual change in the working tree
|
# frequently and don't indicate an actual change in the working tree
|
||||||
# status
|
# status
|
||||||
return path.endswith('.git') and name == 'index.lock'
|
return path.endswith('.git') and name == 'index.lock'
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ class INotifyFileWatcher(INotify):
|
|||||||
|
|
||||||
def process_event(self, wd, mask, cookie, name):
|
def process_event(self, wd, mask, cookie, name):
|
||||||
if wd == -1 and (mask & self.Q_OVERFLOW):
|
if wd == -1 and (mask & self.Q_OVERFLOW):
|
||||||
# We missed some INOTIFY events, so we dont
|
# We missed some INOTIFY events, so we don't
|
||||||
# know the state of any tracked files.
|
# know the state of any tracked files.
|
||||||
for path in tuple(self.modified):
|
for path in tuple(self.modified):
|
||||||
if os.path.exists(path):
|
if os.path.exists(path):
|
||||||
@ -114,7 +114,7 @@ class INotifyFileWatcher(INotify):
|
|||||||
self.expire_watches()
|
self.expire_watches()
|
||||||
if path not in self.watches:
|
if path not in self.watches:
|
||||||
# Try to re-add the watch, it will fail if the file does not
|
# Try to re-add the watch, it will fail if the file does not
|
||||||
# exist/you dont have permission
|
# exist/you don't have permission
|
||||||
self.watch(path)
|
self.watch(path)
|
||||||
return True
|
return True
|
||||||
self.read(get_name=False)
|
self.read(get_name=False)
|
||||||
@ -187,7 +187,7 @@ class INotifyTreeWatcher(INotify):
|
|||||||
raise NoSuchDir('The dir {0} does not exist'.format(base))
|
raise NoSuchDir('The dir {0} does not exist'.format(base))
|
||||||
return
|
return
|
||||||
if e.errno == errno.EACCES:
|
if e.errno == errno.EACCES:
|
||||||
# We silently ignore entries for which we dont have permission,
|
# We silently ignore entries for which we don't have permission,
|
||||||
# unless they are the top level dir
|
# unless they are the top level dir
|
||||||
if top_level:
|
if top_level:
|
||||||
raise NoSuchDir('You do not have permission to monitor {0}'.format(base))
|
raise NoSuchDir('You do not have permission to monitor {0}'.format(base))
|
||||||
@ -235,7 +235,7 @@ class INotifyTreeWatcher(INotify):
|
|||||||
|
|
||||||
def process_event(self, wd, mask, cookie, name):
|
def process_event(self, wd, mask, cookie, name):
|
||||||
if wd == -1 and (mask & self.Q_OVERFLOW):
|
if wd == -1 and (mask & self.Q_OVERFLOW):
|
||||||
# We missed some INOTIFY events, so we dont
|
# We missed some INOTIFY events, so we don't
|
||||||
# know the state of any tracked dirs.
|
# know the state of any tracked dirs.
|
||||||
self.watch_tree()
|
self.watch_tree()
|
||||||
self.modified = True
|
self.modified = True
|
||||||
|
@ -401,7 +401,7 @@ def check_segment_function(function_name, data, context, echoerr):
|
|||||||
context='Error while checking theme (key {key})'.format(key=context.key),
|
context='Error while checking theme (key {key})'.format(key=context.key),
|
||||||
context_mark=function_name.mark,
|
context_mark=function_name.mark,
|
||||||
problem=(
|
problem=(
|
||||||
'found highlight group definition in addition to sentense stating that '
|
'found highlight group definition in addition to sentence stating that '
|
||||||
'no highlight groups are used'
|
'no highlight groups are used'
|
||||||
),
|
),
|
||||||
problem_mark=mark,
|
problem_mark=mark,
|
||||||
@ -425,7 +425,7 @@ def check_segment_function(function_name, data, context, echoerr):
|
|||||||
context='Error while checking theme (key {key})'.format(key=context.key),
|
context='Error while checking theme (key {key})'.format(key=context.key),
|
||||||
context_mark=function_name.mark,
|
context_mark=function_name.mark,
|
||||||
problem=(
|
problem=(
|
||||||
'found sentense stating that no highlight groups are used '
|
'found sentence stating that no highlight groups are used '
|
||||||
'in addition to highlight group definition'
|
'in addition to highlight group definition'
|
||||||
),
|
),
|
||||||
problem_mark=mark,
|
problem_mark=mark,
|
||||||
|
@ -264,7 +264,7 @@ class Spec(object):
|
|||||||
:param func msg_func:
|
:param func msg_func:
|
||||||
Callable like ``msg_func`` from :py:meth:`Spec.check_func`. Should
|
Callable like ``msg_func`` from :py:meth:`Spec.check_func`. Should
|
||||||
accept one problematic item and is not used for :py:class:`Spec`
|
accept one problematic item and is not used for :py:class:`Spec`
|
||||||
object indicies in ``item_func`` method.
|
object indices in ``item_func`` method.
|
||||||
|
|
||||||
:return: proceed, hadproblem.
|
:return: proceed, hadproblem.
|
||||||
'''
|
'''
|
||||||
@ -515,7 +515,7 @@ class Spec(object):
|
|||||||
optional. Each element in this list describes element with the same
|
optional. Each element in this list describes element with the same
|
||||||
index in the checked value. Check out :py:meth:`Spec.check_tuple`
|
index in the checked value. Check out :py:meth:`Spec.check_tuple`
|
||||||
for more details, but note that there list of specifications is
|
for more details, but note that there list of specifications is
|
||||||
replaced with start and end indicies in ``self.specs``.
|
replaced with start and end indices in ``self.specs``.
|
||||||
|
|
||||||
:return: self.
|
:return: self.
|
||||||
'''
|
'''
|
||||||
@ -633,7 +633,7 @@ class Spec(object):
|
|||||||
|
|
||||||
Check out :py:meth:`Spec.check_either` method documentation for more
|
Check out :py:meth:`Spec.check_either` method documentation for more
|
||||||
details, but note that there a list of specs was replaced by start and
|
details, but note that there a list of specs was replaced by start and
|
||||||
end indicies in ``self.specs``.
|
end indices in ``self.specs``.
|
||||||
|
|
||||||
:return: self.
|
:return: self.
|
||||||
'''
|
'''
|
||||||
|
@ -114,7 +114,7 @@ class Renderer(object):
|
|||||||
Object used for logging.
|
Object used for logging.
|
||||||
:param int ambiwidth:
|
:param int ambiwidth:
|
||||||
Width of the characters with east asian width unicode attribute equal to
|
Width of the characters with east asian width unicode attribute equal to
|
||||||
``A`` (Ambigious).
|
``A`` (Ambiguous).
|
||||||
:param dict options:
|
:param dict options:
|
||||||
Various options. Are normally not used by base renderer, but all options
|
Various options. Are normally not used by base renderer, but all options
|
||||||
are recorded as attributes.
|
are recorded as attributes.
|
||||||
@ -173,7 +173,7 @@ class Renderer(object):
|
|||||||
self.width_data = {
|
self.width_data = {
|
||||||
'N': 1, # Neutral
|
'N': 1, # Neutral
|
||||||
'Na': 1, # Narrow
|
'Na': 1, # Narrow
|
||||||
'A': ambiwidth, # Ambigious
|
'A': ambiwidth, # Ambiguous
|
||||||
'H': 1, # Half-width
|
'H': 1, # Half-width
|
||||||
'W': 2, # Wide
|
'W': 2, # Wide
|
||||||
'F': 2, # Fullwidth
|
'F': 2, # Fullwidth
|
||||||
@ -356,7 +356,7 @@ class Renderer(object):
|
|||||||
segments_priority = iter(segments_priority)
|
segments_priority = iter(segments_priority)
|
||||||
if current_width > width and len(segments) > 100:
|
if current_width > width and len(segments) > 100:
|
||||||
# When there are too many segments use faster, but less correct
|
# When there are too many segments use faster, but less correct
|
||||||
# algorythm for width computation
|
# algorithm for width computation
|
||||||
diff = current_width - width
|
diff = current_width - width
|
||||||
for segment in segments_priority:
|
for segment in segments_priority:
|
||||||
segments.remove(segment)
|
segments.remove(segment)
|
||||||
|
@ -21,7 +21,7 @@ class I3barRenderer(Renderer):
|
|||||||
segment = {
|
segment = {
|
||||||
'full_text': contents,
|
'full_text': contents,
|
||||||
'separator': False,
|
'separator': False,
|
||||||
'separator_block_width': 0, # no seperators
|
'separator_block_width': 0, # no separators
|
||||||
}
|
}
|
||||||
|
|
||||||
if fg is not None:
|
if fg is not None:
|
||||||
|
@ -161,7 +161,7 @@ class CmusPlayerSegment(PlayerSegment):
|
|||||||
cmus = with_docstring(CmusPlayerSegment(),
|
cmus = with_docstring(CmusPlayerSegment(),
|
||||||
('''Return CMUS player information
|
('''Return CMUS player information
|
||||||
|
|
||||||
Requires cmus-remote command be acessible from $PATH.
|
Requires cmus-remote command be accessible from $PATH.
|
||||||
|
|
||||||
{0}
|
{0}
|
||||||
''').format(_common_args.format('cmus')))
|
''').format(_common_args.format('cmus')))
|
||||||
@ -228,7 +228,7 @@ mpd = with_docstring(MpdPlayerSegment(),
|
|||||||
('''Return Music Player Daemon information
|
('''Return Music Player Daemon information
|
||||||
|
|
||||||
Requires ``mpd`` Python module (e.g. |python-mpd2|_ or |python-mpd|_ Python
|
Requires ``mpd`` Python module (e.g. |python-mpd2|_ or |python-mpd|_ Python
|
||||||
package) or alternatively the ``mpc`` command to be acessible from $PATH.
|
package) or alternatively the ``mpc`` command to be accessible from $PATH.
|
||||||
|
|
||||||
.. |python-mpd| replace:: ``python-mpd``
|
.. |python-mpd| replace:: ``python-mpd``
|
||||||
.. _python-mpd: https://pypi.python.org/pypi/python-mpd
|
.. _python-mpd: https://pypi.python.org/pypi/python-mpd
|
||||||
|
@ -470,7 +470,7 @@ def col_current(pl, segment_info):
|
|||||||
|
|
||||||
@window_cached
|
@window_cached
|
||||||
def virtcol_current(pl, gradient=True):
|
def virtcol_current(pl, gradient=True):
|
||||||
'''Return current visual column with concealed characters ingored
|
'''Return current visual column with concealed characters ignored
|
||||||
|
|
||||||
:param bool gradient:
|
:param bool gradient:
|
||||||
Determines whether it should show textwidth-based gradient (gradient level is ``virtcol * 100 / textwidth``).
|
Determines whether it should show textwidth-based gradient (gradient level is ``virtcol * 100 / textwidth``).
|
||||||
@ -764,7 +764,7 @@ def csv_col_current(pl, segment_info, display_name='auto', name_format=' ({colum
|
|||||||
:param bool or str name:
|
:param bool or str name:
|
||||||
May be ``True``, ``False`` and ``"auto"``. In the first case value from
|
May be ``True``, ``False`` and ``"auto"``. In the first case value from
|
||||||
the first raw will always be displayed. In the second case it will never
|
the first raw will always be displayed. In the second case it will never
|
||||||
be displayed. In thi last case ``csv.Sniffer().has_header()`` will be
|
be displayed. In the last case ``csv.Sniffer().has_header()`` will be
|
||||||
used to detect whether current file contains header in the first column.
|
used to detect whether current file contains header in the first column.
|
||||||
:param str name_format:
|
:param str name_format:
|
||||||
String used to format column name (in case ``display_name`` is set to
|
String used to format column name (in case ``display_name`` is set to
|
||||||
|
@ -424,7 +424,7 @@ class TestLib(TestCase):
|
|||||||
width_data = {
|
width_data = {
|
||||||
'N': 1, # Neutral
|
'N': 1, # Neutral
|
||||||
'Na': 1, # Narrow
|
'Na': 1, # Narrow
|
||||||
'A': 1, # Ambigious
|
'A': 1, # Ambiguous
|
||||||
'H': 1, # Half-width
|
'H': 1, # Half-width
|
||||||
'W': 2, # Wide
|
'W': 2, # Wide
|
||||||
'F': 2, # Fullwidth
|
'F': 2, # Fullwidth
|
||||||
|
Loading…
x
Reference in New Issue
Block a user