From: Schollnick, B. <Ben...@xe...> - 2005-04-11 15:38:08
|
> But if I did, what I'd probably do is add some code to the "saveFile"=20 > function in the resourceEditor, so that each time I saved the=20 > resource=20 > file, I also saved the equivalent nice, readable version.=20 >=20 > I wrote a couple of lines of code to do a very basic version=20 > of that -=20 > here's a context diff ... > (it's the same little code fragment inserted in two places). Very useful.... I would suggest that Kevin consider adding it to the Resource editor and maybe even expanding on it.... Possibly noting any non-default values that have been configured for the widgets... - Ben |
From: Sells, F. <fr...@ad...> - 2005-04-11 15:48:06
|
I'm cool with that, as long as I'm off the hook for liability, the usual GPL verbage. Would appreciate a brief credit though. -----Original Message----- From: Schollnick, Benjamin [mailto:Ben...@xe...] Sent: Monday, April 11, 2005 11:37 AM To: pyt...@li... Subject: RE: [Pythoncard-users] newbie, tool to print resource structure Importance: Low > But if I did, what I'd probably do is add some code to the "saveFile" > function in the resourceEditor, so that each time I saved the > resource > file, I also saved the equivalent nice, readable version. > > I wrote a couple of lines of code to do a very basic version > of that - > here's a context diff ... > (it's the same little code fragment inserted in two places). Very useful.... I would suggest that Kevin consider adding it to the Resource editor and maybe even expanding on it.... Possibly noting any non-default values that have been configured for the widgets... - Ben ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_ide95&alloc_id396&op=click _______________________________________________ Pythoncard-users mailing list Pyt...@li... https://lists.sourceforge.net/lists/listinfo/pythoncard-users |
From: Andy T. <an...@ha...> - 2005-04-19 11:01:24
|
Sells, Fred wrote: > I'm cool with that, as long as I'm off the hook for liability, the usual GPL > verbage. Would appreciate a brief credit though. > > -----Original Message----- > From: Schollnick, Benjamin [mailto:Ben...@xe...] > Sent: Monday, April 11, 2005 11:37 AM > To: pyt...@li... > Subject: RE: [Pythoncard-users] newbie, tool to print resource structure > Importance: Low > > > >>But if I did, what I'd probably do is add some code to the "saveFile" >>function in the resourceEditor, so that each time I saved the >>resource >>file, I also saved the equivalent nice, readable version. >> >>I wrote a couple of lines of code to do a very basic version >>of that - >>here's a context diff ... >>(it's the same little code fragment inserted in two places). > > > Very useful.... I would suggest that Kevin consider adding it to the > Resource editor and maybe even expanding on it.... > > Possibly noting any non-default values that have been configured for the > widgets... > > - Ben > > The danger with this approach is that the printer friendly version *could* get out of sync with the resource file. Especially if the resource file is edited outside the resourceEditor. I think the original suggestion is better, just a little routine, something like; >>> resfile = open('<resource file name>') >>> resource = eval(resfile.read()) >>> for background in resource['application']['backgrounds']: >>> for component in background['components']: >>> print "%s: %s %s" % (component['name'], component['type'], component['position']) N.B. it should be a trivial exercise to turn this into a handy documentation function and put it into a module. I'll leave that (and any bug fixes) as an exercise for the reader. Regards, Andy -- -------------------------------------------------------------------------------- From the desk of Andrew J Todd esq - http://www.halfcooked.com/ |
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 |
From: Andy T. <an...@ha...> - 2005-04-20 09:58:13
|
Schollnick, Benjamin wrote: >>>Very useful.... I would suggest that Kevin consider adding >> >>it to the >> >>>Resource editor and maybe even expanding on it.... >>> >>>Possibly noting any non-default values that have been >> >>configured for >> >>>the widgets... > > >>The danger with this approach is that the printer friendly version >>*could* get out of sync with the resource file. Especially if the >>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.... > > So it is a moot point. > Sorry, but there you are wrong. The whole point of making the resource file a valid Python file is so that you aren't restricted to using the resourceEditor to amend it. This is an important point and if there is any misunderstanding or mis-communication I think we should address it. Is there anything in particular that led you to this conclusion? [snip] > > > 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. See Kevin's point about scriptlets, this is a perfect use case for one. Regards, Andy -- -------------------------------------------------------------------------------- From the desk of Andrew J Todd esq - http://www.halfcooked.com/ |
From: Sells, F. <fr...@ad...> - 2005-04-19 12:13:56
|
I use it and I edit (infrequently) outside the resource editor. When that happens, I use the resource editor to load and save to get it in sync. I have a very slight preference toward a separate module/script run from the command line. It would facilitate making the tool more robust and making it easier for users to customize to meet their needs. -----Original Message----- From: Schollnick, Benjamin [mailto:Ben...@xe...] Sent: Tuesday, April 19, 2005 8:06 AM To: pyt...@li... Subject: RE: [Pythoncard-users] newbie, tool to print resource structure Importance: Low > > Very useful.... I would suggest that Kevin consider adding > it to the > > Resource editor and maybe even expanding on it.... > > > > Possibly noting any non-default values that have been > configured for > > the widgets... > The danger with this approach is that the printer friendly version > *could* get out of sync with the resource file. Especially if the > 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.... So it is a moot point. > I think the original suggestion is better, just a little routine, > something like; > > >>> resfile = open('<resource file name>') > >>> resource = eval(resfile.read()) > >>> for background in resource['application']['backgrounds']: > >>> for component in background['components']: > >>> print "%s: %s %s" % (component['name'], > component['type'], > component['position']) > > N.B. it should be a trivial exercise to turn this into a handy > documentation function and put it into a module. I'll leave that (and > 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 ------------------------------------------------------- This SF.Net email is sponsored by: New Crystal Reports XI. Version 11 adds new functionality designed to reduce time involved in creating, integrating, and deploying reporting solutions. Free runtime info, new features, or free trial, at: http://www.businessobjects.com/devxi/728 _______________________________________________ Pythoncard-users mailing list Pyt...@li... https://lists.sourceforge.net/lists/listinfo/pythoncard-users |
From: Kevin A. <al...@se...> - 2005-04-19 14:58:00
|
On Apr 19, 2005, at 5:13 AM, Sells, Fred wrote: > I use it and I edit (infrequently) outside the resource editor. When > that > happens, I use the resource editor to load and save to get it in sync. > I > have a very slight preference toward a separate module/script run from > the > command line. It would facilitate making the tool more robust and > making it > easier for users to customize to meet their needs. As a general rule, my own preference is to not add a lot of extra infrequently used menu items to any of the standard PythonCard tools. As an alternative, I added "scriptlets" to the codeEditor a long time ago, which are simply scripts of anything that can be run in the shell and that could include a standard Python module along with a call to run a particular function. There are some examples in the codeEditor scriptlets directory such as insertDateAndTime.py import time now = time.localtime(time.time()) dateStr = time.strftime("%A, %B %d, %Y, %I:%M %p", now) comp.document.ReplaceSelection(dateStr) You can think of scriptlets as "macros" if you want and there is even support in the codeEditor for making menu items that run these scriptlets, it just isn't documented, nor is there a UI for managing the menu, I just never seem to get around to writing it, even though it is a minor amount of code and UI for the dialog. As an example, I have the following line in my pythoncard_config\codeeditor\user.config.txt file which menu item with Ctrl+1 as a shortcut in the Shell menu: 'macros': [{'filename': 'C: \\python\\PythonCard\\tools\\codeEditor\\scriptlets\\insertDateAndTime.p y', 'key: 'Ctrl+1', 'label': 'insertDateAndTime'}], The line is just another key/value pair in the dictionary. The reason I bring this up is that the resourceEditor should probably have the same scriptlets support and with a dialog to easily allow people to add and remove items from the menu you can have whatever macros you want. ka |
From: Sells, F. <fr...@ad...> - 2005-04-20 11:57:08
|
Back in the 90's my company made a commercial Motif GUI-Builder. From that experience I concur that being able to manually edit the resource file is a necessity, even though it may be seldom used. -----Original Message----- From: Andy Todd [mailto:an...@ha...] Sent: Tuesday, April 19, 2005 5:36 PM To: Schollnick, Benjamin Cc: pyt...@li... Subject: Re: [Pythoncard-users] newbie, tool to print resource structure Importance: Low Schollnick, Benjamin wrote: >>>Very useful.... I would suggest that Kevin consider adding=20 >> >>it to the=20 >> >>>Resource editor and maybe even expanding on it.... >>> >>>Possibly noting any non-default values that have been=20 >> >>configured for=20 >> >>>the widgets... >=20 >=20 >>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. >=20 >=20 > While that is a valid concern.... In my opinion the user is not suppose > to edit the file outside of the ResourceEditor....=20 >=20 > So it is a moot point. >=20 Sorry, but there you are wrong. The whole point of making the resource=20 file a valid Python file is so that you aren't restricted to using the=20 resourceEditor to amend it. This is an important point and if there is any misunderstanding or=20 mis-communication I think we should address it. Is there anything in=20 particular that led you to this conclusion? [snip] >=20 >=20 > 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) >=20 > 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. See Kevin's point about scriptlets, this is a perfect use case for one. Regards, Andy --=20 ---------------------------------------------------------------------------- ---- =20From the desk of Andrew J Todd esq - http://www.halfcooked.com/ ------------------------------------------------------- This SF.Net email is sponsored by: New Crystal Reports XI. Version 11 adds new functionality designed to reduce time involved in creating, integrating, and deploying reporting solutions. Free runtime info, new features, or free trial, at: http://www.businessobjects.com/devxi/728 _______________________________________________ Pythoncard-users mailing list Pyt...@li... https://lists.sourceforge.net/lists/listinfo/pythoncard-users --------------------------------------------------------------------------- The information contained in this message may be privileged and / or confidential and protected from disclosure. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify the sender immediately by replying to this message and deleting the material from any computer. --------------------------------------------------------------------------- |
From: Schollnick, B. <Ben...@xe...> - 2005-04-20 12:37:17
|
> > While that is a valid concern.... In my opinion the user is not=20 > > suppose to edit the file outside of the ResourceEditor.... > >=20 > > So it is a moot point. >=20 > Sorry, but there you are wrong. The whole point of making the=20 > resource file a valid Python file is so that you aren't restricted > to using the resourceEditor to amend it. So Kevin is suppose to accept typo's, and or bad syntax or managled white space in the file? We have a application that is perfectly able to edit and manipulate the resource file... If you manually change the file, you need to take responsibility for altering the file. Once in a blue moon I may open the file to do a group find and replace, if I decide to radically change my naming strategy.... But that doesn't mean it's a supported method of changing the file. How can kevin guarantee that the resource file is valid if it is not maintained through the resourceeditor? > This is an important point and if there is any misunderstanding or=20 > mis-communication I think we should address it. Is there anything in=20 > particular that led you to this conclusion? Specifically, no. But I believe that there needs to be a clear seperation between what Kevin supports and doesn't. Asking Kevin to support people editing the resource file outside of the resourceeditor is asking for support headaches. It maybe a plain text format.... But that does not mean that you can guarantee a valid resourcefile / python file will be the final result... > > But it should stay in the resourceeditor to make it automagically=20 > > updated when edited in the resourceeditor. >=20 > See Kevin's point about scriptlets, this is a perfect use=20 > case for one. Fine.... But I do still suggest that it is a automatic feature in the resourceeditor... Or at least have a preference option for it to be automatic... I have found that feature to be very useful.... It prevents me from having to have the resourceeditor open all the time to simply look up the field names... - Benjamin |
From: Schollnick, B. <Ben...@xe...> - 2005-04-20 12:44:15
|
> Back in the 90's my company made a commercial Motif=20 > GUI-Builder. From that experience I concur that being able to=20 > manually edit the resource file is a necessity, even though=20 > it may be seldom used. A slight clarification... I am not saying that you can't edit the resource file manually... I am suggesting that the Resourceeditor is the only guaranteed method to produce a resource file. The resource editor can't make typos, make white space errors, make syntax errors, or any of a 100s of human errors... While the manually edited file should be okay, it's a valid concern that someone might manually edit the file and goof something up. Then demand that Kevin "fix" the problem.... **** I have been in that situation before. **** I feel that it's important to at least acknowledge that manually editing the file may not always be possible, nor supported.... What if Kevin moves to a XML based format? Sure it's plain ascii, but I personally don't feel that manually editing the tag data is worth it... Or heaven forbid a binary format.... =20 - Ben >=20 > -----Original Message----- > From: Andy Todd [mailto:an...@ha...] > Sent: Tuesday, April 19, 2005 5:36 PM > To: Schollnick, Benjamin > Cc: pyt...@li... > Subject: Re: [Pythoncard-users] newbie, tool to print=20 > resource structure > Importance: Low >=20 >=20 > Schollnick, Benjamin wrote: > >>>Very useful.... I would suggest that Kevin consider adding > >> > >>it to the > >> > >>>Resource editor and maybe even expanding on it.... > >>> > >>>Possibly noting any non-default values that have been > >> > >>configured for > >> > >>>the widgets... > >=20 > >=20 > >>The danger with this approach is that the printer friendly version > >>*could* get out of sync with the resource file. Especially if the=20 > >>resource file is edited outside the resourceEditor. > >=20 > >=20 > > While that is a valid concern.... In my opinion the user is not=20 > > suppose to edit the file outside of the ResourceEditor.... > >=20 > > So it is a moot point. > >=20 >=20 > Sorry, but there you are wrong. The whole point of making the=20 > resource=20 > file a valid Python file is so that you aren't restricted to=20 > using the=20 > resourceEditor to amend it. >=20 > This is an important point and if there is any misunderstanding or=20 > mis-communication I think we should address it. Is there anything in=20 > particular that led you to this conclusion? >=20 >=20 > [snip] > >=20 > >=20 > > Then you are making an automated task into a manual task=20 > that has to=20 > > be run after every change made on the file.... (i.e. Pydoc) > >=20 > > If you are concerned about allowing the user to do a manual=20 > execution=20 > > of this.... Then we could make a stub so that the user can=20 > run it.... =20 > > But it should stay in the resourceeditor to make it automagically=20 > > updated when edited in the resourceeditor. >=20 > See Kevin's point about scriptlets, this is a perfect use=20 > case for one. >=20 > Regards, > Andy > --=20 > -------------------------------------------------------------- > -------------- > ---- > From the desk of Andrew J Todd esq - http://www.halfcooked.com/ >=20 >=20 >=20 > ------------------------------------------------------- > This SF.Net email is sponsored by: New Crystal Reports XI.=20 > Version 11 adds new functionality designed to reduce time=20 > involved in creating, integrating, and deploying reporting=20 > solutions. Free runtime info, new features, or free trial,=20 > at: http://www.businessobjects.com/devxi/728 > _______________________________________________ > Pythoncard-users mailing list Pyt...@li... > https://lists.sourceforge.net/lists/listinfo/pythoncard-users >=20 > -------------------------------------------------------------- > ------------- > The information contained in this message may be privileged=20 > and / or confidential and protected from disclosure. If the=20 > reader of this message is not the intended recipient, you are=20 > hereby notified that any dissemination, distribution or=20 > copying of this communication is strictly prohibited. If you=20 > have received this communication in error, please notify the=20 > sender immediately by replying to this message and deleting=20 > the material from any computer. > -------------------------------------------------------------- > ------------- >=20 |
From: Andy T. <an...@ha...> - 2005-04-26 12:12:27
|
Schollnick, Benjamin wrote: >>Back in the 90's my company made a commercial Motif >>GUI-Builder. From that experience I concur that being able to >>manually edit the resource file is a necessity, even though >>it may be seldom used. > > > A slight clarification... > > I am not saying that you can't edit the resource file manually... > > I am suggesting that the Resourceeditor is the only guaranteed method to > produce a resource file. > > The resource editor can't make typos, make white space errors, make > syntax errors, or any of a 100s of human errors... > > While the manually edited file should be okay, it's a valid concern that > someone might manually edit the file and goof something up. Then demand > that Kevin "fix" the problem.... > > **** I have been in that situation before. **** > > I feel that it's important to at least acknowledge that manually editing > the file may not always be possible, nor supported.... > > What if Kevin moves to a XML based format? Sure it's plain ascii, but I > personally don't feel that manually editing the tag data is worth it... > > > Or heaven forbid a binary format.... > > - Ben > Your points are all valid, but you *can* manually edit the resource file and it will always be perfectly acceptable to do so. This being an open source project no one has to provide support if they don't want to, people can 'demand' all they like. I think I can guarantee that if someone has a problem and posts an invalid resource file to the list it will be spotted very quickly. The whole point of PythonCard is to make the simple things easy but not to stop people working in the fashion they choose. And if they choose to edit their own resource files then we shouldn't in any way stop them. As far as I'm concerned manually editing the resource file is *always* going to be, if not supported, certainly allowed. The project isn't likely to move to any other resource format, take a look at the mailing list archives from 2001 and 2002 where this discussion last took place. No one was keen on XML (or any other) resource file formats then and I don't see any evidence that this has changed in the mean time. The only XML type thing that may happen (and don't hold your breath) is that someone may write a converter which turns your resource file into a wxPython .xrc file, but that's a different conversation and I'll leave it there. Regards, Andy -- -------------------------------------------------------------------------------- From the desk of Andrew J Todd esq - http://www.halfcooked.com/ |