4 browser_stack = os.path.expanduser('~/.config/browser-stack')
8 with open(browser_stack, 'rU') as stack_file:
9 return stack_file.readlines()
10 except IOError: # No such file
13 def save_stack(stack):
14 os.umask(0066) # octal -rw-------
15 with open(browser_stack+'.tmp', 'w') as stack_file:
16 stack_file.writelines(stack)
17 shutil.copy(browser_stack+'.tmp', browser_stack)
18 os.remove(browser_stack+'.tmp')
20 def set_current_browser():
23 os.environ['BROWSER'] = stack[0].strip()