mirror of
https://github.com/powerline/powerline.git
synced 2025-07-23 13:55:45 +02:00
add version file
This commit is contained in:
parent
022d77dc1e
commit
3dc174919d
@ -14,7 +14,7 @@ from powerline.config import DEFAULT_SYSTEM_CONFIG_DIR
|
|||||||
from powerline.lib.dict import mergedicts
|
from powerline.lib.dict import mergedicts
|
||||||
from powerline.lib.encoding import get_preferred_output_encoding
|
from powerline.lib.encoding import get_preferred_output_encoding
|
||||||
from powerline.lib.path import join
|
from powerline.lib.path import join
|
||||||
|
from powerline.version import __version__
|
||||||
|
|
||||||
class NotInterceptedError(BaseException):
|
class NotInterceptedError(BaseException):
|
||||||
pass
|
pass
|
||||||
@ -55,8 +55,8 @@ class PowerlineLogger(object):
|
|||||||
``{message}``
|
``{message}``
|
||||||
is the original message passed to one of the logging methods.
|
is the original message passed to one of the logging methods.
|
||||||
|
|
||||||
Each of the methods (``critical``, ``exception``, ``info``, ``error``,
|
Each of the methods (``critical``, ``exception``, ``info``, ``error``,
|
||||||
``warn``, ``debug``) expects to receive message in an ``str.format`` format,
|
``warn``, ``debug``) expects to receive message in an ``str.format`` format,
|
||||||
not in printf-like format.
|
not in printf-like format.
|
||||||
|
|
||||||
Log is saved to the location :ref:`specified by user <config-common-log>`.
|
Log is saved to the location :ref:`specified by user <config-common-log>`.
|
||||||
@ -159,11 +159,11 @@ def generate_config_finder(get_config_paths=get_config_paths):
|
|||||||
This function will find .json file given its path.
|
This function will find .json file given its path.
|
||||||
|
|
||||||
:param function get_config_paths:
|
:param function get_config_paths:
|
||||||
Function that being called with no arguments will return a list of paths
|
Function that being called with no arguments will return a list of paths
|
||||||
that should be searched for configuration files.
|
that should be searched for configuration files.
|
||||||
|
|
||||||
:return:
|
:return:
|
||||||
Function that being given configuration file name will return full path
|
Function that being given configuration file name will return full path
|
||||||
to it or raise IOError if it failed to find the file.
|
to it or raise IOError if it failed to find the file.
|
||||||
'''
|
'''
|
||||||
config_paths = get_config_paths()
|
config_paths = get_config_paths()
|
||||||
@ -178,12 +178,12 @@ def load_config(cfg_path, find_config_files, config_loader, loader_callback=None
|
|||||||
:param str cfg_path:
|
:param str cfg_path:
|
||||||
Path for configuration file that should be loaded.
|
Path for configuration file that should be loaded.
|
||||||
:param function find_config_files:
|
:param function find_config_files:
|
||||||
Function that finds configuration file. Check out the description of
|
Function that finds configuration file. Check out the description of
|
||||||
the return value of ``generate_config_finder`` function.
|
the return value of ``generate_config_finder`` function.
|
||||||
:param ConfigLoader config_loader:
|
:param ConfigLoader config_loader:
|
||||||
Configuration file loader class instance.
|
Configuration file loader class instance.
|
||||||
:param function loader_callback:
|
:param function loader_callback:
|
||||||
Function that will be called by config_loader when change to
|
Function that will be called by config_loader when change to
|
||||||
configuration file is detected.
|
configuration file is detected.
|
||||||
|
|
||||||
:return: Configuration file contents.
|
:return: Configuration file contents.
|
||||||
@ -210,7 +210,7 @@ def _set_log_handlers(common_config, logger, get_module_attr, stream=None):
|
|||||||
:param func get_module_attr:
|
:param func get_module_attr:
|
||||||
:py:func:`gen_module_attr_getter` output.
|
:py:func:`gen_module_attr_getter` output.
|
||||||
:param file stream:
|
:param file stream:
|
||||||
Stream to use by default for :py:class:`logging.StreamHandler` in place
|
Stream to use by default for :py:class:`logging.StreamHandler` in place
|
||||||
of :py:attr:`sys.stderr`. May be ``None``.
|
of :py:attr:`sys.stderr`. May be ``None``.
|
||||||
'''
|
'''
|
||||||
log_targets = common_config['log_file']
|
log_targets = common_config['log_file']
|
||||||
@ -266,16 +266,16 @@ def create_logger(common_config, use_daemon_threads=True, ext='__unknown__',
|
|||||||
:param dict common_config:
|
:param dict common_config:
|
||||||
Common configuration, from :py:func:`finish_common_config`.
|
Common configuration, from :py:func:`finish_common_config`.
|
||||||
:param bool use_daemon_threads:
|
:param bool use_daemon_threads:
|
||||||
Whether daemon threads should be used. Argument to
|
Whether daemon threads should be used. Argument to
|
||||||
:py:class:`PowerlineLogger` constructor.
|
:py:class:`PowerlineLogger` constructor.
|
||||||
:param str ext:
|
:param str ext:
|
||||||
Used extension. Argument to :py:class:`PowerlineLogger` constructor.
|
Used extension. Argument to :py:class:`PowerlineLogger` constructor.
|
||||||
:param set imported_modules:
|
:param set imported_modules:
|
||||||
Set where imported modules are saved. Argument to
|
Set where imported modules are saved. Argument to
|
||||||
:py:func:`gen_module_attr_getter`. May be ``None``, in this case new
|
:py:func:`gen_module_attr_getter`. May be ``None``, in this case new
|
||||||
empty set is used.
|
empty set is used.
|
||||||
:param file stream:
|
:param file stream:
|
||||||
Stream to use by default for :py:class:`logging.StreamHandler` in place
|
Stream to use by default for :py:class:`logging.StreamHandler` in place
|
||||||
of :py:attr:`sys.stderr`. May be ``None``.
|
of :py:attr:`sys.stderr`. May be ``None``.
|
||||||
|
|
||||||
:return: Three objects:
|
:return: Three objects:
|
||||||
@ -302,7 +302,7 @@ def get_default_theme(is_unicode=True):
|
|||||||
'''Get default theme used by powerline
|
'''Get default theme used by powerline
|
||||||
|
|
||||||
:param bool is_unicode:
|
:param bool is_unicode:
|
||||||
If true, return theme for unicode environments, otherwise return theme
|
If true, return theme for unicode environments, otherwise return theme
|
||||||
that is supposed to be ASCII-only.
|
that is supposed to be ASCII-only.
|
||||||
|
|
||||||
:return: theme name.
|
:return: theme name.
|
||||||
@ -317,7 +317,7 @@ def finish_common_config(encoding, common_config):
|
|||||||
Common configuration, as it was just loaded.
|
Common configuration, as it was just loaded.
|
||||||
|
|
||||||
:return:
|
:return:
|
||||||
Copy of common configuration with all configuration keys and expanded
|
Copy of common configuration with all configuration keys and expanded
|
||||||
paths.
|
paths.
|
||||||
'''
|
'''
|
||||||
encoding = encoding.lower()
|
encoding = encoding.lower()
|
||||||
@ -379,7 +379,7 @@ def gen_module_attr_getter(pl, import_paths, imported_modules):
|
|||||||
in ``fromlist`` tuple.
|
in ``fromlist`` tuple.
|
||||||
|
|
||||||
: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 successful import of attribute equal to ``None`` and
|
between successful import of attribute equal to ``None`` and
|
||||||
unsuccessful import.
|
unsuccessful import.
|
||||||
'''
|
'''
|
||||||
@ -411,7 +411,7 @@ def _get_log_keys(common_config):
|
|||||||
Common configuration.
|
Common configuration.
|
||||||
|
|
||||||
:return:
|
:return:
|
||||||
:py:class:`dict` instance which has only keys from
|
:py:class:`dict` instance which has only keys from
|
||||||
:py:attr:`powerline.LOG_KEYS` left.
|
:py:attr:`powerline.LOG_KEYS` left.
|
||||||
'''
|
'''
|
||||||
return dict((
|
return dict((
|
||||||
@ -425,29 +425,29 @@ DEFAULT_UPDATE_INTERVAL = 2
|
|||||||
|
|
||||||
|
|
||||||
class Powerline(object):
|
class Powerline(object):
|
||||||
'''Main powerline class, entrance point for all powerline uses. Sets
|
'''Main powerline class, entrance point for all powerline uses. Sets
|
||||||
powerline up and loads the configuration.
|
powerline up and loads the configuration.
|
||||||
|
|
||||||
:param str ext:
|
:param str ext:
|
||||||
extension used. Determines where configuration files will
|
extension used. Determines where configuration files will
|
||||||
searched and what renderer module will be used. Affected: used ``ext``
|
searched and what renderer module will be used. Affected: used ``ext``
|
||||||
dictionary from :file:`powerline/config.json`, location of themes and
|
dictionary from :file:`powerline/config.json`, location of themes and
|
||||||
colorschemes, render module (``powerline.renders.{ext}``).
|
colorschemes, render module (``powerline.renders.{ext}``).
|
||||||
:param str renderer_module:
|
:param str renderer_module:
|
||||||
Overrides renderer module (defaults to ``ext``). Should be the name of
|
Overrides renderer module (defaults to ``ext``). Should be the name of
|
||||||
the package imported like this: ``powerline.renderers.{render_module}``.
|
the package imported like this: ``powerline.renderers.{render_module}``.
|
||||||
If this parameter contains a dot ``powerline.renderers.`` is not
|
If this parameter contains a dot ``powerline.renderers.`` is not
|
||||||
prepended. There is also a special case for renderers defined in
|
prepended. There is also a special case for renderers defined in
|
||||||
toplevel modules: ``foo.`` (note: dot at the end) tries to get renderer
|
toplevel modules: ``foo.`` (note: dot at the end) tries to get renderer
|
||||||
from module ``foo`` (because ``foo`` (without dot) tries to get renderer
|
from module ``foo`` (because ``foo`` (without dot) tries to get renderer
|
||||||
from module ``powerline.renderers.foo``). When ``.foo`` (with leading
|
from module ``powerline.renderers.foo``). When ``.foo`` (with leading
|
||||||
dot) variant is used ``renderer_module`` will be
|
dot) variant is used ``renderer_module`` will be
|
||||||
``powerline.renderers.{ext}{renderer_module}``.
|
``powerline.renderers.{ext}{renderer_module}``.
|
||||||
:param bool run_once:
|
:param bool run_once:
|
||||||
Determines whether :py:meth:`render` method will be run only once
|
Determines whether :py:meth:`render` method will be run only once
|
||||||
during python session.
|
during python session.
|
||||||
:param Logger logger:
|
:param Logger logger:
|
||||||
If present no new logger will be created and the provided logger will be
|
If present no new logger will be created and the provided logger will be
|
||||||
used.
|
used.
|
||||||
:param bool use_daemon_threads:
|
:param bool use_daemon_threads:
|
||||||
When creating threads make them daemon ones.
|
When creating threads make them daemon ones.
|
||||||
@ -471,10 +471,10 @@ class Powerline(object):
|
|||||||
config_loader=None):
|
config_loader=None):
|
||||||
'''Do actual initialization.
|
'''Do actual initialization.
|
||||||
|
|
||||||
__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 overridable ``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.
|
||||||
'''
|
'''
|
||||||
self.ext = ext
|
self.ext = ext
|
||||||
@ -530,7 +530,7 @@ class Powerline(object):
|
|||||||
def create_logger(self):
|
def create_logger(self):
|
||||||
'''Create logger
|
'''Create logger
|
||||||
|
|
||||||
This function is used to create logger unless it was already specified
|
This function is used to create logger unless it was already specified
|
||||||
at initialization.
|
at initialization.
|
||||||
|
|
||||||
:return: Three objects:
|
:return: Three objects:
|
||||||
@ -548,18 +548,18 @@ class Powerline(object):
|
|||||||
)
|
)
|
||||||
|
|
||||||
def create_renderer(self, load_main=False, load_colors=False, load_colorscheme=False, load_theme=False):
|
def create_renderer(self, load_main=False, load_colors=False, load_colorscheme=False, load_theme=False):
|
||||||
'''(Re)create renderer object. Can be used after Powerline object was
|
'''(Re)create renderer object. Can be used after Powerline object was
|
||||||
successfully initialized. If any of the below parameters except
|
successfully initialized. If any of the below parameters except
|
||||||
``load_main`` is True renderer object will be recreated.
|
``load_main`` is True renderer object will be recreated.
|
||||||
|
|
||||||
:param bool load_main:
|
:param bool load_main:
|
||||||
Determines whether main configuration file (:file:`config.json`)
|
Determines whether main configuration file (:file:`config.json`)
|
||||||
should be loaded. If appropriate configuration changes implies
|
should be loaded. If appropriate configuration changes implies
|
||||||
``load_colorscheme`` and ``load_theme`` and recreation of renderer
|
``load_colorscheme`` and ``load_theme`` and recreation of renderer
|
||||||
object. Won’t trigger recreation if only unrelated configuration
|
object. Won’t trigger recreation if only unrelated configuration
|
||||||
changed.
|
changed.
|
||||||
:param bool load_colors:
|
:param bool load_colors:
|
||||||
Determines whether colors configuration from :file:`colors.json`
|
Determines whether colors configuration from :file:`colors.json`
|
||||||
should be (re)loaded.
|
should be (re)loaded.
|
||||||
:param bool load_colorscheme:
|
:param bool load_colorscheme:
|
||||||
Determines whether colorscheme configuration should be (re)loaded.
|
Determines whether colorscheme configuration should be (re)loaded.
|
||||||
@ -682,8 +682,8 @@ class Powerline(object):
|
|||||||
else:
|
else:
|
||||||
raise ImportError('Failed to obtain renderer')
|
raise ImportError('Failed to obtain renderer')
|
||||||
|
|
||||||
# Renderer updates configuration file via segments’ .startup thus it
|
# Renderer updates configuration file via segments’ .startup thus it
|
||||||
# should be locked to prevent state when configuration was updated,
|
# should be locked to prevent state when configuration was updated,
|
||||||
# but .render still uses old renderer.
|
# but .render still uses old renderer.
|
||||||
try:
|
try:
|
||||||
renderer = Renderer(**self.renderer_options)
|
renderer = Renderer(**self.renderer_options)
|
||||||
@ -697,8 +697,8 @@ class Powerline(object):
|
|||||||
default_log_stream = sys.stdout
|
default_log_stream = sys.stdout
|
||||||
'''Default stream for default log handler
|
'''Default stream for default log handler
|
||||||
|
|
||||||
Usually it is ``sys.stderr``, but there is sometimes a reason to prefer
|
Usually it is ``sys.stderr``, but there is sometimes a reason to prefer
|
||||||
``sys.stdout`` or a custom file-like object. It is not supposed to be used
|
``sys.stdout`` or a custom file-like object. It is not supposed to be used
|
||||||
to write to some file.
|
to write to some file.
|
||||||
'''
|
'''
|
||||||
|
|
||||||
@ -716,7 +716,7 @@ class Powerline(object):
|
|||||||
def get_config_paths():
|
def get_config_paths():
|
||||||
'''Get configuration paths.
|
'''Get configuration paths.
|
||||||
|
|
||||||
Should be overridden in subclasses in order to provide a way to override
|
Should be overridden in subclasses in order to provide a way to override
|
||||||
used paths.
|
used paths.
|
||||||
|
|
||||||
:return: list of paths
|
:return: list of paths
|
||||||
@ -727,10 +727,10 @@ class Powerline(object):
|
|||||||
'''Load configuration and setup watches
|
'''Load configuration and setup watches
|
||||||
|
|
||||||
:param str cfg_path:
|
:param str cfg_path:
|
||||||
Path to the configuration file without any powerline configuration
|
Path to the configuration file without any powerline configuration
|
||||||
directory or ``.json`` suffix.
|
directory or ``.json`` suffix.
|
||||||
:param str cfg_type:
|
:param str cfg_type:
|
||||||
Configuration type. May be one of ``main`` (for ``config.json``
|
Configuration type. May be one of ``main`` (for ``config.json``
|
||||||
file), ``colors``, ``colorscheme``, ``theme``.
|
file), ``colors``, ``colorscheme``, ``theme``.
|
||||||
|
|
||||||
:return: dictionary with loaded configuration.
|
:return: dictionary with loaded configuration.
|
||||||
@ -758,15 +758,15 @@ class Powerline(object):
|
|||||||
'''Load and merge multiple configuration files
|
'''Load and merge multiple configuration files
|
||||||
|
|
||||||
:param str cfg_type:
|
:param str cfg_type:
|
||||||
Type of the loaded configuration files (e.g. ``colorscheme``,
|
Type of the loaded configuration files (e.g. ``colorscheme``,
|
||||||
``theme``).
|
``theme``).
|
||||||
:param list levels:
|
:param list levels:
|
||||||
Configuration names resembling levels in hierarchy, sorted by
|
Configuration names resembling levels in hierarchy, sorted by
|
||||||
priority. Configuration file names with higher priority should go
|
priority. Configuration file names with higher priority should go
|
||||||
last.
|
last.
|
||||||
:param set ignore_levels:
|
:param set ignore_levels:
|
||||||
If only files listed in this variable are present then configuration
|
If only files listed in this variable are present then configuration
|
||||||
file is considered not loaded: at least one file on the level not
|
file is considered not loaded: at least one file on the level not
|
||||||
listed in this variable must be present.
|
listed in this variable must be present.
|
||||||
'''
|
'''
|
||||||
config = {}
|
config = {}
|
||||||
@ -832,16 +832,16 @@ class Powerline(object):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_local_themes(local_themes):
|
def get_local_themes(local_themes):
|
||||||
'''Get local themes. No-op here, to be overridden in subclasses if
|
'''Get local themes. No-op here, to be overridden in subclasses if
|
||||||
required.
|
required.
|
||||||
|
|
||||||
:param dict local_themes:
|
:param dict local_themes:
|
||||||
Usually accepts ``{matcher_name : theme_name}``. May also receive
|
Usually accepts ``{matcher_name : theme_name}``. May also receive
|
||||||
None in case there is no local_themes configuration.
|
None in case there is no local_themes configuration.
|
||||||
|
|
||||||
:return:
|
:return:
|
||||||
anything accepted by ``self.renderer.get_theme`` and processable by
|
anything accepted by ``self.renderer.get_theme`` and processable by
|
||||||
``self.renderer.add_local_theme``. Renderer module is determined by
|
``self.renderer.add_local_theme``. Renderer module is determined by
|
||||||
``__init__`` arguments, refer to its documentation.
|
``__init__`` arguments, refer to its documentation.
|
||||||
'''
|
'''
|
||||||
return None
|
return None
|
||||||
@ -869,7 +869,7 @@ class Powerline(object):
|
|||||||
self.cr_kwargs.clear()
|
self.cr_kwargs.clear()
|
||||||
|
|
||||||
def render(self, *args, **kwargs):
|
def render(self, *args, **kwargs):
|
||||||
'''Update/create renderer if needed and pass all arguments further to
|
'''Update/create renderer if needed and pass all arguments further to
|
||||||
``self.renderer.render()``.
|
``self.renderer.render()``.
|
||||||
'''
|
'''
|
||||||
try:
|
try:
|
||||||
@ -904,7 +904,7 @@ class Powerline(object):
|
|||||||
def setup(self, *args, **kwargs):
|
def setup(self, *args, **kwargs):
|
||||||
'''Setup the environment to use powerline.
|
'''Setup the environment to use powerline.
|
||||||
|
|
||||||
Must not be overridden by subclasses. This one only saves setup
|
Must not be overridden by subclasses. This one only saves setup
|
||||||
arguments for :py:meth:`reload` method and calls :py:meth:`do_setup`.
|
arguments for :py:meth:`reload` method and calls :py:meth:`do_setup`.
|
||||||
'''
|
'''
|
||||||
self.shutdown_event.clear()
|
self.shutdown_event.clear()
|
||||||
@ -916,7 +916,7 @@ class Powerline(object):
|
|||||||
def do_setup():
|
def do_setup():
|
||||||
'''Function that does initialization
|
'''Function that does initialization
|
||||||
|
|
||||||
Should be overridden by subclasses. May accept any number of regular or
|
Should be overridden by subclasses. May accept any number of regular or
|
||||||
keyword arguments.
|
keyword arguments.
|
||||||
'''
|
'''
|
||||||
pass
|
pass
|
||||||
@ -926,12 +926,12 @@ class Powerline(object):
|
|||||||
|
|
||||||
Should handle most (but not all) powerline updates.
|
Should handle most (but not all) powerline updates.
|
||||||
|
|
||||||
Purges out all powerline modules and modules imported by powerline for
|
Purges out all powerline modules and modules imported by powerline for
|
||||||
segment and matcher functions. Requires defining ``setup`` function that
|
segment and matcher functions. Requires defining ``setup`` function that
|
||||||
updates reference to main powerline object.
|
updates reference to main powerline object.
|
||||||
|
|
||||||
.. warning::
|
.. warning::
|
||||||
Not guaranteed to work properly, use it at your own risk. It
|
Not guaranteed to work properly, use it at your own risk. It
|
||||||
may break your python code.
|
may break your python code.
|
||||||
'''
|
'''
|
||||||
import sys
|
import sys
|
||||||
@ -939,7 +939,7 @@ class Powerline(object):
|
|||||||
modules_holder = []
|
modules_holder = []
|
||||||
for module in modules:
|
for module in modules:
|
||||||
try:
|
try:
|
||||||
# Needs to hold module to prevent garbage collecting until they
|
# Needs to hold module to prevent garbage collecting until they
|
||||||
# are all reloaded.
|
# are all reloaded.
|
||||||
modules_holder.append(sys.modules.pop(module))
|
modules_holder.append(sys.modules.pop(module))
|
||||||
except KeyError:
|
except KeyError:
|
||||||
@ -954,12 +954,12 @@ class Powerline(object):
|
|||||||
'''Shut down all background threads.
|
'''Shut down all background threads.
|
||||||
|
|
||||||
:param bool set_event:
|
:param bool set_event:
|
||||||
Set ``shutdown_event`` and call ``renderer.shutdown`` which should
|
Set ``shutdown_event`` and call ``renderer.shutdown`` which should
|
||||||
shut down all threads. Set it to False unless you are exiting an
|
shut down all threads. Set it to False unless you are exiting an
|
||||||
application.
|
application.
|
||||||
|
|
||||||
If set to False this does nothing more then resolving reference
|
If set to False this does nothing more then resolving reference
|
||||||
cycle ``powerline → config_loader → bound methods → powerline`` by
|
cycle ``powerline → config_loader → bound methods → powerline`` by
|
||||||
unsubscribing from config_loader events.
|
unsubscribing from config_loader events.
|
||||||
'''
|
'''
|
||||||
if set_event:
|
if set_event:
|
||||||
|
15
powerline/version.py
Normal file
15
powerline/version.py
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
# vim:fileencoding=utf-8:noet
|
||||||
|
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
||||||
|
|
||||||
|
import subprocess
|
||||||
|
from traceback import print_exc
|
||||||
|
|
||||||
|
__version__ = "2.8.1"
|
||||||
|
|
||||||
|
def get_version():
|
||||||
|
try:
|
||||||
|
return __version__ + '.dev9999+git.' + str(subprocess.check_output(['git', 'rev-parse', 'HEAD']).strip())
|
||||||
|
except Exception:
|
||||||
|
print_exc()
|
||||||
|
return __version__
|
||||||
|
|
14
setup.py
14
setup.py
@ -4,13 +4,12 @@ from __future__ import (unicode_literals, division, absolute_import, print_funct
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import subprocess
|
|
||||||
import logging
|
import logging
|
||||||
import shlex
|
import shlex
|
||||||
|
|
||||||
from traceback import print_exc
|
|
||||||
from setuptools import setup, find_packages
|
from setuptools import setup, find_packages
|
||||||
|
|
||||||
|
from powerline.version import get_version
|
||||||
|
|
||||||
CURRENT_DIR = os.path.abspath(os.path.dirname(__file__))
|
CURRENT_DIR = os.path.abspath(os.path.dirname(__file__))
|
||||||
try:
|
try:
|
||||||
@ -57,17 +56,6 @@ except Exception as e:
|
|||||||
else:
|
else:
|
||||||
can_use_scripts = False
|
can_use_scripts = False
|
||||||
|
|
||||||
|
|
||||||
def get_version():
|
|
||||||
base_version = '2.8'
|
|
||||||
base_version += '.dev9999'
|
|
||||||
try:
|
|
||||||
return base_version + '+git.' + str(subprocess.check_output(['git', 'rev-parse', 'HEAD']).strip())
|
|
||||||
except Exception:
|
|
||||||
print_exc()
|
|
||||||
return base_version
|
|
||||||
|
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name='powerline-status',
|
name='powerline-status',
|
||||||
version=get_version(),
|
version=get_version(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user