Beispiel #1
0
    def display_data(self,
                     trans,
                     data,
                     preview=False,
                     filename=None,
                     to_ext=None,
                     size=None,
                     offset=None,
                     **kwd):
        """Documented as an old display method, but still gets called via tests etc

        This allows us to format the data shown in the central pane via the "eye" icon.
        """
        if filename is not None and filename != "index":
            #Change nothing - important for the unit tests to access child files:
            return Data.display_data(self, trans, data, preview, filename,
                                     to_ext, size, offset, **kwd)
        if self.file_ext == "blastdbn":
            title = "This is a nucleotide BLAST database"
        elif self.file_ext == "blastdbp":
            title = "This is a protein BLAST database"
        elif self.file_ext == "blastdbd":
            title = "This is a domain BLAST database"
        else:
            #Error?
            title = "This is a BLAST database."
        msg = ""
        try:
            #Try to use any text recorded in the dummy index file:
            handle = open(data.file_name, "rU")
            msg = handle.read().strip()
            handle.close()
        except Exception, err:
            #msg = str(err)
            pass
Beispiel #2
0
    def display_data(self, trans, data, preview=False, filename=None,
                     to_ext=None, size=None, offset=None, **kwd):
        """Documented as an old display method, but still gets called via tests etc

        This allows us to format the data shown in the central pane via the "eye" icon.
        """
        if filename is not None and filename != "index":
            # Change nothing - important for the unit tests to access child files:
            return Data.display_data(self, trans, data, preview, filename,
                                     to_ext, size, offset, **kwd)
        if self.file_ext == "blastdbn":
            title = "This is a nucleotide BLAST database"
        elif self.file_ext == "blastdbp":
            title = "This is a protein BLAST database"
        elif self.file_ext == "blastdbd":
            title = "This is a domain BLAST database"
        else:
            # Error?
            title = "This is a BLAST database."
        msg = ""
        try:
            # Try to use any text recorded in the dummy index file:
            handle = open(data.file_name, "rU")
            msg = handle.read().strip()
            handle.close()
        except Exception:
            pass
        if not msg:
            msg = title
        # Galaxy assumes HTML for the display of composite datatypes,
        return "<html><head><title>%s</title></head><body><pre>%s</pre></body></html>" % (title, msg)
Beispiel #3
0
    def display_data(self, trans, data, preview=False, filename=None,
                     to_ext=None, size=None, offset=None, **kwd):
        """Documented as an old display method, but still gets called via tests etc

        This allows us to format the data shown in the central pane via the "eye" icon.
        """
        if filename is not None and filename != "index":
            #Change nothing - important for the unit tests to access child files:
            return Data.display_data(self, trans, data, preview, filename,
                                     to_ext, size, offset, **kwd)
        if self.file_ext == "blastdbn":
            title = "This is a nucleotide BLAST database"
        elif self.file_ext =="blastdbp":
            title = "This is a protein BLAST database"
        else:
            #Error?                                                                                                                                                                     
            title = "This is a BLAST database."
        msg = ""
        try:
            #Try to use any text recorded in the dummy index file:
            handle = open(data.file_name, "rU")
            msg = handle.read().strip()
            handle.close()
        except Exception, err:
            #msg = str(err)
            pass
Beispiel #4
0
 def display_data(self, trans, data, preview=False, filename=None,
                  to_ext=None, size=None, offset=None, **kwd):
     """Documented as an old display method, but still gets called via tests etc
     This allows us to format the data shown in the central pane via the "eye" icon.
     """
     if filename is not None and filename != "index":
         # Change nothing - important for the unit tests to access child files:
         return Data.display_data(self, trans, data, preview, filename,
                                  to_ext, size, offset, **kwd)
     if self.file_ext == "ctbreport":
         title = "This is a CtbReports database"
     msg = ""
     try:
         # Try to use any text recorded in the dummy index file:
         handle = open(data.file_name, "rU")
         msg = handle.read().strip()
         handle.close()
     except Exception:
         pass
     if not msg:
         msg = title
     # Galaxy assumes HTML for the display of composite datatypes,
     return "<html><head><title>%s</title></head><body><pre>%s</pre></body></html>" % (title, msg)