POO Library

$pub.editors

The script below creates an object called $pub.editors which can be used to store all publicly-available custom editors. It also adds a @editors command to $user, so that a custom editor can be easily selected.
"creating $pub.editors...
@create $thing as editors
beam editors to $pub

"creating $user.setEditor...
@newfunc $user.setEditor(self, editorName='')
holder = getObj('$pub.editors')
if editorName == "default" or editorName == "built-in":
	delattr(self,"editor")
	print "Now using default editor."
editor = getattr( holder, editorName )
if editor:
	setattr(self,"editor", editor)
	print "Editor now set to", editorName + "."
else:
	print "Please specify one of: "
	print "   ", "default (for the original built-in editor)"
	for p in filter(lambda x:type(x)==InstanceType,holder.proplist()):
		print "   ", x
.x
@set $user.setEditor.desc = "change preferred editor"
@setperm $user.setEditor = r
@cmd $user.@editor calls setEditor()
@cmd $user.@editor  calls setEditor(%1)

@edit $pub.editors.help
The $pub.editors object stores publicly available custom editors.
To see what editors are available, use the "@editor" command.
To choose a particular editor, use (for example) "@editor foo".
To restore the built-in editor, enter "@editor default".
.x


http://www.strout.net/python/poo/lib/editors.html
Last Updated: 8/02/97 . . . . . . Joe Strout