glib2

Support for GLib2 tools:

  • marshal
  • enums
  • gsettings
waflib.Tools.glib2.add_marshal_file(self, filename, prefix)[source]

Task generator method

Add a file to the list of marshal files to process. Store them in the attribute marshal_list.

Parameters:
  • filename (string) – xml file to compile
  • prefix (string) – marshal prefix (–prefix=prefix)
waflib.Tools.glib2.process_marshal(self)[source]

Process the marshal files stored in the attribute marshal_list to create waflib.Tools.glib2.glib_genmarshal instances. Add the c file created to the list of source to process.

waflib.Tools.glib2.add_enums_from_template(self, source='', target='', template='', comments='')[source]

Task generator method

Add a file to the list of enum files to process. Store them in the attribute enums_list.

Parameters:
  • source (string) – enum file to process
  • target (string) – target file
  • template (string) – template file
  • comments (string) – comments
waflib.Tools.glib2.add_enums(self, source='', target='', file_head='', file_prod='', file_tail='', enum_prod='', value_head='', value_prod='', value_tail='', comments='')[source]

Task generator method

Add a file to the list of enum files to process. Store them in the attribute enums_list.

Parameters:
  • source (string) – enum file to process
  • target (string) – target file
  • file_head – unused
  • file_prod – unused
  • file_tail – unused
  • enum_prod – unused
  • value_head – unused
  • value_prod – unused
  • value_tail – unused
  • comments (string) – comments
waflib.Tools.glib2.process_enums(self)[source]

Process the enum files stored in the attribute enum_list to create waflib.Tools.glib2.glib_mkenums instances.

class waflib.Tools.glib2.glib_mkenums(*k, **kw)[source]

Bases: waflib.Task.Task

Process enum files

waflib.Tools.glib2.add_settings_schemas(self, filename_list)[source]

Task generator method

Add settings files to process, add them to settings_schema_files

Parameters:filename_list (list of string) – files
waflib.Tools.glib2.add_settings_enums(self, namespace, filename_list)[source]

Task generator method

This function may be called only once by task generator to set the enums namespace.

Parameters:
  • namespace (string) – namespace
  • filename_list (file list) – enum files to process
waflib.Tools.glib2.r_change_ext(self, ext)[source]

Change the extension from the last dot in the filename. The gsettings schemas often have names of the form org.gsettings.test.gschema.xml

waflib.Tools.glib2.process_settings(self)[source]

Task generator method

Process the schema files in settings_schema_files to create waflib.Tools.glib2.glib_mkenums instances. The same files are validated through waflib.Tools.glib2.glib_validate_schema tasks.

Feature :glib2
class waflib.Tools.glib2.glib_validate_schema(*k, **kw)[source]

Bases: waflib.Task.Task

Validate schema files

waflib.Tools.glib2.configure(conf)[source]

Find the following programs:

  • glib-genmarshal and set GLIB_GENMARSHAL
  • glib-mkenums and set GLIB_MKENUMS
  • glib-compile-schemas and set GLIB_COMPILE_SCHEMAS (not mandatory)

And set the variable GSETTINGSSCHEMADIR

waflib.Tools.glib2.options(opt)[source]

Add the --gsettingsschemadir command-line option

waflib.Tools.glib2.taskgen_method(func)

Decorator: register a method as a task generator method. The function must accept a task generator as first parameter:

from waflib.TaskGen import taskgen_method
@taskgen_method
def mymethod(self):
        pass
Parameters:func (function) – task generator method to add
Return type:function
waflib.Tools.glib2.feature(*k)

Decorator: register a task generator method that will be executed when the object attribute ‘feature’ contains the corresponding key(s):

from waflib.Task import feature
@feature('myfeature')
def myfunction(self):
        print('that is my feature!')
def build(bld):
        bld(features='myfeature')
Parameters:k (list of string) – feature names
waflib.Tools.glib2.before_method(*k)

Decorator: register a task generator method which will be executed before the functions of given name(s):

from waflib.TaskGen import feature, before
@feature('myfeature')
@before_method('fun2')
def fun1(self):
        print('feature 1!')
@feature('myfeature')
def fun2(self):
        print('feature 2!')
def build(bld):
        bld(features='myfeature')
Parameters:k (list of string) – method names
waflib.Tools.glib2.after_method(*k)

Decorator: register a task generator method which will be executed after the functions of given name(s):

from waflib.TaskGen import feature, after
@feature('myfeature')
@after_method('fun2')
def fun1(self):
        print('feature 1!')
@feature('myfeature')
def fun2(self):
        print('feature 2!')
def build(bld):
        bld(features='myfeature')
Parameters:k (list of string) – method names

Features defined in this module:

Previous topic

vala

Next topic

qt4

This Page