Changeset 7845:4a5e519007e2 in orange


Ignore:
Timestamp:
04/15/11 11:49:19 (3 years ago)
Author:
janezd <janez.demsar@…>
Branch:
default
Convert:
d57a76dbf331125f5229e47998a5595ca09fbc23
Message:

Data Table now also outputs unselected examples

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orange/OrangeWidgets/Data/OWDataTable.py

    r7045 r7845  
    135135 
    136136        self.inputs = [("Examples", ExampleTable, self.dataset, Multiple + Default)] 
    137         self.outputs = [("Selected Examples", ExampleTable)] 
     137        self.outputs = [("Selected Examples", ExampleTable, Default), ("Unselected Examples", ExampleTable)] 
    138138 
    139139        self.data = {}          # key: id, value: ExampleTable 
     
    559559            model = table.model() 
    560560            selected = self.getCurrentSelection() 
    561             data = model.examples.select([1 if i in selected else 0 for i in range(len(model.examples))]) 
     561            selection = [1 if i in selected else 0 for i in range(len(model.examples))] 
     562            data = model.examples.select(selection) 
    562563            self.send("Selected Examples", data if len(data) > 0 else None) 
     564            data = model.examples.select(selection, 0) 
     565            self.send("Unselected Examples", data if len(data) > 0 else None) 
    563566        else: 
    564567            self.send("Selected Examples", None) 
     568            self.send("Unselected Examples", None) 
    565569             
    566570        self.selectionChangedFlag = False 
Note: See TracChangeset for help on using the changeset viewer.