import webbrowser
if sys.argv[1] in ("-t", "--tab"):
- new = 2
- try:
- url = sys.argv[2]
- except IndexError:
- url = ''
+ new = 2
+ try:
+ url = sys.argv[2]
+ except IndexError:
+ url = ''
elif sys.argv[1] in ("-n", "--new"):
- new = 1
- try:
- url = sys.argv[2]
- except IndexError:
- url = ''
+ new = 1
+ try:
+ url = sys.argv[2]
+ except IndexError:
+ url = ''
else:
- new = 0
- try:
- url = sys.argv[1]
- except IndexError:
- url = ''
+ new = 0
+ try:
+ url = sys.argv[1]
+ except IndexError:
+ url = ''
if url and '://' not in url: # Make an URL from a local file name
url = 'file://' + os.path.abspath(url)