Project

General

Profile

Actions

Bug #1576

closed

The way to overwrite a function in the subclass called by its parent class in a different python module

Added by Anchi Cheng over 12 years ago. Updated about 11 years ago.

Status:
Closed
Priority:
Low
Assignee:
Category:
ImagePanel
Start date:
03/05/2012
Due date:
% Done:

0%

Estimated time:
Affected Version:
Appion/Leginon 2.1.0
Show in known bugs:
No
Workaround:

Description

Ran into this problem often in leginon/gui/wx

The example here is RasterFCFinder.py and RasterFinder.py Both contains Panel,FinalSettingsDialog, and FinalScrolledSettings classes and those in RasterFCFinder.py are subclass of the corresponding classes in RasterFinder.py.

Since FinalSettingsDialog and FinalScrolledSettings are only called from Panel Class method, when RasterRCFinder node is open in Leginon, its Panel class is directed to the parent Panel class in RasterFinder.py and when FinalSettingsDialog class is constructed, it ended up construct from RasterFInder.py not RasterFCFinder.py

Most of our code ended up reproduce the parent class code in the subclass module, which is not the best solution.

Actions

Also available in: Atom PDF