mirror of
https://github.com/b-ryan/powerline-shell.git
synced 2026-09-10 07:26:28 -04:00
17 lines
445 B
Python
17 lines
445 B
Python
import subprocess
|
|
from ..utils import BasicSegment
|
|
|
|
|
|
class Segment(BasicSegment):
|
|
def add_to_powerline(self):
|
|
powerline = self.powerline
|
|
|
|
try:
|
|
|
|
output = subprocess.check_output(['python', '--version'],
|
|
stderr=subprocess.STDOUT)
|
|
version = output.rstrip().split(' ')[1]
|
|
powerline.append(version, 15, 1)
|
|
except OSError:
|
|
return
|