Guido van Rossum | b00649c | 1991-12-11 17:29:59 +0000 | [diff] [blame] | 1 | # |
| 2 | # flp - Module to load fl forms from fd files |
| 3 | # |
| 4 | # Jack Jansen, December 1991 |
| 5 | # |
| 6 | import string |
| 7 | import path |
| 8 | import sys |
Guido van Rossum | b00649c | 1991-12-11 17:29:59 +0000 | [diff] [blame] | 9 | import FL |
| 10 | |
| 11 | SPLITLINE = '--------------------' |
| 12 | FORMLINE = '=============== FORM ===============' |
| 13 | ENDLINE = '==============================' |
| 14 | |
| 15 | error = 'flp.error' |
| 16 | |
| 17 | ################################################################## |
| 18 | # Part 1 - The parsing routines # |
| 19 | ################################################################## |
| 20 | |
| 21 | # |
| 22 | # Externally visible function. Load form. |
| 23 | # |
| 24 | def parse_form(filename, formname): |
Guido van Rossum | 465c499 | 1992-02-19 14:50:10 +0000 | [diff] [blame] | 25 | forms = checkcache(filename) |
| 26 | if forms != None: |
| 27 | if forms.has_key(formname): |
| 28 | return forms[formname] |
| 29 | else: |
| 30 | forms = {} |
Guido van Rossum | b00649c | 1991-12-11 17:29:59 +0000 | [diff] [blame] | 31 | fp = _open_formfile(filename) |
| 32 | nforms = _parse_fd_header(fp) |
| 33 | for i in range(nforms): |
| 34 | form = _parse_fd_form(fp, formname) |
| 35 | if form <> None: |
Guido van Rossum | 465c499 | 1992-02-19 14:50:10 +0000 | [diff] [blame] | 36 | break |
| 37 | else: |
| 38 | raise error, 'No such form in fd file' |
| 39 | forms[formname] = form |
| 40 | writecache(filename, forms) |
| 41 | return form |
Guido van Rossum | b00649c | 1991-12-11 17:29:59 +0000 | [diff] [blame] | 42 | |
| 43 | # |
| 44 | # Externally visible function. Load all forms. |
| 45 | # |
| 46 | def parse_forms(filename): |
Guido van Rossum | 465c499 | 1992-02-19 14:50:10 +0000 | [diff] [blame] | 47 | forms = checkcache(filename) |
| 48 | if forms != None: return forms |
Guido van Rossum | b00649c | 1991-12-11 17:29:59 +0000 | [diff] [blame] | 49 | fp = _open_formfile(filename) |
| 50 | nforms = _parse_fd_header(fp) |
| 51 | forms = {} |
| 52 | for i in range(nforms): |
| 53 | form = _parse_fd_form(fp, None) |
| 54 | forms[form[0].Name] = form |
Guido van Rossum | 465c499 | 1992-02-19 14:50:10 +0000 | [diff] [blame] | 55 | writecache(filename, forms) |
Guido van Rossum | b00649c | 1991-12-11 17:29:59 +0000 | [diff] [blame] | 56 | return forms |
Guido van Rossum | 465c499 | 1992-02-19 14:50:10 +0000 | [diff] [blame] | 57 | |
| 58 | # |
| 59 | # Internal: see if a cached version of the file exists |
| 60 | # |
| 61 | MAGIC = '.fdc' |
| 62 | def checkcache(filename): |
| 63 | import marshal |
| 64 | fp, filename = _open_formfile2(filename) |
| 65 | fp.close() |
| 66 | cachename = filename + 'c' |
| 67 | try: |
| 68 | fp = open(cachename, 'r') |
| 69 | except IOError: |
Guido van Rossum | 24e77d4 | 1992-03-25 14:53:05 +0000 | [diff] [blame^] | 70 | #print 'flp: no cache file', cachename |
Guido van Rossum | 465c499 | 1992-02-19 14:50:10 +0000 | [diff] [blame] | 71 | return None |
| 72 | try: |
| 73 | if fp.read(4) != MAGIC: |
| 74 | print 'flp: bad magic word in cache file', cachename |
| 75 | return None |
| 76 | cache_mtime = rdlong(fp) |
| 77 | file_mtime = getmtime(filename) |
| 78 | if cache_mtime != file_mtime: |
Guido van Rossum | 24e77d4 | 1992-03-25 14:53:05 +0000 | [diff] [blame^] | 79 | #print 'flp: outdated cache file', cachename |
Guido van Rossum | 465c499 | 1992-02-19 14:50:10 +0000 | [diff] [blame] | 80 | return None |
Guido van Rossum | 24e77d4 | 1992-03-25 14:53:05 +0000 | [diff] [blame^] | 81 | #print 'flp: valid cache file', cachename |
Guido van Rossum | 465c499 | 1992-02-19 14:50:10 +0000 | [diff] [blame] | 82 | altforms = marshal.load(fp) |
| 83 | forms = {} |
| 84 | for name in altforms.keys(): |
| 85 | altobj, altlist = altforms[name] |
| 86 | obj = _newobj().init() |
| 87 | obj.make(altobj) |
| 88 | list = [] |
| 89 | for altobj in altlist: |
| 90 | nobj = _newobj().init() |
| 91 | nobj.make(altobj) |
| 92 | list.append(nobj) |
| 93 | forms[name] = obj, list |
| 94 | return forms |
| 95 | finally: |
| 96 | fp.close() |
| 97 | |
| 98 | def rdlong(fp): |
| 99 | s = fp.read(4) |
| 100 | if len(s) != 4: return None |
| 101 | a, b, c, d = s[0], s[1], s[2], s[3] |
| 102 | return ord(a)<<24 | ord(b)<<16 | ord(c)<<8 | ord(d) |
| 103 | |
| 104 | def wrlong(fp, x): |
| 105 | a, b, c, d = (x>>24)&0xff, (x>>16)&0xff, (x>>8)&0xff, x&0xff |
| 106 | fp.write(chr(a) + chr(b) + chr(c) + chr(d)) |
| 107 | |
| 108 | def getmtime(filename): |
| 109 | import posix |
| 110 | from stat import ST_MTIME |
| 111 | try: |
| 112 | return posix.stat(filename)[ST_MTIME] |
| 113 | except posix.error: |
| 114 | return None |
| 115 | |
| 116 | # |
| 117 | # Internal: write cached version of the form (parsing is too slow!) |
| 118 | # |
| 119 | def writecache(filename, forms): |
| 120 | import marshal |
| 121 | fp, filename = _open_formfile2(filename) |
| 122 | fp.close() |
| 123 | cachename = filename + 'c' |
| 124 | try: |
| 125 | fp = open(cachename, 'w') |
| 126 | except IOError: |
| 127 | print 'flp: can\'t create cache file', cachename |
| 128 | return # Never mind |
| 129 | fp.write('\0\0\0\0') # Seek back and write MAGIC when done |
| 130 | wrlong(fp, getmtime(filename)) |
| 131 | altforms = {} |
| 132 | for name in forms.keys(): |
| 133 | obj, list = forms[name] |
| 134 | altobj = obj.__dict__ |
| 135 | altlist = [] |
| 136 | for obj in list: altlist.append(obj.__dict__) |
| 137 | altforms[name] = altobj, altlist |
| 138 | marshal.dump(altforms, fp) |
| 139 | fp.seek(0) |
| 140 | fp.write(MAGIC) |
| 141 | fp.close() |
Guido van Rossum | 24e77d4 | 1992-03-25 14:53:05 +0000 | [diff] [blame^] | 142 | #print 'flp: wrote cache file', cachename |
Guido van Rossum | b00649c | 1991-12-11 17:29:59 +0000 | [diff] [blame] | 143 | |
| 144 | # |
| 145 | # Internal: Locate form file (using PYTHONPATH) and open file |
| 146 | # |
| 147 | def _open_formfile(filename): |
Guido van Rossum | 465c499 | 1992-02-19 14:50:10 +0000 | [diff] [blame] | 148 | return _open_formfile2(filename)[0] |
| 149 | |
| 150 | def _open_formfile2(filename): |
Guido van Rossum | b00649c | 1991-12-11 17:29:59 +0000 | [diff] [blame] | 151 | if filename[-3:] <> '.fd': |
| 152 | filename = filename + '.fd' |
Guido van Rossum | bdfcfcc | 1992-01-01 19:35:13 +0000 | [diff] [blame] | 153 | if filename[0] == '/': |
Guido van Rossum | b00649c | 1991-12-11 17:29:59 +0000 | [diff] [blame] | 154 | try: |
| 155 | fp = open(filename,'r') |
Guido van Rossum | b00649c | 1991-12-11 17:29:59 +0000 | [diff] [blame] | 156 | except IOError: |
| 157 | fp = None |
| 158 | else: |
| 159 | for pc in sys.path: |
| 160 | pn = path.join(pc, filename) |
| 161 | try: |
| 162 | fp = open(pn, 'r') |
Guido van Rossum | 465c499 | 1992-02-19 14:50:10 +0000 | [diff] [blame] | 163 | filename = pn |
Guido van Rossum | b00649c | 1991-12-11 17:29:59 +0000 | [diff] [blame] | 164 | break |
Guido van Rossum | b00649c | 1991-12-11 17:29:59 +0000 | [diff] [blame] | 165 | except IOError: |
| 166 | fp = None |
Guido van Rossum | bdfcfcc | 1992-01-01 19:35:13 +0000 | [diff] [blame] | 167 | if fp == None: |
Guido van Rossum | b00649c | 1991-12-11 17:29:59 +0000 | [diff] [blame] | 168 | raise error, 'Cannot find forms file ' + filename |
Guido van Rossum | 465c499 | 1992-02-19 14:50:10 +0000 | [diff] [blame] | 169 | return fp, filename |
Guido van Rossum | b00649c | 1991-12-11 17:29:59 +0000 | [diff] [blame] | 170 | |
| 171 | # |
| 172 | # Internal: parse the fd file header, return number of forms |
| 173 | # |
| 174 | def _parse_fd_header(file): |
| 175 | # First read the magic header line |
| 176 | datum = _parse_1_line(file) |
| 177 | if datum <> ('Magic', 12321): |
| 178 | raise error, 'Not a forms definition file' |
| 179 | # Now skip until we know number of forms |
| 180 | while 1: |
| 181 | datum = _parse_1_line(file) |
Guido van Rossum | bdfcfcc | 1992-01-01 19:35:13 +0000 | [diff] [blame] | 182 | if type(datum) == type(()) and datum[0] == 'Numberofforms': |
Guido van Rossum | b00649c | 1991-12-11 17:29:59 +0000 | [diff] [blame] | 183 | break |
| 184 | return datum[1] |
| 185 | # |
| 186 | # Internal: parse fd form, or skip if name doesn't match. |
| 187 | # the special value None means 'allways parse it'. |
| 188 | # |
| 189 | def _parse_fd_form(file, name): |
| 190 | datum = _parse_1_line(file) |
| 191 | if datum <> FORMLINE: |
| 192 | raise error, 'Missing === FORM === line' |
| 193 | form = _parse_object(file) |
Guido van Rossum | bdfcfcc | 1992-01-01 19:35:13 +0000 | [diff] [blame] | 194 | if form.Name == name or name == None: |
Guido van Rossum | b00649c | 1991-12-11 17:29:59 +0000 | [diff] [blame] | 195 | objs = [] |
| 196 | for j in range(form.Numberofobjects): |
| 197 | obj = _parse_object(file) |
| 198 | objs.append(obj) |
| 199 | return (form, objs) |
| 200 | else: |
| 201 | for j in range(form.Numberofobjects): |
| 202 | _skip_object(file) |
| 203 | return None |
| 204 | |
| 205 | # |
| 206 | # Internal class: a convient place to store object info fields |
| 207 | # |
Guido van Rossum | 869100a | 1991-12-26 13:03:39 +0000 | [diff] [blame] | 208 | class _newobj: |
Guido van Rossum | b00649c | 1991-12-11 17:29:59 +0000 | [diff] [blame] | 209 | def init(self): |
| 210 | return self |
| 211 | def add(self, (name, value)): |
Guido van Rossum | 465c499 | 1992-02-19 14:50:10 +0000 | [diff] [blame] | 212 | self.__dict__[name] = value |
| 213 | def make(self, dict): |
| 214 | for name in dict.keys(): |
| 215 | self.add(name, dict[name]) |
Guido van Rossum | b00649c | 1991-12-11 17:29:59 +0000 | [diff] [blame] | 216 | |
| 217 | # |
| 218 | # Internal parsing routines. |
| 219 | # |
| 220 | def _parse_string(str): |
Guido van Rossum | 24e77d4 | 1992-03-25 14:53:05 +0000 | [diff] [blame^] | 221 | if '\\' in str: |
| 222 | s = '\'' + str + '\'' |
| 223 | try: |
| 224 | return eval(s) |
| 225 | except: |
| 226 | pass |
Guido van Rossum | befa293 | 1991-12-16 13:10:14 +0000 | [diff] [blame] | 227 | return str |
Guido van Rossum | b00649c | 1991-12-11 17:29:59 +0000 | [diff] [blame] | 228 | |
| 229 | def _parse_num(str): |
Guido van Rossum | befa293 | 1991-12-16 13:10:14 +0000 | [diff] [blame] | 230 | return eval(str) |
Guido van Rossum | b00649c | 1991-12-11 17:29:59 +0000 | [diff] [blame] | 231 | |
| 232 | def _parse_numlist(str): |
| 233 | slist = string.split(str) |
| 234 | nlist = [] |
| 235 | for i in slist: |
| 236 | nlist.append(_parse_num(i)) |
| 237 | return nlist |
| 238 | |
| 239 | # This dictionary maps item names to parsing routines. |
| 240 | # If no routine is given '_parse_num' is default. |
| 241 | _parse_func = { \ |
| 242 | 'Name': _parse_string, \ |
| 243 | 'Box': _parse_numlist, \ |
| 244 | 'Colors': _parse_numlist, \ |
| 245 | 'Label': _parse_string, \ |
| 246 | 'Name': _parse_string, \ |
| 247 | 'Callback': _parse_string, \ |
| 248 | 'Argument': _parse_string } |
| 249 | |
| 250 | # This function parses a line, and returns either |
| 251 | # a string or a tuple (name,value) |
| 252 | |
Guido van Rossum | befa293 | 1991-12-16 13:10:14 +0000 | [diff] [blame] | 253 | import regexp |
| 254 | |
Guido van Rossum | b00649c | 1991-12-11 17:29:59 +0000 | [diff] [blame] | 255 | def _parse_line(line): |
Guido van Rossum | befa293 | 1991-12-16 13:10:14 +0000 | [diff] [blame] | 256 | a = regexp.match('^([^:]*): *(.*)', line) |
| 257 | if not a: |
| 258 | return line |
| 259 | name = line[:a[1][1]] |
Guido van Rossum | bdfcfcc | 1992-01-01 19:35:13 +0000 | [diff] [blame] | 260 | if name[0] == 'N': |
Guido van Rossum | befa293 | 1991-12-16 13:10:14 +0000 | [diff] [blame] | 261 | name = string.joinfields(string.split(name),'') |
| 262 | name = string.lower(name) |
Guido van Rossum | b00649c | 1991-12-11 17:29:59 +0000 | [diff] [blame] | 263 | name = string.upper(name[0]) + name[1:] |
Guido van Rossum | befa293 | 1991-12-16 13:10:14 +0000 | [diff] [blame] | 264 | value = line[a[2][0]:] |
Guido van Rossum | b00649c | 1991-12-11 17:29:59 +0000 | [diff] [blame] | 265 | try: |
| 266 | pf = _parse_func[name] |
Guido van Rossum | b00649c | 1991-12-11 17:29:59 +0000 | [diff] [blame] | 267 | except KeyError: |
| 268 | pf = _parse_num |
| 269 | value = pf(value) |
| 270 | return (name, value) |
| 271 | |
| 272 | def _readline(file): |
| 273 | line = file.readline() |
Guido van Rossum | befa293 | 1991-12-16 13:10:14 +0000 | [diff] [blame] | 274 | if not line: |
| 275 | raise EOFError |
| 276 | return line[:-1] |
Guido van Rossum | b00649c | 1991-12-11 17:29:59 +0000 | [diff] [blame] | 277 | |
| 278 | def _parse_1_line(file): |
Guido van Rossum | befa293 | 1991-12-16 13:10:14 +0000 | [diff] [blame] | 279 | line = _readline(file) |
Guido van Rossum | bdfcfcc | 1992-01-01 19:35:13 +0000 | [diff] [blame] | 280 | while line == '': |
Guido van Rossum | b00649c | 1991-12-11 17:29:59 +0000 | [diff] [blame] | 281 | line = _readline(file) |
| 282 | return _parse_line(line) |
| 283 | |
| 284 | def _skip_object(file): |
| 285 | line = '' |
| 286 | while not line in (SPLITLINE, FORMLINE, ENDLINE): |
| 287 | pos = file.tell() |
| 288 | line = _readline(file) |
Guido van Rossum | bdfcfcc | 1992-01-01 19:35:13 +0000 | [diff] [blame] | 289 | if line == FORMLINE: |
Guido van Rossum | b00649c | 1991-12-11 17:29:59 +0000 | [diff] [blame] | 290 | file.seek(pos) |
| 291 | |
| 292 | def _parse_object(file): |
| 293 | obj = _newobj().init() |
| 294 | while 1: |
| 295 | pos = file.tell() |
| 296 | datum = _parse_1_line(file) |
| 297 | if datum in (SPLITLINE, FORMLINE, ENDLINE): |
Guido van Rossum | bdfcfcc | 1992-01-01 19:35:13 +0000 | [diff] [blame] | 298 | if datum == FORMLINE: |
Guido van Rossum | b00649c | 1991-12-11 17:29:59 +0000 | [diff] [blame] | 299 | file.seek(pos) |
| 300 | return obj |
| 301 | if type(datum) <> type(()): |
| 302 | raise error, 'Parse error, illegal line in object: '+datum |
| 303 | obj.add(datum) |
| 304 | |
| 305 | ################################################################# |
| 306 | # Part 2 - High-level object/form creation routines # |
| 307 | ################################################################# |
| 308 | |
| 309 | # |
| 310 | # External - Create a form an link to an instance variable. |
| 311 | # |
| 312 | def create_full_form(inst, (fdata, odatalist)): |
| 313 | form = create_form(fdata) |
| 314 | exec('inst.'+fdata.Name+' = form\n') |
| 315 | for odata in odatalist: |
| 316 | create_object_instance(inst, form, odata) |
| 317 | |
| 318 | # |
| 319 | # External - Merge a form into an existing form in an instance |
| 320 | # variable. |
| 321 | # |
| 322 | def merge_full_form(inst, form, (fdata, odatalist)): |
| 323 | exec('inst.'+fdata.Name+' = form\n') |
| 324 | if odatalist[0].Class <> FL.BOX: |
| 325 | raise error, 'merge_full_form() expects FL.BOX as first obj' |
| 326 | for odata in odatalist[1:]: |
| 327 | create_object_instance(inst, form, odata) |
| 328 | |
| 329 | |
| 330 | ################################################################# |
| 331 | # Part 3 - Low-level object/form creation routines # |
| 332 | ################################################################# |
| 333 | |
| 334 | # |
| 335 | # External Create_form - Create form from parameters |
| 336 | # |
| 337 | def create_form(fdata): |
Guido van Rossum | 465c499 | 1992-02-19 14:50:10 +0000 | [diff] [blame] | 338 | import fl |
| 339 | return fl.make_form(FL.NO_BOX, fdata.Width, fdata.Height) |
Guido van Rossum | b00649c | 1991-12-11 17:29:59 +0000 | [diff] [blame] | 340 | |
| 341 | # |
| 342 | # External create_object - Create an object. Make sure there are |
| 343 | # no callbacks. Returns the object created. |
| 344 | # |
| 345 | def create_object(form, odata): |
| 346 | obj = _create_object(form, odata) |
| 347 | if odata.Callback: |
| 348 | raise error, 'Creating free object with callback' |
| 349 | return obj |
| 350 | # |
| 351 | # External create_object_instance - Create object in an instance. |
| 352 | # |
| 353 | def create_object_instance(inst, form, odata): |
| 354 | obj = _create_object(form, odata) |
| 355 | if odata.Callback: |
| 356 | cbfunc = eval('inst.'+odata.Callback) |
| 357 | obj.set_call_back(cbfunc, odata.Argument) |
| 358 | if odata.Name: |
| 359 | exec('inst.' + odata.Name + ' = obj\n') |
| 360 | # |
| 361 | # Internal _create_object: Create the object and fill options |
| 362 | # |
| 363 | def _create_object(form, odata): |
| 364 | crfunc = _select_crfunc(form, odata.Class) |
| 365 | obj = crfunc(odata.Type, odata.Box[0], odata.Box[1], odata.Box[2], \ |
| 366 | odata.Box[3], odata.Label) |
| 367 | if not odata.Class in (FL.BEGIN_GROUP, FL.END_GROUP): |
| 368 | obj.boxtype = odata.Boxtype |
| 369 | obj.col1 = odata.Colors[0] |
| 370 | obj.col2 = odata.Colors[1] |
| 371 | obj.align = odata.Alignment |
| 372 | obj.lstyle = odata.Style |
| 373 | obj.lsize = odata.Size |
| 374 | obj.lcol = odata.Lcol |
| 375 | return obj |
| 376 | # |
| 377 | # Internal crfunc: helper function that returns correct create function |
| 378 | # |
| 379 | def _select_crfunc(fm, cl): |
Guido van Rossum | bdfcfcc | 1992-01-01 19:35:13 +0000 | [diff] [blame] | 380 | if cl == FL.BEGIN_GROUP: return fm.bgn_group |
| 381 | elif cl == FL.END_GROUP: return fm.end_group |
| 382 | elif cl == FL.BITMAP: return fm.add_bitmap |
| 383 | elif cl == FL.BOX: return fm.add_box |
| 384 | elif cl == FL.BROWSER: return fm.add_browser |
| 385 | elif cl == FL.BUTTON: return fm.add_button |
| 386 | elif cl == FL.CHART: return fm.add_chart |
| 387 | elif cl == FL.CHOICE: return fm.add_choice |
| 388 | elif cl == FL.CLOCK: return fm.add_clock |
| 389 | elif cl == FL.COUNTER: return fm.add_counter |
| 390 | elif cl == FL.DIAL: return fm.add_dial |
| 391 | elif cl == FL.FREE: return fm.add_free |
| 392 | elif cl == FL.INPUT: return fm.add_input |
| 393 | elif cl == FL.LIGHTBUTTON: return fm.add_lightbutton |
| 394 | elif cl == FL.MENU: return fm.add_menu |
| 395 | elif cl == FL.POSITIONER: return fm.add_positioner |
| 396 | elif cl == FL.ROUNDBUTTON: return fm.add_roundbutton |
| 397 | elif cl == FL.SLIDER: return fm.add_slider |
| 398 | elif cl == FL.VALSLIDER: return fm.add_valslider |
| 399 | elif cl == FL.TEXT: return fm.add_text |
| 400 | elif cl == FL.TIMER: return fm.add_timer |
Guido van Rossum | b00649c | 1991-12-11 17:29:59 +0000 | [diff] [blame] | 401 | else: |
| 402 | raise error, 'Unknown object type: ' + `cl` |
| 403 | |
| 404 | |
| 405 | def test(): |
Guido van Rossum | 465c499 | 1992-02-19 14:50:10 +0000 | [diff] [blame] | 406 | import time |
| 407 | t0 = time.millitimer() |
Guido van Rossum | b00649c | 1991-12-11 17:29:59 +0000 | [diff] [blame] | 408 | if len(sys.argv) == 2: |
| 409 | forms = parse_forms(sys.argv[1]) |
Guido van Rossum | 465c499 | 1992-02-19 14:50:10 +0000 | [diff] [blame] | 410 | t1 = time.millitimer() |
| 411 | print 'parse time:', 0.001*(t1-t0), 'sec.' |
| 412 | keys = forms.keys() |
| 413 | keys.sort() |
| 414 | for i in keys: |
Guido van Rossum | b00649c | 1991-12-11 17:29:59 +0000 | [diff] [blame] | 415 | _printform(forms[i]) |
| 416 | elif len(sys.argv) == 3: |
| 417 | form = parse_form(sys.argv[1], sys.argv[2]) |
Guido van Rossum | 465c499 | 1992-02-19 14:50:10 +0000 | [diff] [blame] | 418 | t1 = time.millitimer() |
| 419 | print 'parse time:', 0.001*(t1-t0), 'sec.' |
Guido van Rossum | b00649c | 1991-12-11 17:29:59 +0000 | [diff] [blame] | 420 | _printform(form) |
| 421 | else: |
| 422 | print 'Usage: test fdfile [form]' |
| 423 | |
| 424 | def _printform(form): |
| 425 | f = form[0] |
| 426 | objs = form[1] |
| 427 | print 'Form ', f.Name, ', size: ', f.Width, f.Height, ' Nobj ', f.Numberofobjects |
| 428 | for i in objs: |
| 429 | print ' Obj ', i.Name, ' type ', i.Class, i.Type |
| 430 | print ' Box ', i.Box, ' btype ', i.Boxtype |
| 431 | print ' Label ', i.Label, ' size/style/col/align ', i.Size,i.Style, i.Lcol, i.Alignment |
| 432 | print ' cols ', i.Colors |
| 433 | print ' cback ', i.Callback, i.Argument |
Guido van Rossum | 465c499 | 1992-02-19 14:50:10 +0000 | [diff] [blame] | 434 | |
| 435 | # Local variables: |
| 436 | # py-indent-offset: 4 |
| 437 | # end: |