From: Schollnick, B. <Ben...@xe...> - 2005-04-19 12:08:11
|
> > Very useful.... I would suggest that Kevin consider adding=20 > it to the=20 > > Resource editor and maybe even expanding on it.... > >=20 > > Possibly noting any non-default values that have been=20 > configured for=20 > > the widgets... > The danger with this approach is that the printer friendly version=20 > *could* get out of sync with the resource file. Especially if the=20 > resource file is edited outside the resourceEditor. While that is a valid concern.... In my opinion the user is not suppose to edit the file outside of the ResourceEditor....=20 So it is a moot point. > I think the original suggestion is better, just a little routine,=20 > something like; >=20 > >>> resfile =3D open('<resource file name>') > >>> resource =3D eval(resfile.read()) > >>> for background in resource['application']['backgrounds']: > >>> for component in background['components']: > >>> print "%s: %s %s" % (component['name'],=20 > component['type'],=20 > component['position']) >=20 > N.B. it should be a trivial exercise to turn this into a handy=20 > documentation function and put it into a module. I'll leave that (and=20 > any bug fixes) as an exercise for the reader. Then you are making an automated task into a manual task that has to be run after every change made on the file.... (i.e. Pydoc) If you are concerned about allowing the user to do a manual execution of this.... Then we could make a stub so that the user can run it.... But it should stay in the resourceeditor to make it automagically updated when edited in the resourceeditor. - Benjamin |