Package nukescripts :: Module openurl
[hide private]
[frames] | no frames]

Source Code for Module nukescripts.openurl

 1  # Copyright (c) 2009 The Foundry Visionmongers Ltd.  All Rights Reserved. 
 2   
 3  import nuke 
 4   
 5   
6 -def start(url):
7 '''Open a URL or file.''' 8 nuke.tcl('start', url)
9 10 11 #proc start {url} { 12 # if [catch {set command [getenv BROWSER]}] { 13 # global WIN32 14 # global MACOS 15 # if $WIN32 { 16 # set command "rundll32.exe url.dll,FileProtocolHandler" 17 # } elseif $MACOS { 18 # set command "/usr/bin/open" 19 # } else { 20 # global browser 21 # if [catch {set browser}] {set browser "firefox"} 22 # if [catch {set browser [get_input "\$BROWSER is not set.\nPlease type the name of your browser here.\nSome examples: firefox, konqueror, netscape, mozilla, opera" $browser]}] return 23 # set command $browser 24 # } 25 # setenv BROWSER $command 26 # } 27 # if [catch {eval [concat exec $command [list $url] &]} msg] { 28 # unsetenv BROWSER 29 # message "$msg\nSet the environment variable \$BROWSER to fix this" 30 # } 31 #} 32