[segment] added kubecontext segment

[segment] added kubecontext segement

[segment] added kubecontext segement

[segment] added kubecontext segement
This commit is contained in:
Sandjaie Ravi 2020-08-01 23:57:59 +02:00 committed by sandjaie
parent 03c8c6427a
commit 5a54246802
9 changed files with 27 additions and 104 deletions

90
.gitignore vendored
View file

@ -8,7 +8,11 @@ tags
config.json
powerline-shell.json
.DS_Store
# editors
*sublime*
.vscode/
.idea/
# Byte-compiled / optimized / DLL files
__pycache__/
@ -38,16 +42,6 @@ share/python-wheels/
*.egg
MANIFEST
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
@ -63,59 +57,6 @@ coverage.xml
.pytest_cache/
cover/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
.pybuilder/
target/
# Jupyter Notebook
.ipynb_checkpoints
# IPython
profile_default/
ipython_config.py
# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version
# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/
# Celery stuff
celerybeat-schedule
celerybeat.pid
# SageMath parsed files
*.sage.py
# Environments
.env
.venv
@ -125,26 +66,3 @@ ENV/
env.bak/
venv.bak/
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# mypy
.mypy_cache/
.dmypy.json
dmypy.json
# Pyre type checker
.pyre/
# pytype static type analyzer
.pytype/
# Cython debug symbols
cython_debug/

View file

@ -100,7 +100,7 @@ RGB2SHORT_DICT = {
(95, 135, 215): 68,
(95, 135, 255): 69,
(95, 175, 0): 70,
(95, 175, 95) : 71,
(95, 175, 95): 71,
(95, 175, 135): 72,
(95, 175, 175): 73,
(95, 175, 215): 74,

View file

@ -8,8 +8,9 @@ import os
class Segment(BasicSegment):
def add_to_powerline(self):
kubecontext = os.environ.get("KUBECONFIG")
if kubecontext:
self.powerline.append(" kctx:%s " % os.path.basename(kubecontext),
self.powerline.theme.KUBECONFIG_FG,
self.powerline.theme.KUBECONFIG_BG)
kube_context = os.environ.get("KUBECONFIG")
if kube_context:
self.powerline.append(" kctx:%s " % os.path.basename(kube_context),
self.powerline.theme.KUBE_CONTEXT_FG,
self.powerline.theme.KUBE_CONTEXT_BG)

View file

@ -44,5 +44,6 @@ class Color(DefaultColor):
TIME_FG = 8
TIME_BG = 7
KUBECONFIG_FG = 14
KUBECONFIG_BG = 8
KUBE_CONTEXT_FG = 14
KUBE_CONTEXT_BG = 8

View file

@ -75,8 +75,9 @@ class DefaultColor(object):
TIME_FG = 250
TIME_BG = 238
KUBECONFIG_FG = 38
KUBECONFIG_BG = 239
KUBE_CONTEXT_FG = 38
KUBE_CONTEXT_BG = 239
class Color(DefaultColor):
"""

View file

@ -110,5 +110,6 @@ class Color(DefaultColor):
TIME_FG = light2
TIME_BG = dark4
KUBECONFIG_BG = neutral_blue
KUBECONFIG_FG = dark2
KUBE_CONTEXT_FG = neutral_blue
KUBE_CONTEXT_BG = dark2

View file

@ -43,5 +43,6 @@ class Color(DefaultColor):
TIME_FG = 15
TIME_BG = 10
KUBECONFIG_FG = 7
KUBECONFIG_BG = 2
KUBE_CONTEXT_FG = 7
KUBE_CONTEXT_BG = 2

View file

@ -43,5 +43,5 @@ class Color(DefaultColor):
TIME_FG = 8
TIME_BG = 7
KUBECONFIG_FG = 0
KUBECONFIG_BG = 7
KUBE_CONTEXT_FG = 0
KUBE_CONTEXT_BG = 7

View file

@ -2,7 +2,7 @@
from setuptools import setup, find_packages
setup(
name="powerline-shell-test",
name="powerline-shell",
version="0.7.0",
description="A pretty prompt for your shell",
author="Buck Ryan",
@ -27,6 +27,6 @@ setup(
],
entry_points="""
[console_scripts]
powerline-shell-test=powerline_shell:main
powerline-shell=powerline_shell:main
""",
)