Ensure py2/3 compatibiliy
This commit is contained in:
parent
f05fc4aab9
commit
518177dd01
2 changed files with 7 additions and 3 deletions
|
@ -1,5 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
import socket
|
||||
|
||||
hostname = socket.gethostname().split('.')[0]
|
||||
|
@ -9,4 +11,4 @@ for c in hostname:
|
|||
s = s + ord(c)
|
||||
|
||||
color = str(1 + s % 14).rjust(3, '0')
|
||||
print '$FG[{}]'.format(color)
|
||||
print('$FG[{}]'.format(color))
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
# Usage: git setmail
|
||||
#
|
||||
# Configuration format:
|
||||
|
@ -19,13 +21,13 @@ def main():
|
|||
try:
|
||||
repo = [x.split()[1] for x in subprocess.check_output(['git', 'remote', '-v']).split('\n') if re.match('origin.*\(push\)', x)][0]
|
||||
except:
|
||||
print 'Could not find origin, not setting email.'
|
||||
print('Could not find origin, not setting email.')
|
||||
return 0
|
||||
|
||||
if os.path.isfile(CONFIG):
|
||||
combinations = json.loads(open(CONFIG).read())
|
||||
else:
|
||||
print 'Config ({}) found.'.format(CONFIG)
|
||||
print('Config ({}) found.'.format(CONFIG))
|
||||
return 1
|
||||
|
||||
for combi in combinations:
|
||||
|
|
Loading…
Reference in a new issue