Changeset 4971:694e836495cb in orange


Ignore:
Timestamp:
07/15/08 09:45:05 (6 years ago)
Author:
miha <miha.stajdohar@…>
Branch:
default
Convert:
cc2191451578a95a71780da850579439bd0a9eb1
Message:

distance matrix support added

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orange/OrangeWidgets/Prototypes/OWPythonScript.py

    r4960 r4971  
    1818        OWWidget.__init__(self, parent, signalManager, 'Python Script') 
    1919         
    20         self.inputs = [("inExampleTable", ExampleTable, self.setExampleTable), ("inNetwork", orangeom.Network, self.setNetwork)] 
    21         self.outputs = [("outExampleTable", ExampleTable), ("outNetwork", orangeom.Network)] 
     20        self.inputs = [("inExampleTable", ExampleTable, self.setExampleTable), ("inDistanceMatrix", orange.SymMatrix, self.setDistanceMatrix), ("inNetwork", orangeom.Network, self.setNetwork)] 
     21        self.outputs = [("outExampleTable", ExampleTable), ("outDistanceMatrix", orange.SymMatrix), ("outNetwork", orangeom.Network)] 
    2222         
    2323        self.inNetwork = None 
    2424        self.inExampleTable = None 
     25        self.inDistanceMatrix = None 
    2526        self.codeFile = '' 
    2627         
     
    2829         
    2930        self.infoBox = OWGUI.widgetBox(self.controlArea, 'Info') 
    30         OWGUI.label(self.infoBox, self, "Execute python script.\n\nInput variables:\n - inExampleTable\n - inNetwork\n\nOutput variables:\n - outExampleTable\n - outNetwork") 
     31        OWGUI.label(self.infoBox, self, "Execute python script.\n\nInput variables:\n - inExampleTable\n - inDistanceMatrix\n - inNetwork\n\nOutput variables:\n - outExampleTable\n - outDistanceMatrix\n - outNetwork") 
    3132         
    3233        self.controlBox = OWGUI.widgetBox(self.controlArea, 'File') 
     
    4647        self.text.setFont(QFont("Monospace")) 
    4748        self.textBox.setAlignment(Qt.AlignVCenter) 
     49        self.text.setTabStopWidth(4) 
    4850         
    4951        self.consoleBox = OWGUI.widgetBox(self, 'Console') 
     
    5355        self.console.setFont(QFont("Monospace")) 
    5456        self.consoleBox.setAlignment(Qt.AlignBottom) 
     57        self.console.setTabStopWidth(4) 
    5558         
    5659        self.openScript(self.codeFile) 
     
    6164    def setExampleTable(self, et): 
    6265        self.inExampleTable = et 
     66         
     67    def setDistanceMatrix(self, dm): 
     68        self.inDistanceMatrix = dm 
    6369         
    6470    def setNetwork(self, net): 
     
    98104            code = self.text.toPlainText() 
    99105            inExampleTable = self.inExampleTable 
     106            inDistanceMatrix = self.inDistanceMatrix 
    100107            inNetwork = self.inNetwork 
     108             
    101109            outExampleTable = None 
     110            outDistanceMatrix = None 
    102111            outNetwork = None 
    103112             
     
    105114             
    106115            self.send("outExampleTable", outExampleTable) 
     116            self.send("outDistanceMatrix", outDistanceMatrix) 
    107117            self.send("outNetwork", outNetwork) 
    108118 
Note: See TracChangeset for help on using the changeset viewer.