pyvguicom 1.3.0__tar.gz → 1.3.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of pyvguicom might be problematic. Click here for more details.

Files changed (51) hide show
  1. {pyvguicom-1.3.0 → pyvguicom-1.3.3}/PKG-INFO +1 -1
  2. pyvguicom-1.3.3/pyvguicom/comline.py +372 -0
  3. {pyvguicom-1.3.0 → pyvguicom-1.3.3}/pyvguicom/pggui.py +1 -1
  4. {pyvguicom-1.3.0 → pyvguicom-1.3.3}/pyvguicom/pgsimp.py +4 -2
  5. {pyvguicom-1.3.0 → pyvguicom-1.3.3}/pyvguicom/pgutils.py +9 -54
  6. pyvguicom-1.3.3/pyvguicom/testcline.py +62 -0
  7. {pyvguicom-1.3.0 → pyvguicom-1.3.3}/pyvguicom/testsimple.py +9 -4
  8. {pyvguicom-1.3.0 → pyvguicom-1.3.3}/pyvguicom.egg-info/PKG-INFO +1 -1
  9. {pyvguicom-1.3.0 → pyvguicom-1.3.3}/pyvguicom.egg-info/SOURCES.txt +2 -0
  10. {pyvguicom-1.3.0 → pyvguicom-1.3.3}/README.md +0 -0
  11. {pyvguicom-1.3.0 → pyvguicom-1.3.3}/pyvguicom/__init__.py +0 -0
  12. {pyvguicom-1.3.0 → pyvguicom-1.3.3}/pyvguicom/browsewin.py +0 -0
  13. {pyvguicom-1.3.0 → pyvguicom-1.3.3}/pyvguicom/custwidg.py +0 -0
  14. {pyvguicom-1.3.0 → pyvguicom-1.3.3}/pyvguicom/docs/__index__.py +0 -0
  15. {pyvguicom-1.3.0 → pyvguicom-1.3.3}/pyvguicom/docs/browsewin.html +0 -0
  16. {pyvguicom-1.3.0 → pyvguicom-1.3.3}/pyvguicom/docs/htmledit.html +0 -0
  17. {pyvguicom-1.3.0 → pyvguicom-1.3.3}/pyvguicom/docs/pgbox.html +0 -0
  18. {pyvguicom-1.3.0 → pyvguicom-1.3.3}/pyvguicom/docs/pgbutt.html +0 -0
  19. {pyvguicom-1.3.0 → pyvguicom-1.3.3}/pyvguicom/docs/pgentry.html +0 -0
  20. {pyvguicom-1.3.0 → pyvguicom-1.3.3}/pyvguicom/docs/pggui.html +0 -0
  21. {pyvguicom-1.3.0 → pyvguicom-1.3.3}/pyvguicom/docs/pgsel.html +0 -0
  22. {pyvguicom-1.3.0 → pyvguicom-1.3.3}/pyvguicom/docs/pgsimp.html +0 -0
  23. {pyvguicom-1.3.0 → pyvguicom-1.3.3}/pyvguicom/docs/pgtextview.html +0 -0
  24. {pyvguicom-1.3.0 → pyvguicom-1.3.3}/pyvguicom/docs/pgutils.html +0 -0
  25. {pyvguicom-1.3.0 → pyvguicom-1.3.3}/pyvguicom/docs/pgwkit.html +0 -0
  26. {pyvguicom-1.3.0 → pyvguicom-1.3.3}/pyvguicom/docs/sutil.html +0 -0
  27. {pyvguicom-1.3.0 → pyvguicom-1.3.3}/pyvguicom/htmledit.py +0 -0
  28. {pyvguicom-1.3.0 → pyvguicom-1.3.3}/pyvguicom/pgbox.py +0 -0
  29. {pyvguicom-1.3.0 → pyvguicom-1.3.3}/pyvguicom/pgbutt.py +0 -0
  30. {pyvguicom-1.3.0 → pyvguicom-1.3.3}/pyvguicom/pgentry.py +0 -0
  31. {pyvguicom-1.3.0 → pyvguicom-1.3.3}/pyvguicom/pgsel.py +0 -0
  32. {pyvguicom-1.3.0 → pyvguicom-1.3.3}/pyvguicom/pgtests.py +0 -0
  33. {pyvguicom-1.3.0 → pyvguicom-1.3.3}/pyvguicom/pgtextview.py +0 -0
  34. {pyvguicom-1.3.0 → pyvguicom-1.3.3}/pyvguicom/pgwkit.py +0 -0
  35. {pyvguicom-1.3.0 → pyvguicom-1.3.3}/pyvguicom/plug.py +0 -0
  36. {pyvguicom-1.3.0 → pyvguicom-1.3.3}/pyvguicom/testbutt.py +0 -0
  37. {pyvguicom-1.3.0 → pyvguicom-1.3.3}/pyvguicom/testcust.py +0 -0
  38. {pyvguicom-1.3.0 → pyvguicom-1.3.3}/pyvguicom/testentry.py +0 -0
  39. {pyvguicom-1.3.0 → pyvguicom-1.3.3}/pyvguicom/testgui.py +0 -0
  40. {pyvguicom-1.3.0 → pyvguicom-1.3.3}/pyvguicom/testicons.py +0 -0
  41. {pyvguicom-1.3.0 → pyvguicom-1.3.3}/pyvguicom/testlettsel.py +0 -0
  42. {pyvguicom-1.3.0 → pyvguicom-1.3.3}/pyvguicom/testmsgs.py +0 -0
  43. {pyvguicom-1.3.0 → pyvguicom-1.3.3}/pyvguicom/testnums.py +0 -0
  44. {pyvguicom-1.3.0 → pyvguicom-1.3.3}/pyvguicom/testroot.py +0 -0
  45. {pyvguicom-1.3.0 → pyvguicom-1.3.3}/pyvguicom/testtests.py +0 -0
  46. {pyvguicom-1.3.0 → pyvguicom-1.3.3}/pyvguicom/testtextv.py +0 -0
  47. {pyvguicom-1.3.0 → pyvguicom-1.3.3}/pyvguicom/testutils.py +0 -0
  48. {pyvguicom-1.3.0 → pyvguicom-1.3.3}/pyvguicom.egg-info/dependency_links.txt +0 -0
  49. {pyvguicom-1.3.0 → pyvguicom-1.3.3}/pyvguicom.egg-info/top_level.txt +0 -0
  50. {pyvguicom-1.3.0 → pyvguicom-1.3.3}/setup.cfg +0 -0
  51. {pyvguicom-1.3.0 → pyvguicom-1.3.3}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyvguicom
