Fixed to work in Pyton 3.2/3.3

master
Fernando López 12 years ago
parent b54437f917
commit 2d817c8866
  1. 4
      gitstatus.py

@ -64,7 +64,7 @@ staged = str(nb_staged)
conflicts = str(nb_U) conflicts = str(nb_U)
changed = str(nb_changed) changed = str(nb_changed)
status_lines = Popen(['git','status','-s','-uall'],stdout=PIPE).communicate()[0].splitlines() status_lines = Popen(['git','status','-s','-uall'],stdout=PIPE).communicate()[0].splitlines()
untracked_lines = [a for a in status_lines if a.startswith("??")] untracked_lines = [a for a in map(lambda s: s.decode('utf-8'), status_lines) if a.startswith("??")]
nb_untracked = len(untracked_lines) nb_untracked = len(untracked_lines)
untracked = str(nb_untracked) untracked = str(nb_untracked)
stashes = Popen(['git','stash','list'],stdout=PIPE).communicate()[0].splitlines() stashes = Popen(['git','stash','list'],stdout=PIPE).communicate()[0].splitlines()
@ -84,7 +84,7 @@ if not branch: # not on any branch
if tag: # if we are on a tag, print the tag's name if tag: # if we are on a tag, print the tag's name
branch = tag branch = tag
else: else:
branch = symbols['prehash']+ Popen(['git','rev-parse','--short','HEAD'], stdout=PIPE).communicate()[0][:-1] branch = symbols['prehash']+ Popen(['git','rev-parse','--short','HEAD'], stdout=PIPE).communicate()[0].decode('utf-8')[:-1]
else: else:
remote_name = Popen(['git','config','branch.%s.remote' % branch], stdout=PIPE).communicate()[0].strip() remote_name = Popen(['git','config','branch.%s.remote' % branch], stdout=PIPE).communicate()[0].strip()
if remote_name: if remote_name:

Loading…
Cancel
Save