/[ascend]/trunk/pygtk/incidencematrix.py
ViewVC logotype

Diff of /trunk/pygtk/incidencematrix.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1664 by jpye, Mon Jun 4 13:10:01 2007 UTC revision 1665 by jpye, Mon Dec 17 00:45:59 2007 UTC
# Line 59  class IncidenceMatrixWindow: Line 59  class IncidenceMatrixWindow:
59    
60      def incidence_get_coord_str(self,x,y):      def incidence_get_coord_str(self,x,y):
61                    
62              _col = int(x)              _col = int(x+0.5)
63              _row = (self.im.getNumRows()-1) - int(y)              _row = int(y+0.5)
64    
65    
66              try:              try:
67                  if self.data[_row, _col] == 0:                  if self.data[_row, _col] == 0:
68                        #print "nothing here"
69                      return ""                      return ""
70            
71                  if self.lastrow != None and self.lastcol != None:                  if self.lastrow != None and self.lastcol != None:
# Line 74  class IncidenceMatrixWindow: Line 76  class IncidenceMatrixWindow:
76                  _rel = self.im.getRelation(_row);                  _rel = self.im.getRelation(_row);
77                  _blk = self.im.getBlockRow(_row);                  _blk = self.im.getBlockRow(_row);
78              except IndexError:              except IndexError:
79                  return                  return "[out of range]"
80    
81                print "row = %d, col = %d" % (_row,_col)
82    
83              self.lastrow = _row;              self.lastrow = _row;
84              self.lastcol = _col;              self.lastcol = _col;
85              self.lastmsg = "rel '%s', var '%s': block %d" %(_rel,_var,_blk)              self.lastmsg = "rel '%s', var '%s': block %d" %(_rel,_var,_blk)
86                print self.lastmsg
87              return self.lastmsg              return self.lastmsg
88    

Legend:
Removed from v.1664  
changed lines
  Added in v.1665

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22