branch : pmacs2
This commit is contained in:
moculus 2007-10-18 21:12:11 +00:00
parent aa56498955
commit 62f7057c8d
1 changed files with 7 additions and 13 deletions

20
MODES
View File

@ -11,21 +11,15 @@ inherit.
2. Where do they come from? 2. Where do they come from?
All modes are loaded and installed in application.py. It would be nice if there Modes are loaded and installed by application.py, or by $HOME/.pmc/conf, which
was a configuration file where you could add your own modes, but there isn't. is sourced by application.py. To install a mode, import its class from the
Loading a module involves the following (in Application.__init__): package in which it resides, and call install() on the class, passing the
application as the only argument. Example:
import mymode
mymode.ModeClass.install(self)
self.modes['foo'] = package.Foo This code can be run in application.py's constructor, or in $HOME/.pmc/conf.
# ...
self.mode_paths['/some/full/path'] = 'foo'
self.mode_basenames['some-filename'] = 'foo'
self.mode_extensions['.foo'] = 'foo'
self.mode_detection['foo'] = 'foo'
The last is for detecting scripts using the "#!/usr/bin/foo" syntax.
3. How do they work? 3. How do they work?