Commit 53bf4f80 authored by Morten Welinder's avatar Morten Welinder

Introspection: add gi.overrides module for Gnm.py

This isn't installed yet.  It therefore won't get loaded unless the
test .pl wrappers are used.
parent 8866c3e4
SUBDIRS = . po po-functions src plugins icons @COMPONENT_DIR@ templates doc tools schemas test
SUBDIRS = . po po-functions src plugins icons @COMPONENT_DIR@ templates doc tools schemas test introspection
XML_I18N_XML_KIND = --pass-through
......
......@@ -1172,6 +1172,7 @@ icons/48x48/actions/Makefile
icons/48x48/apps/Makefile
icons/256x256/Makefile
icons/256x256/apps/Makefile
introspection/Makefile
src/Makefile
src/dialogs/Makefile
src/widgets/Makefile
......
Makefile.in
Makefile
*~
EXTRA_DIST = README \
gi/overrides/Gnm.py \
gi/overrides/__init__.py
......@@ -189,7 +189,8 @@ PasteFlags: [Enum]
NO_RECALC
FLIP_H
FLIP_V
ALL_TYPES
ALL_CELL
ALL_SHEET
DEFAULT
......
from ..overrides import override
from ..module import get_introspection_module
Gnm = get_introspection_module('Gnm')
__all__ = []
# ----------------------------------------------------------------------------
class Range(Gnm.Range):
def __new__(cls,start_col=0,start_row=0,end_col=None,end_row=None):
if end_col is None: end_col = start_col
if end_row is None: end_row = start_row
r = Gnm.Range.__new__(cls)
r.init(start_col,start_row,end_col,end_row)
return r
def __init__(cls,*argv):
pass
def __str__(self):
return self.as_string()
Range = override(Range)
__all__.append('Range')
# ----------------------------------------------------------------------------
def _valuetype_str(vt):
return vt.value_name
Gnm.ValueType.__str__ = _valuetype_str
class Value(Gnm.Value):
def __str__(self):
return self.type_of().value_name + ":" + self.get_as_string()
Value = override(Value)
__all__.append('Value')
# ----------------------------------------------------------------------------
......@@ -275,9 +275,9 @@ sub test_command {
print STDERR "# $cmd\n" if $verbose;
my $output = `$cmd 2>&1`;
my $err = $?;
&dump_indented ($output);
die "Failed command: $cmd\n" if $err;
&dump_indented ($output);
local $_ = $output;
if (&$test ($output)) {
print STDERR "Pass\n";
......@@ -900,6 +900,11 @@ sub setup_python_environment {
$v = 'LD_LIBRARY_PATH';
$dir = "$top_builddir/src/.libs";
$ENV{$v} = ($ENV{$v} || '') eq '' ? $dir : $dir . ':' . $ENV{$v};
$ENV{'PYTHONPATH'} = "$topsrc/introspection";
# Don't litter
$ENV{'PYTHONDONTWRITEBYTECODE'} = 1;
}
# -----------------------------------------------------------------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment