Skip to content

Commit 5a54246

Browse files
committed
[segment] added kubecontext segment
[segment] added kubecontext segement [segment] added kubecontext segement [segment] added kubecontext segement
1 parent 03c8c64 commit 5a54246

File tree

9 files changed

+27
-104
lines changed

9 files changed

+27
-104
lines changed

Diff for: .gitignore

+4-86
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ tags
88
config.json
99
powerline-shell.json
1010
.DS_Store
11+
12+
# editors
1113
*sublime*
14+
.vscode/
15+
.idea/
1216

1317
# Byte-compiled / optimized / DLL files
1418
__pycache__/
@@ -38,16 +42,6 @@ share/python-wheels/
3842
*.egg
3943
MANIFEST
4044

41-
# PyInstaller
42-
# Usually these files are written by a python script from a template
43-
# before PyInstaller builds the exe, so as to inject date/other infos into it.
44-
*.manifest
45-
*.spec
46-
47-
# Installer logs
48-
pip-log.txt
49-
pip-delete-this-directory.txt
50-
5145
# Unit test / coverage reports
5246
htmlcov/
5347
.tox/
@@ -63,59 +57,6 @@ coverage.xml
6357
.pytest_cache/
6458
cover/
6559

66-
# Translations
67-
*.mo
68-
*.pot
69-
70-
# Django stuff:
71-
*.log
72-
local_settings.py
73-
db.sqlite3
74-
db.sqlite3-journal
75-
76-
# Flask stuff:
77-
instance/
78-
.webassets-cache
79-
80-
# Scrapy stuff:
81-
.scrapy
82-
83-
# Sphinx documentation
84-
docs/_build/
85-
86-
# PyBuilder
87-
.pybuilder/
88-
target/
89-
90-
# Jupyter Notebook
91-
.ipynb_checkpoints
92-
93-
# IPython
94-
profile_default/
95-
ipython_config.py
96-
97-
# pyenv
98-
# For a library or package, you might want to ignore these files since the code is
99-
# intended to run in multiple environments; otherwise, check them in:
100-
# .python-version
101-
102-
# pipenv
103-
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
104-
# However, in case of collaboration, if having platform-specific dependencies or dependencies
105-
# having no cross-platform support, pipenv may install dependencies that don't work, or not
106-
# install all needed dependencies.
107-
#Pipfile.lock
108-
109-
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
110-
__pypackages__/
111-
112-
# Celery stuff
113-
celerybeat-schedule
114-
celerybeat.pid
115-
116-
# SageMath parsed files
117-
*.sage.py
118-
11960
# Environments
12061
.env
12162
.venv
@@ -125,26 +66,3 @@ ENV/
12566
env.bak/
12667
venv.bak/
12768

128-
# Spyder project settings
129-
.spyderproject
130-
.spyproject
131-
132-
# Rope project settings
133-
.ropeproject
134-
135-
# mkdocs documentation
136-
/site
137-
138-
# mypy
139-
.mypy_cache/
140-
.dmypy.json
141-
dmypy.json
142-
143-
# Pyre type checker
144-
.pyre/
145-
146-
# pytype static type analyzer
147-
.pytype/
148-
149-
# Cython debug symbols
150-
cython_debug/

Diff for: powerline_shell/colortrans.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def rgbstring2tuple(s):
100100
(95, 135, 215): 68,
101101
(95, 135, 255): 69,
102102
(95, 175, 0): 70,
103-
(95, 175, 95) : 71,
103+
(95, 175, 95): 71,
104104
(95, 175, 135): 72,
105105
(95, 175, 175): 73,
106106
(95, 175, 215): 74,

Diff for: powerline_shell/segments/kubecontext.py renamed to powerline_shell/segments/kube_context.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@
88

99
class Segment(BasicSegment):
1010
def add_to_powerline(self):
11-
kubecontext = os.environ.get("KUBECONFIG")
12-
if kubecontext:
13-
self.powerline.append(" kctx:%s " % os.path.basename(kubecontext),
14-
self.powerline.theme.KUBECONFIG_FG,
15-
self.powerline.theme.KUBECONFIG_BG)
11+
kube_context = os.environ.get("KUBECONFIG")
12+
if kube_context:
13+
self.powerline.append(" kctx:%s " % os.path.basename(kube_context),
14+
self.powerline.theme.KUBE_CONTEXT_FG,
15+
self.powerline.theme.KUBE_CONTEXT_BG)
16+

Diff for: powerline_shell/themes/basic.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,6 @@ class Color(DefaultColor):
4444
TIME_FG = 8
4545
TIME_BG = 7
4646

47-
KUBECONFIG_FG = 14
48-
KUBECONFIG_BG = 8
47+
KUBE_CONTEXT_FG = 14
48+
KUBE_CONTEXT_BG = 8
49+

Diff for: powerline_shell/themes/default.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,9 @@ class DefaultColor(object):
7575
TIME_FG = 250
7676
TIME_BG = 238
7777

78-
KUBECONFIG_FG = 38
79-
KUBECONFIG_BG = 239
78+
KUBE_CONTEXT_FG = 38
79+
KUBE_CONTEXT_BG = 239
80+
8081

8182
class Color(DefaultColor):
8283
"""

Diff for: powerline_shell/themes/gruvbox.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -110,5 +110,6 @@ class Color(DefaultColor):
110110
TIME_FG = light2
111111
TIME_BG = dark4
112112

113-
KUBECONFIG_BG = neutral_blue
114-
KUBECONFIG_FG = dark2
113+
KUBE_CONTEXT_FG = neutral_blue
114+
KUBE_CONTEXT_BG = dark2
115+

Diff for: powerline_shell/themes/solarized_dark.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,6 @@ class Color(DefaultColor):
4343
TIME_FG = 15
4444
TIME_BG = 10
4545

46-
KUBECONFIG_FG = 7
47-
KUBECONFIG_BG = 2
46+
KUBE_CONTEXT_FG = 7
47+
KUBE_CONTEXT_BG = 2
48+

Diff for: powerline_shell/themes/washed.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,5 @@ class Color(DefaultColor):
4343
TIME_FG = 8
4444
TIME_BG = 7
4545

46-
KUBECONFIG_FG = 0
47-
KUBECONFIG_BG = 7
46+
KUBE_CONTEXT_FG = 0
47+
KUBE_CONTEXT_BG = 7

Diff for: setup.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from setuptools import setup, find_packages
33

44
setup(
5-
name="powerline-shell-test",
5+
name="powerline-shell",
66
version="0.7.0",
77
description="A pretty prompt for your shell",
88
author="Buck Ryan",
@@ -27,6 +27,6 @@
2727
],
2828
entry_points="""
2929
[console_scripts]
30-
powerline-shell-test=powerline_shell:main
30+
powerline-shell=powerline_shell:main
3131
""",
3232
)

0 commit comments

Comments
 (0)