3
- Version: 1.3.0
3
+ Version: 1.3.3
4
4
  Summary: High power secure server GUI utility helpers.
5
5
  Home-page: https://github.com/pglen/pyguicom.git
6
6
  Author: Peter Glen
@@ -0,0 +1,372 @@
1
+ #!/usr/bin/env python
2
+
3
+ import os, sys, string, time, traceback, getopt
4
+ import random, glob, warnings
5
+
6
+ VERSION = 1.0
7
+
8
+ #warnings.simplefilter("ignore")
9
+ #warnings.simplefilter("default")
10
+ #warnings.simplefilter("always")
11
+
12
+ # ------------------------------------------------------------------------
13
+
14
+ glargs = "" ; glhead = ""; glfoot = ""
15
+
16
+ glprog = os.path.basename(sys.argv[0])
17
+ gloptarr = []
18
+ glsoptarr = []
19
+
20
+ def pversion(ver):
21
+
22
+ print(os.path.basename(sys.argv[0]) + ":", "Version", ver)
23
+
24
+ #if sys.stdout.isatty():
25
+ # sys.exit(0)
26
+
27
+ def setargs(args):
28
+ global glargs
29
+ glargs = args
30
+
31
+ def setfoot(args):
32
+ global glfoot
33
+ glfoot = args
34
+
35
+ def sethead(args):
36
+ global glhead
37
+ glhead = args
38
+
39
+ def setprog(args):
40
+ global glprog
41
+ glprog = args
42
+
43
+ # ------------------------------------------------------------------------
44
+
45
+ def dupoptcheck(optarr):
46
+ optdup = {}
47
+ for bb in range(len(optarr)):
48
+ kkk = optarr[bb][0][0]
49
+ try:
50
+ optdup[kkk] += 1
51
+ except KeyError:
52
+ optdup[kkk] = 1
53
+ except:
54
+ print(sys.exc_info())
55
+ #print(optdup)
56
+ found = False
57
+ for cc in optdup.keys():
58
+ if optdup[cc] > 1:
59
+ #print("found dup", cc)
60
+ found = cc
61
+ return found
62
+
63
+ def phelp():
64
+
65
+ if glhead:
66
+ print("head", glhead)
67
+ print( "Usage: " + os.path.basename(sys.argv[0]), "[options]", glargs)
68
+ print( "options:")
69
+
70
+ for aa in optarr:
71
+ pad = " " * (9 - len(aa[1]))
72
+ print(" ", "-" + aa[0][0], " ", aa[1], pad, " - ", aa[4])
73
+
74
+ print()
75
+ if glfoot:
76
+ print("s", glfoot)
77
+
78
+ if sys.stdout.isatty():
79
+ sys.exit(0)
80
+
81
+ # ------------------------------------------------------------------------
82
+ # option [:], var_name, initial_val, function, helpstr
83
+ # Add colon ':' to option with argument.
84
+
85
+ optarr = [\
86
+ ["d:", "pgdebug", 0, None, "Debug level 0-10" ], \
87
+ ["p:", "port", 6666, None, "Listen on port"], \
88
+ ["v", "verbose", 0, None, "Verbose. . More info on screen."], \
89
+ ["q", "quiet", 0, None, "Quiet. Less info on screen."], \
90
+ ["V", "version", None, pversion, "Print Version."], \
91
+ ["h", "help", None, phelp, "Show Help. (this screen)"] \
92
+ ]
93
+
94
+ # ------------------------------------------------------------------------
95
+ # Handle command line. Interpret optarray and decorate the class
96
+ # This allows a lot of sub utils to have a common set of options.
97
+
98
+ class Config:
99
+
100
+ #warnings.warn("Config Class obsolete, use ConfigLong", DeprecationWarning)
101
+
102
+ def __init__(self, optarr):
103
+
104
+
105
+ ddd = dupoptcheck(optarr)
106
+ if ddd:
107
+ raise ValueError("Duplicate options on comline.", ddd)
108
+
109
+ global glsoptarr
110
+ glsoptarr = optarr
111
+
112
+ self.optarr = optarr
113
+ self.verbose = False
114
+ self.debug = False
115
+ self.sess_key = ""
116
+
117
+ def comline(self, argv):
118
+ #warnings.warn("Config Class obsolete, use ConfigLong")
119
+
120
+ optletters = ""
121
+ for aa in self.optarr:
122
+ optletters += aa[0]
123
+ #print( optletters )
124
+ # Create defaults:
125
+ err = 0
126
+ for bb in range(len(self.optarr)):
127
+ if self.optarr[bb][1]:
128
+ # Coerse type
129
+ if type(self.optarr[bb][2]) == type(0):
130
+ self.__dict__[self.optarr[bb][1]] = int(self.optarr[bb][2])
131
+ if type(self.optarr[bb][2]) == type(.0):
132
+ self.__dict__[self.optarr[bb][1]] = float(self.optarr[bb][2])
133
+ if type(self.optarr[bb][2]) == type(""):
134
+ self.__dict__[self.optarr[bb][1]] = str(self.optarr[bb][2])
135
+ try:
136
+ opts, args = getopt.getopt(argv, optletters)
137
+ except getopt.GetoptError as err:
138
+ print( "Invalid option(s) on command line:", err)
139
+ raise
140
+ return ()
141
+ except:
142
+ print(sys.exc_info())
143
+
144
+ #print( "opts", opts, "args", args)
145
+ for aa in opts:
146
+ for bb in range(len(self.optarr)):
147
+ if aa[0][1] == self.optarr[bb][0][0]:
148
+ #print( "match", aa, self.optarr[bb])
149
+ if len(self.optarr[bb][0]) > 1:
150
+ #print( "arg", self.optarr[bb][1], aa[1])
151
+ if self.optarr[bb][2] != None:
152
+ if type(self.optarr[bb][2]) == type(0):
153
+ self.__dict__[self.optarr[bb][1]] = int(aa[1])
154
+ if type(self.optarr[bb][2]) == type(.0):
155
+ self.__dict__[self.optarr[bb][1]] = float(aa[1])
156
+ if type(self.optarr[bb][2]) == type(""):
157
+ self.__dict__[self.optarr[bb][1]] = str(aa[1])
158
+ else:
159
+ #print( "set", self.optarr[bb][1], self.optarr[bb][2])
160
+ if self.optarr[bb][2] != None:
161
+ self.__dict__[self.optarr[bb][1]] = 1
162
+ #print( "call", self.optarr[bb][3])
163
+ if self.optarr[bb][3] != None:
164
+ self.optarr[bb][3]()
165
+ return args
166
+
167
+ # ------------------------------------------------------------------------
168
+ # Long form help
169
+
170
+ def phelplong():
171
+
172
+ if glhead:
173
+ print(glhead)
174
+
175
+ print( "Usage:", glprog, glargs)
176
+ print( " options:")
177
+ try:
178
+ for aa in gloptarr:
179
+ longop = aa[1].replace("=", "")
180
+ if "=" in aa[1]:
181
+ arg = aa[2]
182
+ else:
183
+ arg = " "
184
+
185
+ pad = " " * (8 - len(longop))
186
+ pad2 = " " * (8 - len(arg))
187
+
188
+ print(" ", "-" + aa[0][0], " ",
189
+ "--" + longop, pad, arg, pad2,"- ", aa[5])
190
+ if glfoot:
191
+ print(glfoot)
192
+ except:
193
+ pass
194
+
195
+ # Sat 11.May.2024 only exit if real stdout
196
+ if sys.stdout.isatty():
197
+ sys.exit(0)
198
+
199
+ # ------------------------------------------------------------------------
200
+ # Handle command line. Interpret optarray and decorate the class;
201
+ # Uses UNIX getopt for compatibility;
202
+ #
203
+ # Option parameters:
204
+ #
205
+ # option, long_option, var_name, initial_value, function
206
+ #
207
+ # Option with parameters: add trailing colon (:)
208
+ # Long opt with parameters: add training equal sign (=)
209
+ #
210
+ # Example:
211
+ #
212
+ #optarrlong = [\
213
+ # ["d:", "debug=", "pgdebug", 0, None], \
214
+ # ["p:", "port", "port", 9999, None], \
215
+ # ["v", "verbose", "verbose", 0, None], \
216
+ # ["t", "test", "test", "x", None], \
217
+ # ["V", "version", None, None, pversion], \
218
+ # ["h", "help", None, None, phelp], \
219
+ # ["i:", "input=", "input", "-", None], \
220
+ # ]
221
+
222
+ # option [:], long_option[=], var_name, initial_value, function, helpstr
223
+ optarrlong = [\
224
+ ["d:", "debug=", "pgdebug", 0, None, "Debug level. 0=none 10=noisy. Default: 0" ],
225
+ ["p:", "port=", "port", 6666, None, "Listen on port. Default: 6666"],
226
+ ["v", "verbose", "verbose", 0, None, "Verbose. Show more info."],
227
+ ["q", "quiet", "quiet", 0, None, "Quiet. Show less info."],
228
+ ["V", "version", "version", None, pversion, "Print Version string."],
229
+ ["h", "help", "help", None, phelplong, "Show Help. (this screen)"]
230
+ ]
231
+
232
+ class ConfigLong:
233
+
234
+ def __init__(self, optarr):
235
+
236
+ ddd = dupoptcheck(optarr)
237
+ if ddd:
238
+ raise ValueError("Duplicate options on comline.", ddd)
239
+
240
+ global gloptarr
241
+ gloptarr = optarr
242
+ self._optarr = optarr
243
+ self.err = None
244
+
245
+ # Create defaults:
246
+ for bb in range(len(self._optarr)):
247
+ if self._optarr[bb][2]:
248
+ #print("init", self._optarr[bb][2],
249
+ # self._optarr[bb][3], type(self._optarr[bb][3]))
250
+ # Coerse type
251
+ if self._optarr[bb][3] == None:
252
+ self.__dict__[self._optarr[bb][2]] = None
253
+ elif type(self._optarr[bb][3]) == type(0):
254
+ self.__dict__[self._optarr[bb][2]] = int(self._optarr[bb][3])
255
+ elif type(self._optarr[bb][3]) == type(0.):
256
+ self.__dict__[self._optarr[bb][2]] = float(self._optarr[bb][3])
257
+ elif type(self._optarr[bb][3]) == type(""):
258
+ self.__dict__[self._optarr[bb][2]] = str(self._optarr[bb][3])
259
+ else:
260
+ print("Can only have int and str type; not", type(self._optarr[bb][3]))
261
+ raise ValueError("Can only None, int, float and string type - not %s" \
262
+ % (type(self._optarr[bb][3])))
263
+
264
+ def printvars(self):
265
+ print("Variables -----")
266
+ for aa in dir(self):
267
+ try:
268
+ if aa[:2] == "__" :
269
+ continue
270
+ if aa != "_optarr" and aa != "comline" and \
271
+ aa != "printvars" :
272
+ ff = getattr(self, aa)
273
+ if type(ff) == type(self.printvars):
274
+ fff = "function"
275
+ else:
276
+ fff = type(ff)
277
+ print(aa, ff, fff)
278
+ except:
279
+ pass
280
+ print("End Variables -----")
281
+
282
+ def comline(self, argv, pgdebug = 0):
283
+
284
+ ''' Parse what is comong from the command line '''
285
+
286
+ optletters = ""; longopt = []
287
+ for aa in self._optarr:
288
+ if aa[0] in optletters:
289
+ print ("Warning: duplicate option", "'" + aa[0] + "'")
290
+ #if len(aa[0]) > 1 and aa[0][1] != ':':
291
+ optletters += aa[0]
292
+ longopt.append(aa[1])
293
+
294
+ #print("optleters", optletters, "longopt", longopt)
295
+
296
+ try:
297
+ opts, args = getopt.getopt(argv, optletters, longopt)
298
+ #except getopt.GetoptError, err:
299
+ except getopt.GetoptError as err:
300
+ print("Invalid option(s) on command line: %s" % err)
301
+ raise
302
+
303
+ if pgdebug:
304
+ print ("opts", opts, "args", args)
305
+ for aa in opts:
306
+ for bb in range(len(self._optarr)):
307
+ ddd = None
308
+ if aa[0][1] == "-":
309
+ ddd = "--" + self._optarr[bb][0]
310
+ eee = "--" + self._optarr[bb][1]
311
+ elif aa[0][0] == "-":
312
+ ddd = "-" + self._optarr[bb][0]
313
+ eee = "-" + self._optarr[bb][1]
314
+ else:
315
+ ddd = self._optarr[bb]
316
+
317
+ if ddd[-1:] == "=":
318
+ ddd = ddd[:-1]
319
+ eee = eee[:-1]
320
+ if ddd[-1:] == ":":
321
+ ddd = ddd[:-1]
322
+ eee = eee[:-1]
323
+
324
+ if pgdebug:
325
+ print ("aa", aa, "bb", bb, "one opt =", self._optarr[bb][:-1], ddd, eee)
326
+ if aa[0] == ddd or aa[0] == eee:
327
+ #print ("match", aa, ddd)
328
+ if len(self._optarr[bb][0]) > 1:
329
+ if pgdebug:
330
+ print ("arg", self._optarr[bb][2], self._optarr[bb][3], aa)
331
+ if self._optarr[bb][3] != None:
332
+ if type(self._optarr[bb][3]) == type(0):
333
+ if aa[1][:2] == "0x" or aa[1][:2] == "0X":
334
+ self.__dict__[self._optarr[bb][2]] = int(aa[1][2:], 16)
335
+ else:
336
+ self.__dict__[self._optarr[bb][2]] = int(aa[1])
337
+ pass
338
+
339
+ elif type(self._optarr[bb][2]) == type(""):
340
+ self.__dict__[self._optarr[bb][2]] = str(aa[1])
341
+ else:
342
+ if pgdebug:
343
+ print ("set 1",
344
+ self._optarr[bb][1], "set 2", self._optarr[bb][2],
345
+ "set 3", self._optarr[bb][3])
346
+ if self._optarr[bb][3] != None:
347
+ self.__dict__[self._optarr[bb][2]] += 1
348
+ #print ("call", self.optarr[bb][3])
349
+ if self._optarr[bb][4] != None:
350
+ self._optarr[bb][4]()
351
+ return args
352
+
353
+ # ------------------------------------------------------------------------
354
+ # Print an exception as the system would print it
355
+
356
+ def print_exception(xstr):
357
+ cumm = xstr + " "
358
+ a,b,c = sys.exc_info()
359
+ if a != None:
360
+ cumm += str(a) + " " + str(b) + "\n"
361
+ try:
362
+ #cumm += str(traceback.format_tb(c, 10))
363
+ ttt = traceback.extract_tb(c)
364
+ for aa in ttt:
365
+ cumm += "File: " + os.path.basename(aa[0]) + \
366
+ " Line: " + str(aa[1]) + "\n" + \
367
+ " Context: " + aa[2] + " -> " + aa[3] + "\n"
368
+ except:
369
+ print ("Could not print trace stack. ", sys.exc_info())
370
+ print (cumm)
371
+
372
+ # EOF
@@ -24,7 +24,7 @@ import pgsimp
24
24
 
