aboutsummaryrefslogtreecommitdiff
path: root/pddp/pddpclient.tcl
diff options
context:
space:
mode:
authorN.N. <krzyszcz@users.sourceforge.net>2005-05-30 09:29:26 +0000
committerN.N. <krzyszcz@users.sourceforge.net>2005-05-30 09:29:26 +0000
commitaebe147ae46e27127faa5c9d777de6b9ab822cc9 (patch)
tree1885dbe1bd120a52b083679e89343c594128ed32 /pddp/pddpclient.tcl
parentb4eb41d8deb2db9fd5182e6858484edff33a4d96 (diff)
toxy alpha18 and pddp alpha2 (see notes.txt for toxy, pddp and shared)
svn path=/trunk/externals/miXed/; revision=3094
Diffstat (limited to 'pddp/pddpclient.tcl')
-rw-r--r--pddp/pddpclient.tcl82
1 files changed, 0 insertions, 82 deletions
diff --git a/pddp/pddpclient.tcl b/pddp/pddpclient.tcl
deleted file mode 100644
index 7633394..0000000
--- a/pddp/pddpclient.tcl
+++ /dev/null
@@ -1,82 +0,0 @@
-# pddpclient.tcl
-
-# Synopsis
-# not to be run by itself (see pddpboot.tcl)
-
-if {![namespace exists ::pddp]} {
- puts stderr "Error: invalid invocation of pddpclient (boot pddp first)"
- puts stderr "exiting..."
- exit 1
-}
-
-if {$::pddp::testrun} { ;# true if sourced from standalone "pddpboot.tcl"
- puts stderr "Loading pddpclient, test run..."
- if {$argc > 3} {
- set path [lindex $argv 3]
- if {[string length $path]} {
- puts stderr "Scheduling \"$path\" for opening"
- after idle ::pddp::cliOpen $path
- }
- unset path
- }
-} else {
- puts stderr "Loading pddpclient"
-}
-
-namespace eval ::pddp {
- variable theBrowserCommand
-
- switch -- $::tcl_platform(platform) {
- unix {
- switch -- $tcl_platform(os) {
- Darwin {
- set theBrowserCommand "sh -c open %s"
- }
- Linux {
- foreach candidate \
- {firefox mozilla galeon konqueror netscape lynx} {
- set browser [lindex [auto_execok $candidate] 0]
- if {[string length $browser]} {
- set theBrowserCommand "$browser %s &"
- break
- }
- }
- }
- }
- }
- windows {
- # should not this be just: [auto_execok start]?
- set theBrowserCommand \
- "rundll32 url.dll,FileProtocolHandler file:%s &"
- }
- }
-}
-
-proc ::pddp::cliError {err} {
- puts stderr "Error in pddpclient: $err"
-}
-
-proc ::pddp::cliOpen {path} {
- if {[string first "://" $path] < 1} {
- if {[info exists ::pddp::thePort]} {
- set path "http://localhost:$::pddp::thePort/$path"
- } else {
- cliError "pddpserver not running"
- return
- }
- }
- variable theBrowserCommand
- if {[string length $theBrowserCommand]} {
- set command [format $theBrowserCommand $path]
- puts stderr "pddpclient: open $command"
- if {[catch {eval [list exec] $command} err]} {
- if {[lindex $::errorCode 0] eq "CHILDSTATUS"} {
- cliError "$err (child status [lindex $::errorCode 2])"
- } else {
- cliError $err
- }
- }
- } else {
- cliError "browser unavailable"
- }
-}