This commit is contained in:
Shing Tak Lam 2018-02-13 22:21:31 +08:00
parent 87b176037f
commit 92cc6e9133
2 changed files with 20 additions and 0 deletions

3
.vscode/settings.json vendored Normal file
View file

@ -0,0 +1,3 @@
{
"python.pythonPath": "/usr/bin/python3"
}

View file

@ -0,0 +1,17 @@
import os
import subprocess
from ..utils import BasicSegment
class Segment(BasicSegment):
def add_to_powerline(self):
powerline = self.powerline
try:
p1 = subprocess.run(
["rustup", "toolchain", "list"], stdout=subprocess.PIPE)
v = p1.stdout.decode("utf-8")
for line in v:
if "(default)" in line:
powerline.append(line.split("-"), 15, 1)
except OSError:
return