gtksourceview2.LanguageManager

gtksourceview2.LanguageManager — Languages Manager object for gtksourceview2.View

Synopsis

class gtksourceview2.LanguageManager(gobject.GObject):
    gtksourceview2.LanguageManager()
def get_language(id)
def get_language_ids()
def get_search_path()
def guess_language(filename=None, content_type=None)
def set_search_path()
Functions

    def gtksourceview2.language_manager_get_default()

Ancestry

+-- gobject.GObject
    +-- gtksourceview2.LanguageManager

Properties

"language-ids"ReadList of the ids of the available languages.
"search-path"Read-WriteList of directories where the language specification files (.lang) are located.

Description

Interface to manage available and custom source code language descriptions.

Constructor

    gtksourceview2.LanguageManager()

Returns :

a new gtksourceview2.LanguageManager.

Creates a new gtksourceview2.LanguageManager object.

Methods

gtksourceview2.LanguageManager.get_language

    def get_language(id)

id :

an ID.

Returns :

a gtksourceview2.Language, or None if there is no language identified by the given id.

The get_language() method gets the gtksourceview2.Language identified by the given id in the language manager.

gtksourceview2.LanguageManager.get_language_ids

    def get_language_ids()

Returns :

a list containing the ids of the available languages or None if no language is available.

The get_language_ids() method returns the ids of the available languages.

gtksourceview2.LanguageManager.get_search_path

    def get_search_path()

Returns :

a list of language files directories (as string).

The get_search_path() method gets the list directories where @lm looks for language files.

gtksourceview2.LanguageManager.guess_language

    def guess_language(filename=None, content_type=None)

filename :

a filename in Glib filename encoding, or None.

content_type :

a content type (as in GIO API), or None.

Returns :

a gtksourceview2.Language or None if there is no suitable language for given filename and/or content_type.

The set_search_path() method sets the list of directories where the lm looks for language files. If dirs is None, the search path is reset to default.

gtksourceview2.LanguageManager.set_search_path

    def set_search_path(dirs)

dirs :

a list of dirs (as string).

The set_search_path() method sets the list of directories where the lm looks for language files. If dirs is None, the search path is reset to default.

Functions

gtksourceview2.language_manager_get_default

    def gtksourceview2.language_manager_get_default()

Returns :

a gtksourceview2.LanguageManager.

The language_manager_get_default() function Returns the default gtksourceview2.LanguageManager instance.