From 9018b95f07313e4df571fa6959e2642db3914dc2 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Wed, 3 Aug 2016 22:12:03 +0300 Subject: [PATCH] browser-stack: adapt to Python 3 --- bin/browser-stack.py | 5 +++-- bin/browser_stack.py | 3 +-- 2 files changed, 4 insertions(+), 4 deletions(-) mode change 100755 => 100644 bin/browser_stack.py diff --git a/bin/browser-stack.py b/bin/browser-stack.py index cec4f7d..0deb390 100755 --- a/bin/browser-stack.py +++ b/bin/browser-stack.py @@ -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' diff --git a/bin/browser_stack.py b/bin/browser_stack.py old mode 100755 new mode 100644 index dda6e0a..94e6c60 --- a/bin/browser_stack.py +++ b/bin/browser_stack.py @@ -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) -- 2.39.2