[PyCrust] RE: send me your latest files
Brought to you by:
pobrien
From: Patrick K. O'B. <po...@or...> - 2001-08-02 20:27:08
|
Kevin and Rowland, Attached is the latest version of PyCrust. If you look in the Demos folder you will see an application called PyCrustMinimus.py which is a bare minimum application using PyCrust. It should be pretty easy to figure out from this example how to integrate PyCrust into PythonCard. Do you guys want to do the integration or do you want me to do it? The files that should be copied into the PythonCard folder are the following: pseudo.py PyCrustEditor.py PyCrustInterp.py PyCrustShell.py PyCrustVersion.py My thought on how to do the loading would be something like trying 'from PyCrust.PyCrustShell import Shell' and if that failed then 'from PyCrustShell import Shell'. That way PythonCard would load the Shell from the users PyCrust package if they had PyCrust installed or directly from the current directory (proto) if they did not have PyCrust. Then we need to decide how we want to expose PythonCard to the shell. Here are two possible ways: add an object to the sys module's namespace or add an object to the interpreter's local dictionary. In PyCrust.py I do: def main(): import sys application = App(0) sys.application = application application.MainLoop() Then inside the shell you can do: >>> import sys >>> sys.application.whatever >>> sys.application.whatever.something >>> sys.application.whatever.someaction() This is nice in that the user can drill down through whatever the application knows about. The other approach would look something like the following wherever the Shell object first gets created: self.shell = Shell(editorParent=self) self.shell.interp.locals['whatever'] = whatever The result of this is that inside the shell the user can type dir() and 'whatever' will be listed, without having to import the sys module. They can then do: >>> whatever.something >>> whatever.someaction() So it kind of depends on what we'd like to expose and how much we want to "pollute" the local namespace by loading it up with stuff. Let me know what you guys think and what I can do to help. --- Patrick K. O'Brien Orbtech "I am, therefore I think." -----Original Message----- From: Kevin Altis [mailto:al...@se...] Sent: Thursday, August 02, 2001 1:26 PM To: po...@or... Cc: Rowland Smith Subject: send me your latest files Let's try and get pycrust integrated today. What are the minimum files necessary? These would be the ones I would add to the proto directory in the release distributions so someone doesn't have to set their PYTHONPATH to use PyCrust and PythonCard. Complete file list if someone wants to have PyCrust in its own directory and set the PYTHONPATH. Can you do an example screenshot for PyCrust as well as a text dump showing off trying stuff out while running the Proof or another sample? This part can be done once we have the integration done. We want to remember position and size of the Message Watcher, PyCrust, Properties editor, etc. We could either do that by saving the info whenever a move or resize event happens or try and do it during the application close, but I'm not sure about the hook for the latter. ka |