33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
|
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
|
# Stop Tk from meddling with the command line by copying it first.
set ::eskil(argv) $::argv
set ::eskil(argc) $::argc
set ::argv {}
set ::argc 0
set ::eskil(debug) 0
# Version string is loaded from version.txt
set ::eskil(diffver) "Version Unknown"
set ::eskil(thisScript) [file join [pwd] [info script]]
set ::eskil(thisDir) [file dirname $::eskil(thisScript)]
namespace import tcl::mathop::+
namespace import tcl::mathop::-
namespace import tcl::mathop::*
namespace import tcl::mathop::/
# Do initalisations for needed packages and globals.
# This is not run until needed to speed up command line error reporting.
proc Init {} {
if {[info exists ::eskil(initHasRun)]} {
return
}
set ::eskil(initHasRun) 1
# Follow any link
set tmplink $::eskil(thisScript)
while {[file type $tmplink] eq "link"} {
set tmplink [file readlink $tmplink]
set tmplink [file normalize [file join $::eskil(thisDir) $tmplink]]
set ::eskil(thisDir) [file dirname $tmplink]
}
set libDir [file join $::eskil(thisDir) .. lib]
if {![file isdirectory $libDir]} {
# Try the local file from devel
set libDir [file join $::eskil(thisDir) .. eskil.vfs lib]
}
::tcl::tm::path add $libDir
package require Tk 8.6
catch {package require textSearch}
package require wcb
package require snit
package require tablelist_tile
package require psmenu
if {[catch {package require psballoon}]} {
# Add a dummy if it does not exist.
proc addBalloon {args} {}
} else {
namespace import -force psballoon::addBalloon
}
if {[file exists $::eskil(thisDir)/../version.txt]} {
set ch [open $::eskil(thisDir)/../version.txt]
set ::eskil(diffver) [string trim [read $ch 100]]
close $ch
}
|
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
|
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
}
}
# Global code is only run the first time to be able to reread source
if { ! [info exists ::eskil(gurkmeja)]} {
set ::eskil(gurkmeja) 1
set ::eskil(plugins) {}
# Version string is loaded from version.txt later
set ::eskil(diffver) "Version Unknown"
set ::eskil(thisScript) [file join [pwd] [info script]]
set ::eskil(thisDir) [file dirname $::eskil(thisScript)]
# Follow any link
set tmplink $::eskil(thisScript)
while {[file type $tmplink] eq "link"} {
set tmplink [file readlink $tmplink]
set tmplink [file normalize [file join $::eskil(thisDir) $tmplink]]
set ::eskil(thisDir) [file dirname $tmplink]
}
set libDir [file join $::eskil(thisDir) .. lib]
if {![file isdirectory $libDir]} {
# Try the local file from devel
set libDir [file join $::eskil(thisDir) .. eskil.vfs lib]
}
::tcl::tm::path add $libDir
package require pstools
namespace import -force pstools::*
getOptions
if { ! [info exists ::eskil_testsuite]} {
InitSourceEarly
parseCommandLine
}
}
|