77from Orange .preprocess import Randomize
88from Orange .widgets .settings import Setting
99from Orange .widgets .utils .widgetpreview import WidgetPreview
10+ from Orange .widgets .utils .state_summary import format_summary_details
1011from Orange .widgets .widget import OWWidget , Input , Output
1112from Orange .widgets import gui
1213
@@ -68,7 +69,7 @@ def __init__(self):
6869 callback = self ._shuffle_check_changed )
6970
7071 self .info .set_input_summary (self .info .NoInput )
71- self .info .set_output_summary (self .info .NoInput )
72+ self .info .set_output_summary (self .info .NoOutput )
7273
7374 self .apply_button = gui .auto_apply (self .controlArea , self , box = False , commit = self .apply )
7475
@@ -89,9 +90,10 @@ def _set_scope_label(self):
8990 @Inputs .data
9091 def set_data (self , data ):
9192 self .data = data
93+ summary = len (data ) if data else self .info .NoInput
94+ details = format_summary_details (data ) if data else ""
95+ self .info .set_input_summary (summary , details )
9296 self .unconditional_apply ()
93- text = str (len (data )) if data else self .info .NoInput
94- self .info .set_input_summary (text )
9597
9698 def apply (self ):
9799 data = None
@@ -105,8 +107,9 @@ def apply(self):
105107 data = self .data .copy ()
106108 for i , instance in zip (indices , randomized ):
107109 data [i ] = instance
108- text = str (len (data )) if data else self .info .NoInput
109- self .info .set_output_summary (text )
110+ summary = len (data ) if data else self .info .NoOutput
111+ details = format_summary_details (data ) if data else ""
112+ self .info .set_output_summary (summary , details )
110113 self .Outputs .data .send (data )
111114
112115 def send_report (self ):
0 commit comments