[Pythonmac-SIG] Step-by-step howto for testing new Mach{ho}Python architecture

Dan Grassi dan@grassi.org
Sun, 4 Aug 2002 15:52:02 -0400


On Sunday, August 4, 2002, at 02:56 PM, Donovan Preston wrote:

> Finally, about the advanced editor patch, it's simply a matter of 
> changing
> all of the toolbox module imports from "import Blah" to "from Carbon 
> import
> Blah"... Otherwise, I didn't have to change a thing to get the advanced
> editor to work. I will try to apply it to my fresh copy of the IDE I
> installed yesterday and post another step-by-step for people interested 
> in
> having this functionality.

But there is another issue, AdvancedEditorPatch.py does not work but it 
is a simple fix.  The first insert:

PyEdit.InsertAfter("			self.run_as_main = 0",
"""		if self.settings.has_key("syntax_coloring"):
			self.syntax_coloring = self.settings["syntax_coloring"]
		else:
			self.syntax_coloring = 1
""")

does not work because of changes in PyEdit.py in the 2.3 cvs tree.  
Instead it needs to be:

PyEdit.InsertAfter(r"""		self.run_as_main = 
self.settings.get("run_as_main", 0)""",
r"""		self.syntax_coloring = self.settings.get("syntax_coloring", 0)
""")

Without this self.syntax_coloring is not created and the pop-up menu 
crashes the IDE when it is referenced.


For completeness the changes in PyAdvancedEditor.py are:

old:
import Qd
import Fm
import Evt
import Events
change to:
#from Carbon import Qd
from Carbon import Fm
from Carbon import Evt
from Carbon import Events

Dan