Gnm.ExprName

Fields

Name

Type

Access

Description

name

Gnm.NamedExpr

r/w

oper

int

r/w

optional_scope

Gnm.Sheet

r/w

optional_wb_scope

Gnm.Workbook

r/w

Methods

class

add_dep (nexpr, dep)

class

as_string (nexpr, pp, fmt)

class

check_for_loop (name, texpr)

class

cmp_by_name (a, b)

class

downgrade_to_placeholder (nexpr)

class

eval (nexpr, pos, flags)

class

in_use (nexpr)

class

is_active (nexpr)

class

is_placeholder (ne)

class

lookup (pos, name)

class

new (name)

class

perm_add (sheet, name, texpr, is_editable)

class

ref (nexpr)

class

remove (nexpr)

class

remove_dep (nexpr, dep)

class

set_expr (nexpr, texpr)

class

set_expr_undo_new (nexpr)

class

set_is_placeholder (nexpr, is_placeholder)

class

set_name (nexpr, new_name)

class

set_pos (nexpr, pp)

class

unref (nexpr)

class

validate (name)

Details

class Gnm.ExprName
classmethod add_dep(nexpr, dep)
Parameters:
classmethod as_string(nexpr, pp, fmt)
Parameters:
Returns:

The rendering of nexpr given convention fmt.

Return type:

str

classmethod check_for_loop(name, texpr)
Parameters:
  • name (str) – tentative name

  • texpr (Gnm.ExprTop) – tentative expression

Returns:

True if defining the tentative name would cause a circular name reference.

NOTE: if we already have a circular reference beforehand, we will come to serious grief.

Return type:

bool

classmethod cmp_by_name(a, b)
Parameters:
Return type:

int

classmethod downgrade_to_placeholder(nexpr)
Parameters:

nexpr (Gnm.NamedExpr) –

Takes a real non-placeholder name and converts it to being a placeholder. unrefing its expression

classmethod eval(nexpr, pos, flags)
Parameters:
Returns:

The resulting GOffice.value.

Return type:

Gnm.Value

classmethod in_use(nexpr)
Parameters:

nexpr (Gnm.NamedExpr) – A named expression.

Returns:

True, if the named expression appears to be in use. This is an approximation only, as we only look at the GOffice.workbook in which the name is defined.

Return type:

bool

classmethod is_active(nexpr)
Parameters:

nexpr (Gnm.NamedExpr) –

Return type:

bool

classmethod is_placeholder(ne)
Parameters:

ne (Gnm.NamedExpr) –

Returns:

True if ne is a placeholder for an unknown name

Return type:

bool

classmethod lookup(pos, name)
Parameters:
Returns:

Gnm.NamedExpr named name in the scope given by pos; None if no such Gnm.NamedExpr exists.

Return type:

Gnm.NamedExpr or None

classmethod new(name)
Parameters:

name (str) –

Return type:

Gnm.NamedExpr

Creates a new name without linking it into any container.

classmethod perm_add(sheet, name, texpr, is_editable)
Parameters:
  • sheet (Gnm.Sheet) –

  • name (str) – name

  • texpr (Gnm.ExprTop) – string to be the GOffice.value of the name

  • is_editable (bool) – whether this is a predefined action

This is a wrapper around expr_name_add to set this as permanent name.

classmethod ref(nexpr)
Parameters:

nexpr (Gnm.NamedExpr) –

Return type:

Gnm.NamedExpr

classmethod remove(nexpr)
Parameters:

nexpr (Gnm.NamedExpr) –

Remove a nexpr from its container and deactivate it. NOTE : nexpr may continue to exist if things still have references to it, but they will evaluate to #REF!

classmethod remove_dep(nexpr, dep)
Parameters:
classmethod set_expr(nexpr, texpr)
Parameters:

Set the content of nexpr to texpr.

classmethod set_expr_undo_new(nexpr)
Parameters:

nexpr (Gnm.NamedExpr) – Gnm.NamedExpr

Return type:

GOffice.Undo

classmethod set_is_placeholder(nexpr, is_placeholder)
Parameters:
classmethod set_name(nexpr, new_name)
Parameters:
  • nexpr (Gnm.NamedExpr) – the named expression

  • new_name (str) – the new name of the expression

Returns:

True on error.

Return type:

bool

classmethod set_pos(nexpr, pp)
Parameters:
Return type:

str

Returns a translated error string which the caller must free if something goes wrong.

classmethod unref(nexpr)
Parameters:

nexpr (Gnm.NamedExpr) –

classmethod validate(name)
Parameters:

name (str) – tentative name

Return type:

bool

returns True if the given name is valid, False otherwise.