]> git.phdru.name Git - dotfiles.git/commitdiff
browser-stack: adapt to Python 3
authorOleg Broytman <phd@phdru.name>
Wed, 3 Aug 2016 19:12:03 +0000 (22:12 +0300)
committerOleg Broytman <phd@phdru.name>
Wed, 3 Aug 2016 19:12:03 +0000 (22:12 +0300)
bin/browser-stack.py
bin/browser_stack.py [changed mode: 0755->0644]

index cec4f7da43a165d191c4cc0e2e66a084442a9480..0deb3900ccca36acadd3df6ae035062b9420b0b7 100755 (executable)
@@ -1,5 +1,6 @@
 #! /usr/bin/env python
 
+from __future__ import print_function
 import sys, os
 from browser_stack import get_stack, save_stack
 
@@ -10,10 +11,10 @@ if command.startswith('--'):
 stack = get_stack()
 
 if command in ('get', 'peek', 'print'):
-    if stack: print stack[0],
+    if stack: print(stack[0], end='')
     sys.exit()
 elif command in ('list', 'list-all'):
-    if stack: print ''.join(stack),
+    if stack: print(''.join(stack), end='')
     sys.exit()
 
 browser = os.path.basename(sys.argv[2]) + '\n'
old mode 100755 (executable)
new mode 100644 (file)
index dda6e0a..94e6c60
@@ -1,4 +1,3 @@
-#! /usr/bin/env python
 
 import os, shutil
 browser_stack = os.path.expanduser('~/.cache/browser-stack')
@@ -11,7 +10,7 @@ def get_stack():
         return []
 
 def save_stack(stack):
-    os.umask(0066) # octal -rw-------
+    os.umask(0o066) # octal -rw-------
     with open(browser_stack+'.tmp', 'w') as stack_file:
         stack_file.writelines(stack)
     shutil.copy(browser_stack+'.tmp', browser_stack)