G'day,
Hi. I'm new to jython/python and am trying to interface a jython
script with some java code that produces property change events.
Here's the jython code:
import sys;
from javax import swing;
from java.beans import PropertyChangeL istener;
from gov.nasa.gsfc.i rc.instrument import InstrumentModel Provider;
class irchooks(Proper tyChangeListene r):
def propertyChange( self, e):
print "Property Change:";
print e;
print self;
def __init__(self):
self.modelProvi der = InstrumentModel Provider.getIns tance()
self.model = self.modelProvi der.getInstrume nt("Detector")
print "Sample Rate: "
print self.model.getF ramePeriod();
self.model.addP ropertyChangeLi stener(self);
print "Generate a property change event"
self.model.setF ramePeriod(0.21 5);
Then when I try running this code from the application ( via the bean
scripting framework ), I keep getting these errors:
Sample Rate:
0.001
Traceback (innermost last):
File "<string>", line 37, in ?
File "<string>", line 33, in __init__
TypeError: propertyChange( ) too many arguments; expected 1 got 2
Exception in backgrounded command procedure: PropertChangeTe st
exception from JPython: Traceback (innermost last):
File "<string>", line 37, in ?
File "<string>", line 33, in __init__
TypeError: propertyChange( ) too many arguments; expected 1 got 2
: Traceback (innermost last):
File "<string>", line 37, in ?
File "<string>", line 33, in __init__
TypeError: propertyChange( ) too many arguments; expected 1 got 2
Huh? Any ideas?
Thanks.
Matt Newcomb
Yerkes Observatory
373 W. Geneva St.
Williams Bay, WI
53191
Hi. I'm new to jython/python and am trying to interface a jython
script with some java code that produces property change events.
Here's the jython code:
import sys;
from javax import swing;
from java.beans import PropertyChangeL istener;
from gov.nasa.gsfc.i rc.instrument import InstrumentModel Provider;
class irchooks(Proper tyChangeListene r):
def propertyChange( self, e):
print "Property Change:";
print e;
print self;
def __init__(self):
self.modelProvi der = InstrumentModel Provider.getIns tance()
self.model = self.modelProvi der.getInstrume nt("Detector")
print "Sample Rate: "
print self.model.getF ramePeriod();
self.model.addP ropertyChangeLi stener(self);
print "Generate a property change event"
self.model.setF ramePeriod(0.21 5);
Then when I try running this code from the application ( via the bean
scripting framework ), I keep getting these errors:
Sample Rate:
0.001
Traceback (innermost last):
File "<string>", line 37, in ?
File "<string>", line 33, in __init__
TypeError: propertyChange( ) too many arguments; expected 1 got 2
Exception in backgrounded command procedure: PropertChangeTe st
exception from JPython: Traceback (innermost last):
File "<string>", line 37, in ?
File "<string>", line 33, in __init__
TypeError: propertyChange( ) too many arguments; expected 1 got 2
: Traceback (innermost last):
File "<string>", line 37, in ?
File "<string>", line 33, in __init__
TypeError: propertyChange( ) too many arguments; expected 1 got 2
Huh? Any ideas?
Thanks.
Matt Newcomb
Yerkes Observatory
373 W. Geneva St.
Williams Bay, WI
53191