1
0
nvim-config/pythonx/ultisnips/all.py
valeth d6fcdb2060 add ultisnips plugin
add snippets in UltiSnips
add python modules in pythonx/ultisnips
2016-04-21 21:18:46 +02:00

11 lines
341 B
Python

def getUsername(username, gecos = True, passwd = "/etc/passwd"):
content = [x.split(":") for x in open(passwd, "r").readlines()]
for entry in content:
if len(entry) != 0 and entry[0] == username:
if gecos and len(entry[4]) != 0:
return entry[4]
else:
return username