25
25
  IDXERR = "Index is larger than the available number of controls."
26
26
 
27
- VERSION = "1.3.0"
27
+ VERSION = "1.3.3"
28
28
 
29
29
  gui_testmode = 0
30
30
 
@@ -106,14 +106,16 @@ class SimpleTree(Gtk.TreeView):
106
106
  def setActcallb(self, callb):
107
107
  self.actcallb = callb
108
108
 
109
- def append(self, args):
109
+ def append(self, args, parent = None):
110
110
  #print("append", args)
111
- piter = self.treestore.append(None, args)
111
+ piter = self.treestore.append(parent, args)
112
+ return piter
112
113
 
113
114
  # TreeStore
114
115
  def insert(self, parent, pos, args):
115
116
  print("insert", parent, pos, args)
116
117
  piter = self.treestore.insert(parent, pos, args)
118
+ return piter
117
119
 
118
120
  def sel_first(self):
119
121
  #print("sel first ...")
@@ -608,60 +608,6 @@ def readfile(strx, sep = None):
608
608
 
609
609
  return text
610
610
 
611
- # ------------------------------------------------------------------------
612
- # Handle command line. Interpret optarray and decorate the class
613
- # This allows a lot of sub utils to have a common set of options.
614
-
615
- class Config:
616
-
617
- def __init__(self, optarr):
618
- self.optarr = optarr
619
- self.verbose = False
620
- self.debug = False
621
-
622
- def comline(self, argv):
623
- optletters = ""
624
- for aa in self.optarr:
625
- optletters += aa[0]
626
- #print( optletters )
627
- # Create defaults:
628
- err = 0
629
- for bb in range(len(self.optarr)):
630
- if self.optarr[bb][1]:
631
- # Coerse type
632
- if type(self.optarr[bb][2]) == type(0):
633
- self.__dict__[self.optarr[bb][1]] = int(self.optarr[bb][2])
634
- if type(self.optarr[bb][2]) == type(""):
635
- self.__dict__[self.optarr[bb][1]] = str(self.optarr[bb][2])
636
- try:
637
- opts, args = getopt.getopt(argv, optletters)
638
- #except getopt.GetoptError, err:
639
- except:
640
- print( "Invalid option(s) on command line:", err)
641
- #support.put_exception("comline")
642
- return ()
643
-
644
- #print( "opts", opts, "args", args)
645
- for aa in opts:
646
- for bb in range(len(self.optarr)):
647
- if aa[0][1] == self.optarr[bb][0][0]:
648
- #print( "match", aa, self.optarr[bb])
649
- if len(self.optarr[bb][0]) > 1:
650
- #print( "arg", self.optarr[bb][1], aa[1])
651
- if self.optarr[bb][2] != None:
652
- if type(self.optarr[bb][2]) == type(0):
653
- self.__dict__[self.optarr[bb][1]] = int(aa[1])
654
- if type(self.optarr[bb][2]) == type(""):
655
- self.__dict__[self.optarr[bb][1]] = str(aa[1])
656
- else:
657
- #print( "set", self.optarr[bb][1], self.optarr[bb][2])
658
- if self.optarr[bb][2] != None:
659
- self.__dict__[self.optarr[bb][1]] = 1
660
- #print( "call", self.optarr[bb][3])
661
- if self.optarr[bb][3] != None:
662
- self.optarr[bb][3]()
663
- return args
664
-
665
611
  def about(progname, verstr = "1.0.0", imgfile = "icon.png"):
