40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
+
-
+
-
-
+
+
-
-
-
+
+
+
+
|
#
# NOTE: Figure out the fully qualified path to the current script file.
# If necessary, add it to the auto-path for the interpreter. The
# necessary supporting packages (i.e. the Package Repository and
# other support packages) that are assumed to exist in the same
# directory as the current script file.
#
namespace eval ::PackageUploader {
variable pkgr_path; # DEFAULT: <unset>
variable pkgr_path; # DEFAULT: <unset>
if {![info exists pkgr_path]} then {
set pkgr_path [file normalize [file dirname [info script]]]
if {![info exists pkgr_path]} then {
set pkgr_path [file normalize [file dirname [info script]]]
if {![info exists ::auto_path] || \
[lsearch -exact $::auto_path $pkgr_path] == -1} then {
lappend ::auto_path $pkgr_path
if {![info exists ::auto_path] || \
[lsearch -exact $::auto_path $pkgr_path] == -1} then {
lappend ::auto_path $pkgr_path
}
}
}
#
# NOTE: *TODO* Pre-create the namespace for the Package Repository Client
# package and then forcibly adjust various settings to the values
# necessary for this tool. In the future, this section may need to
|
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
|
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
|
-
+
+
-
+
-
+
-
+
-
+
-
+
+
+
-
+
+
+
-
+
|
#
package require Eagle.Package.Uploader
#
# NOTE: Make sure this tool is being run from within the package client
# checkout directory.
#
verifyCheckoutDirectory
::PackageUploader::verifyCheckoutDirectory
#
# NOTE: Process the command line arguments into their corresponding data
# values, which are contained in an array.
#
::PackageUploader::setupArgumentData \
setupArgumentData [expr {[info exists ::argv] ? $::argv : [list]}]
[expr {[info exists ::argv] ? $::argv : [list]}]
#
# NOTE: Verify that the number of command line arguments meets the basic
# requirements of this tool.
#
if {[haveArgumentData]} then {
if {[::PackageUploader::haveArgumentData]} then {
#
# NOTE: All necessary arguments were supplied on the command line, use
# batch mode.
#
if {[isEagle]} then {
submitEventHandler true null null
::PackageUploader::submitEventHandler true null null
} else {
submitEventHandler true
::PackageUploader::submitEventHandler true
}
} else {
#
# NOTE: One or more of the necessary arguments were not supplied on the
# command line, use interactive mode. This will create a graphical
# user interface, using Tk or WinForms. If any of the necessary
# arguments were supplied on the command line, they will be used to
# populate those fields on the graphical user interface.
#
variable guiError
if {[isEagle]} then {
if {[catch {setupWinFormsUserInterface} guiError]} then {
if {[catch {
::PackageUploader::setupWinFormsUserInterface
} guiError]} then {
usage $guiError
}
} else {
if {[catch {setupTkUserInterface} guiError]} then {
if {[catch {
::PackageUploader::setupTkUserInterface
} guiError]} then {
usage $guiError
}
}
vwait [appendArgs [namespace current] ::forever]
vwait ::PackageUploader::forever
}
}
|