[chirp_devel] problem with class inheritance, calling parent method w/ super
Jens J.
Fri Sep 6 07:12:44 PDT 2013
This may be a general python understanding problem, but I am working on a VX2 driver, and subclassing from VX3.
I am then overriding get_features, trying to call super get_features, modify that a bit and return it. The problem is that my change to rf.valid_tuning_steps do not seem to be changing at all. I must be missing some nuance of python here.
class VX2Radio(vx3.VX3Radio):
....
def get_features(self):
rf = super(VX2Radio, self).get_features()
rf.has_bank = False
rf.has_bank_names = False
rf.valid_modes = list(set(VX2_MODES))
rf.valid_tuning_steps = list(VX2_STEPS)
rf.memory_bounds = (1, 1000)
return rf
....
Note, the mutation of rf.memory_bounds does take effect, but it's as if the valid_tuning_steps list in the UI is the original one (wrong order) from VX2Radio, not the one I'm assigning from VX2_STEPS list.
Any ideas or pointers for a pynewb
-Jens
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://intrepid.danplanet.com/pipermail/chirp_devel/attachments/20130906/1024347d/attachment-0001.html
More information about the chirp_devel
mailing list