Ignore:
Timestamp:
11/28/12 17:58:51 (17 months ago)
Author:
Ales Erjavec <ales.erjavec@…>
Branch:
default
Message:

Fixed some errors caught by failing uniitests.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Orange/OrangeCanvas/canvas/scene.py

    r11207 r11210  
    375375        item.setSourceItem(source_item) 
    376376        item.setSinkItem(sink_item) 
    377         fmt = "<b>{0}</b>&nbsp;-->&nbsp;<b>{1}</b>" 
     377 
     378        def channel_name(channel): 
     379            if isinstance(channel, basestring): 
     380                return channel 
     381            else: 
     382                return channel.name 
     383 
     384        source_name = channel_name(source_channel) 
     385        sink_name = channel_name(sink_channel) 
     386 
     387        fmt = u"<b>{0}</b>&nbsp; \u2192 &nbsp;<b>{1}</b>" 
    378388        item.setToolTip( 
    379             fmt.format(escape(source_channel.name), 
    380                        escape(sink_channel.name)) 
     389            fmt.format(escape(source_name), 
     390                       escape(sink_name)) 
    381391        ) 
    382392 
    383         item.setSourceName(source_channel.name) 
    384         item.setSinkName(sink_channel.name) 
     393        item.setSourceName(source_name) 
     394        item.setSinkName(sink_name) 
    385395        item.setChannelNamesVisible(self.__channel_names_visible) 
    386396 
Note: See TracChangeset for help on using the changeset viewer.