Gnm.Func

g GObject.Object GObject.Object Gnm.Func Gnm.Func GObject.Object->Gnm.Func

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

add (group, descriptor, tdomain)

class

add_placeholder (scope, name, type)

class

add_placeholder_localized (gname, lname)

class

convert_markup_to_pango (desc, target)

class

enumerate ()

class

lookup (name, scope)

class

lookup_localized (name, scope)

class

lookup_or_add_placeholder (name)

class

lookup_prefix (prefix, scope, trans)

count_args ()

dec_usage ()

derivative (expr, ep, info)

dispose ()

get_arg_description (arg_idx)

get_arg_name (arg_idx)

get_arg_type (arg_idx)

get_arg_type_string (arg_idx)

get_description ()

get_flags ()

get_function_group ()

get_help ()

get_impl_status ()

get_in_use ()

get_name (localized)

get_test_status ()

get_translation_domain ()

gettext (str)

inc_usage ()

is_fixargs ()

is_varargs ()

link_dep (ei, qlink)

load_if_stub ()

set_flags (f)

set_from_desc (desc)

set_function_group (group)

set_help (help, n)

set_impl_status (st)

set_stub ()

set_test_status (st)

set_translation_domain (tdomain)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Name

Type

Flags

Short Description

in-use

bool

r

Is function being used?

name

str

r/w/co

The name of the function.

translation-domain

str

r/w

The translation domain for help texts

Signals

Inherited:

GObject.Object (1)

Name

Short Description

derivative

Signals that a function call’s derivative should be calculated

link-dep

Signals that an expressions that is a call to func is being linked or unlinked.

load-stub

Signals that func, which is a stub, needs to be loaded now.

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

arg_names

[object]

r

arg_spec

str

r

arg_types

str

r

args_func

Gnm.FuncArgs

r

base

GObject.Object

r

flags

Gnm.FuncFlags

r

fn_group

Gnm.FuncGroup

r

fn_type

Gnm.FuncType

r

help

Gnm.FuncHelp

r

help_count

int

r

impl_status

Gnm.FuncImplStatus

r

localized_name

str

r

max_args

int

r

min_args

int

r

name

str

r

nodes_func

Gnm.FuncNodes

r

tdomain

GOffice.String

r

test_status

Gnm.FuncTestStatus

r

usage_count

int

r

Class Details

class Gnm.Func(**kwargs)
Bases:

GObject.Object

Abstract:

No

classmethod add(group, descriptor, tdomain)
Parameters:
Returns:

a new Gnm.Func.

Return type:

Gnm.Func

classmethod add_placeholder(scope, name, type)
Parameters:
Returns:

a placeholder with the given name.

Return type:

Gnm.Func

classmethod add_placeholder_localized(gname, lname)
Parameters:
  • gname (str or None) – function name

  • lname (str) – localized function name

Returns:

a placeholder with the given localized name.

Return type:

Gnm.Func

classmethod convert_markup_to_pango(desc, target)
Parameters:
  • desc (str) – the fn or arg description string

  • target (Gtk.Widget) – target widget for the markup.

Returns:

the escaped string with @{} markup converted to pango markup

Return type:

str

classmethod enumerate()
Return type:

[Gnm.Func]

classmethod lookup(name, scope)
Parameters:
Returns:

the function of that name.

Return type:

Gnm.Func or None

classmethod lookup_localized(name, scope)
Parameters:
Returns:

the function of that name.

Return type:

Gnm.Func or None

classmethod lookup_or_add_placeholder(name)
Parameters:

name (str) – function name

Returns:

a Gnm.Func named name, either an existing one or a placeholder.

Return type:

Gnm.Func

classmethod lookup_prefix(prefix, scope, trans)
Parameters:
  • prefix (str) – prefix to search for

  • scope (Gnm.Workbook) –

  • trans (bool) – whether to search translated function names

Returns:

A list of functions whose names start with prefix.

Return type:

[Gnm.Func]

count_args()
Returns:

min:

location for minimum args

max:

location for maximum args

Return type:

(min: int, max: int)

This calculates the maximum and minimum number of args that can be passed. For a vararg function, the maximum will be set to GObject.G_MAXINT.

dec_usage()

This function decrements the usage GOffice.count of self. When the usage GOffice.count reaches zero, the function may be unloaded, for example by unloading the plugin that defines it.

derivative(expr, ep, info)
Parameters:
Returns:

the derivative of expr with respect to info.

Return type:

Gnm.Expr or None

dispose()
get_arg_description(arg_idx)
Parameters:

arg_idx (int) – zero-based argument offset

Returns:

the description of the argument

Return type:

str

get_arg_name(arg_idx)
Parameters:

arg_idx (int) – zero-based argument offset

Returns:

the name of the argument

Return type:

str or None

get_arg_type(arg_idx)
Parameters:

arg_idx (int) – zero-based argument offset

Returns:

the type of the argument

Return type:

int

get_arg_type_string(arg_idx)
Parameters:

arg_idx (int) – zero-based argument offset

Returns:

the type of the argument as a string

Return type:

str

get_description()
Returns:

the description of the function

Return type:

str

get_flags()
Return type:

Gnm.FuncFlags

get_function_group()
Returns:

the function group to which self belongs.

Return type:

Gnm.FuncGroup

get_help()
Returns:

self's help items.

Return type:

[Gnm.FuncHelp] or None

get_impl_status()
Return type:

Gnm.FuncImplStatus

get_in_use()
Return type:

bool

get_name(localized)
Parameters:

localized (bool) – if True, use localized name

Returns:

self's name

Return type:

str

get_test_status()
Return type:

Gnm.FuncTestStatus

get_translation_domain()
Returns:

the translation domain for self's help text.

Return type:

str

gettext(str)
Parameters:

str (str) – string to translate

Returns:

str translated in self's translation domain.

Return type:

str

inc_usage()
Returns:

a new reference to self.

Return type:

Gnm.Func

This function increments the usage GOffice.count of self. A non-zero usage GOffice.count prevents the unloading of the function.

is_fixargs()
Return type:

bool

is_varargs()
Return type:

bool

Parameters:
Return type:

Gnm.DependentFlags

load_if_stub()
set_flags(f)
Parameters:

f (Gnm.FuncFlags) –

set_from_desc(desc)
Parameters:

desc (Gnm.FuncDescriptor) –

set_function_group(group)
Parameters:

group (Gnm.FuncGroup) –

set_help(help, n)
Parameters:
set_impl_status(st)
Parameters:

st (Gnm.FuncImplStatus) –

set_stub()
set_test_status(st)
Parameters:

st (Gnm.FuncTestStatus) –

set_translation_domain(tdomain)
Parameters:

tdomain (str or None) – Translation domain, None for Gnumeric’s.

Signal Details

Gnm.Func.signals.derivative(func, expr, ep, info)
Signal Name:

derivative

Flags:

RUN_LAST

Parameters:
Returns:

Gnm.Expr representing the derivative, None for error.

Return type:

Gnm.Expr or None

Signals that a function call’s derivative should be calculated

Signal Name:

link-dep

Flags:

RUN_LAST

Parameters:
Returns:

A Gnm.DependentFlags allowing arguments not be be linked if that is appropriate.

Return type:

int

Signals that an expressions that is a call to func is being linked or unlinked. Most functions do not need this.

Gnm.Func.signals.load_stub(func)
Signal Name:

load-stub

Flags:

RUN_LAST

Parameters:

func (Gnm.Func) – The object which received the signal

Signals that func, which is a stub, needs to be loaded now. Anyone creating a stub function should arrange for this signal to be caught and the function to be properly instantiated.

Property Details

Gnm.Func.props.in_use
Name:

in-use

Type:

bool

Default Value:

False

Flags:

READABLE

Is function being used?

Gnm.Func.props.name
Name:

name

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The name of the function.

Gnm.Func.props.translation_domain
Name:

translation-domain

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

The translation domain for help texts