666
612
 
667
613
  ''' Show About dialog: '''
@@ -879,6 +825,15 @@ def print_exception(xstr):
879
825
  print("Could not print trace stack. ", sys.exc_info())
880
826
  print( cumm)
881
827
 
828
+ # -----------------------------------------------------------------------
829
+ # Allow the system to breed, no wait
830
+
831
+ def ubreed():
832
+
833
+ while True:
834
+ if not Gtk.main_iteration_do(False):
835
+ break
836
+
882
837
  # -----------------------------------------------------------------------
883
838
  # Sleep just a little, but allow the system to breed
884
839
 
@@ -0,0 +1,62 @@
1
+ #!/usr/bin/env python
2
+
3
+ from __future__ import print_function
4
+
5
+ import os, sys, string, time, traceback, getopt
6
+ import random, glob, warnings
7
+
8
+ import comline
9
+
10
+ version = "0.00"
11
+
12
+ # ------------------------------------------------------------------------
13
+
14
+ def phelp():
15
+
16
+ comline.phelplong()
17
+ sys.exit(0)
18
+
19
+ #print()
20
+ #print( "Usage: " + os.path.basename(sys.argv[0]) + " [options]")
21
+ #print()
22
+ #print( "Options: -d level - Debug level 0-10")
23
+ #print( " -p - Port to use (default: 9999)")
24
+ #print( " -v - Verbose")
25
+ #print( " -V - Version")
26
+ #print( " -q - Quiet")
27
+ #print( " -h - Help")
28
+ #print()
29
+ #sys.exit(0)
30
+ #
31
+ # ------------------------------------------------------------------------
32
+ def pversion(ver = "1.0"):
33
+
34
+ comline.pversion(ver)
35
+ #print( os.path.basename(sys.argv[0]), "Version", version)
36
+ #sys.exit(0)
37
+
38
+ # option, var_name, initial_val, function, help
39
+ optarr = [\
40
+ ["d:", "debug=", "pgdebug", 0, None, "Debug level. 0=none 10=noisy. Default: 0" ],
41
+ ["p:", "port=", "port", 9999, None, "Listen on port. Default: 9999"],
42
+ ["v", "verbose", "verbose", 0, None, "Verbose. Show more info."],
43
+ ["q", "quiet", "quiet", 0, None, "Quiet. Show less info."],
44
+ ["V", "version", None, None, pversion, "Print Version string."],
45
+ ["h", "help", None, None, phelp, "Show Help. (this screen)"],
46
+ ]
47
+
48
+ comline.setprog("Custom name")
49
+ comline.setargs("[options]")
50
+ comline.sethead("Header line.")
51
+ comline.setfoot("Footer line.")
52
+ conf = comline.ConfigLong(optarr)
53
+
54
+ if __name__ == '__main__':
55
+
56
+ args = conf.comline(sys.argv[1:])
57
+ pversion()
58
+ print()
59
+ phelp()
60
+ sys.exit(0)
61
+
62
+ # EOF
@@ -69,18 +69,23 @@ tw = pgtestwin()
69
69
 
