Package peppy :: Module major :: Class MajorModeMatcherDriver
[frames] | no frames]

Class MajorModeMatcherDriver

      object --+    
               |    
debug.debugmixin --+
                   |
                  MajorModeMatcherDriver

Instance Methods

Inherited from object: __delattr__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Class Methods
 
getCompatibleMajorModes(cls, stc_class)
 
match(cls, buffer, magic_size=None)
 
findModeByMimetype(cls, plugins, mimetype)
 
scanProtocol(cls, plugins, url)
Scan for url protocol match.
 
getEditraType(cls, url)
 
scanURL(cls, plugins, url, metadata)
Scan for url filename match.
 
scanMagic(cls, plugins, header)
Scan for a pattern match in the first bytes of the file.
 
scanEmacs(cls, plugins, header)
Scan the first two lines of a file for an emacs mode specifier.
 
scanShell(cls, plugins, header)
Scan the first lines of a file for a shell 'bangpath' specifier.
 
attemptOpen(cls, plugins, buffer)
Use the mode's attemptOpen method to see if it recognizes the url.

Inherited from debug.debugmixin: dprint

Class Variables

Inherited from debug.debugmixin: debuglevel

Properties

Inherited from object: __class__

Method Details

scanProtocol(cls, plugins, url)
Class Method

 

Scan for url protocol match.

Determine if the protocol is enough to specify the major mode. This generally happens only when the major mode is a client of a specific server and not a generic editor. (E.g. MPDMode)

Parameters:
  • url - vfs.Reference object to scan
Returns:
list of matching MajorMode subclasses

scanURL(cls, plugins, url, metadata)
Class Method

 

Scan for url filename match.

Determine if the pathname matches some pattern that can identify the corresponding major mode.

Parameters:
  • url - vfs.Reference object to scan
Returns:
list of matching MajorMode subclasses

scanMagic(cls, plugins, header)
Class Method

 

Scan for a pattern match in the first bytes of the file.

Determine if there is a 'magic' pattern in the first n bytes of the file that can associate it with a major mode.

Parameters:
  • header - first n bytes of the file
Returns:
list of matching MajorMode subclasses

scanEmacs(cls, plugins, header)
Class Method

 

Scan the first two lines of a file for an emacs mode specifier.

Determine if an emacs mode specifier in the file can be associated with a major mode.

Parameters:
  • header - first n bytes of the file
Returns:
matching MajorMode subclass or None

scanShell(cls, plugins, header)
Class Method

 

Scan the first lines of a file for a shell 'bangpath' specifier.

Determine if a shell bangpath in the file can be associated with a major mode.

Parameters:
  • header - first n bytes of the file
Returns:
matching MajorMode subclass or None

attemptOpen(cls, plugins, buffer)
Class Method

 

Use the mode's attemptOpen method to see if it recognizes the url.

Parameters:
  • buffer - Buffer object to scan
Returns:
matching MajorMode subclass or None