Back to index

python-biopython  1.60
Public Member Functions | Public Attributes
xbb_blastbg.BlastDisplayer Class Reference

List of all members.

Public Member Functions

def __init__
def RunCommand
def UpdateResults
def Exit

Public Attributes

 command
 tid
 outfile
 worker

Detailed Description

Definition at line 15 of file xbb_blastbg.py.


Constructor & Destructor Documentation

def xbb_blastbg.BlastDisplayer.__init__ (   self,
  command,
  text_id = None 
)

Definition at line 16 of file xbb_blastbg.py.

00016 
00017     def __init__(self, command, text_id = None):
00018         self.command = command
00019         self.tid = text_id
        

Member Function Documentation

Definition at line 53 of file xbb_blastbg.py.

00053 
00054     def Exit(self):
00055         if os.path.exists(self.outfile):
00056             os.remove(self.outfile)
00057 
00058         # do I need to stop the queue ?
00059         self.worker.shutdown()
00060         del self.worker
00061         
        

Here is the caller graph for this function:

Definition at line 20 of file xbb_blastbg.py.

00020 
00021     def RunCommand(self):
00022         self.outfile = tempfile.mktemp()
00023 
00024         # make sure outfile exists and is empty
00025         fid = open(self.outfile,'w+'); fid.close()
00026         
00027         com = '%s > %s' % (self.command, self.outfile)
00028 
00029         self.worker = BlastWorker(com)
00030         self.worker.start()
00031         self.UpdateResults()
        

Definition at line 32 of file xbb_blastbg.py.

00032 
00033     def UpdateResults(self):
00034         # open the oufile and displays new appended text
00035         fid = open(self.outfile)
00036         size = 0
00037         while 1:
00038             if self.worker.finished: break
00039             fid.seek(size)
00040             txt = fid.read()
00041             size = os.stat(self.outfile)[6]
00042             try:
00043                 self.tid.insert(END, txt)
00044                 self.tid.update()
00045             except:
00046                 # text widget is detroyed, we assume the search
00047                 # has been cancelled
00048                 break
00049 
00050         fid.close()
00051         self.Exit()            
00052         

Here is the call graph for this function:


Member Data Documentation

Definition at line 17 of file xbb_blastbg.py.

Definition at line 21 of file xbb_blastbg.py.

Definition at line 18 of file xbb_blastbg.py.

Definition at line 28 of file xbb_blastbg.py.


The documentation for this class was generated from the following file: