<html><head><title> POO lib: $pub.editors </title></head><body><center> <h3>POO Library</h3> <h1>$pub.editors</h1> </center> The script below creates an object called <b>$pub.editors</b> which can be used to store all publicly-available <a href="../editors.html">custom editors</a>. It also adds a <b>@editors</b> command to $user, so that a custom editor can be easily selected. <hr> <pre> "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 <str> 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 </pre> <p><hr> <address> http://www.strout.net/python/poo/lib/editors.html <br>Last Updated: 8/02/97 . . . . . . <a href="http://www.strout.net/">Joe Strout</a> </address> </body></html>