70
70
  #print("test")
71
71
 
72
- def fillrand():
72
+ def fillrand(size = 10):
73
73
  aaa = []
74
- for aa in range(10):
74
+ for aa in range(size):
75
75
  aaa.append( (pgtests.randstr(12), pgtests.randstr(12),
76
76
  pgtests.randstr(12), pgtests.randstr(12)) )
77
77
  return aaa
78
78
 
79
- aaa = fillrand()
80
79
  tw.treeview.clear()
80
+
81
+ aaa = fillrand(6)
81
82
  for aa in aaa:
82
83
  try:
83
- tw.treeview.append(aa)
84
+ to = tw.treeview.append(aa)
85
+ bbb = fillrand(5)
86
+ for bb in bbb:
87
+ to2 = tw.treeview.append(bb, to)
88
+
84
89
  except:
85
90
  print(sys.exc_info())
86
91
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyvguicom
3
- Version: 1.3.0
3
+ Version: 1.3.3
4
4
  Summary: High power secure server GUI utility helpers.
5
5
  Home-page: https://github.com/pglen/pyguicom.git
6
6
  Author: Peter Glen
@@ -2,6 +2,7 @@ README.md
2
2
  setup.py
3
3
  pyvguicom/__init__.py
4
4
  pyvguicom/browsewin.py
5
+ pyvguicom/comline.py
5
6
  pyvguicom/custwidg.py
6
7
  pyvguicom/htmledit.py
7
8
  pyvguicom/pgbox.py
@@ -16,6 +17,7 @@ pyvguicom/pgutils.py
16
17
  pyvguicom/pgwkit.py
17
18
  pyvguicom/plug.py
18
19
  pyvguicom/testbutt.py
20
+ pyvguicom/testcline.py
19
21
  pyvguicom/testcust.py
20
22
  pyvguicom/testentry.py
21
23
  pyvguicom/testgui.py
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes