Changeset 1859:6119125fa435 in orange-bioinformatics for _bioinformatics/widgets/OWSelectGenes.py


Ignore:
Timestamp:
10/04/13 11:06:22 (7 months ago)
Author:
Ales Erjavec <ales.erjavec@…>
Branch:
default
Children:
1860:504bc511801c, 1873:0810c5708cc5
Message:

Added report.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • _bioinformatics/widgets/OWSelectGenes.py

    r1858 r1859  
    22import unicodedata 
    33from collections import defaultdict, namedtuple 
     4from xml.sax.saxutils import escape 
    45 
    56from contextlib import contextmanager 
     
    395396        return OWWidget.getSettings(self, *args, **kwargs) 
    396397 
     398    def sendReport(self): 
     399        report = [] 
     400        if self.data is not None: 
     401            report.append("%i instances on input." % len(self.data)) 
     402        else: 
     403            report.append("No data on input.") 
     404 
     405        if self.geneVar is not None: 
     406            report.append("Gene names taken from %r attribute." % 
     407                          escape(self.geneVar.name)) 
     408 
     409        self.reportSection("Input") 
     410        self.startReportList() 
     411        for item in report: 
     412            self.addToReportList(item) 
     413        self.finishReportList() 
     414        self.reportRaw( 
     415            "<p>Gene Selection: %s</p>" % 
     416            escape(" ".join(self.selection)) 
     417        ) 
     418        self.reportSettings( 
     419            "Settings", 
     420            [("Preserve order", self.preserveOrder)] 
     421        ) 
     422 
    397423 
    398424def is_string(feature): 
Note: See TracChangeset for help on using the changeset viewer.