Gnm.ExprName¶
Fields¶
Name |
Type |
Access |
Description |
---|---|---|---|
name |
r/w |
||
oper |
r/w |
||
optional_scope |
r/w |
||
optional_wb_scope |
r/w |
Methods¶
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
Details¶
- class Gnm.ExprName¶
- classmethod add_dep(nexpr, dep)¶
- Parameters:
nexpr (
Gnm.NamedExpr
) –dep (
Gnm.Dependent
) –
- classmethod as_string(nexpr, pp, fmt)¶
- Parameters:
nexpr (
Gnm.NamedExpr
) – AGnm.NamedExpr
pp (
Gnm.ParsePos
orNone
) – Position where name was defined.fmt (
Gnm.Conventions
) –Gnm.Conventions
describing how to render nexpr
- Returns:
The rendering of nexpr given convention fmt.
- Return type:
- classmethod check_for_loop(name, texpr)¶
- Parameters:
name (
str
) – tentative nametexpr (
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:
- classmethod cmp_by_name(a, b)¶
- Parameters:
a (
Gnm.NamedExpr
) –b (
Gnm.NamedExpr
) –
- Return type:
- 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:
nexpr (
Gnm.NamedExpr
) – AGnm.NamedExpr
pos (
Gnm.EvalPos
) – Position where evaluation takes placeflags (
Gnm.ExprEvalFlags
) –Gnm.ExprEvalFlags
flags describing context.
- Returns:
The resulting
GOffice.value
.- Return type:
- 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 theGOffice.workbook
in which the name is defined.- Return type:
- classmethod is_active(nexpr)¶
- Parameters:
nexpr (
Gnm.NamedExpr
) –- Return type:
- classmethod is_placeholder(ne)¶
- Parameters:
ne (
Gnm.NamedExpr
) –- Returns:
True
if ne is a placeholder for an unknown name- Return type:
- classmethod lookup(pos, name)¶
- Parameters:
pos (
Gnm.ParsePos
) –Gnm.ParsePos
identifying aGnm.Sheet
or aGnm.Workbook
.name (
str
) – name ofGnm.NamedExpr
to look up.
- Returns:
Gnm.NamedExpr
named name in the scope given by pos;None
if no suchGnm.NamedExpr
exists.- Return type:
- classmethod new(name)¶
- Parameters:
name (
str
) –- Return type:
Creates a new name without linking it into any container.
- classmethod perm_add(sheet, name, texpr, is_editable)¶
- Parameters:
sheet (
Gnm.Sheet
) –name (
str
) – nametexpr (
Gnm.ExprTop
) – string to be theGOffice.value
of the nameis_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:
- 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:
nexpr (
Gnm.NamedExpr
) –dep (
Gnm.Dependent
) –
- classmethod set_expr(nexpr, texpr)¶
- Parameters:
nexpr (
Gnm.NamedExpr
) –Gnm.NamedExpr
to changetexpr (
Gnm.ExprTop
orNone
) – the new contents
Set the content of nexpr to texpr.
- classmethod set_expr_undo_new(nexpr)¶
- Parameters:
nexpr (
Gnm.NamedExpr
) –Gnm.NamedExpr
- Return type:
- classmethod set_is_placeholder(nexpr, is_placeholder)¶
- Parameters:
nexpr (
Gnm.NamedExpr
) –is_placeholder (
bool
) –
- classmethod set_name(nexpr, new_name)¶
- Parameters:
nexpr (
Gnm.NamedExpr
) – the named expressionnew_name (
str
) – the new name of the expression
- Returns:
True
on error.- Return type:
- classmethod set_pos(nexpr, pp)¶
- Parameters:
nexpr (
Gnm.NamedExpr
) – the named expressionpp (
Gnm.ParsePos
) – the new position
- Return type:
Returns a translated error string which the caller must free if something goes wrong.
- classmethod unref(nexpr)¶
- Parameters:
nexpr (
Gnm.NamedExpr
) –