def gtkformat_factory(format, colnum):
 if (format is None):
  return None
 format = copy.copy(format)
 format.xalign = 0.0
 format.cell = None
 def negative_red_cell(column, cell, model, thisiter):
  val = model.get_value(thisiter, colnum)
  try:
   val = float(val)
  except:
   cell.set_property(u'foreground', u'black')
  else:
   if (val < 0):
    cell.set_property(u'foreground', u'red')
   else:
    cell.set_property(u'foreground', u'black')
 if (isinstance(format, mlab.FormatFloat) or isinstance(format, mlab.FormatInt)):
  format.cell = negative_red_cell
  format.xalign = 1.0
 elif isinstance(format, mlab.FormatDate):
  format.xalign = 1.0
 return format

def gtkformat_factory ( format , colnum ) : if ( format is None ) : return None format = copy . copy ( format ) format . xalign = 0.0 format . cell = None def negative_red_cell ( column , cell , model , thisiter ) : val = model . get_value ( thisiter , colnum ) try : val = float ( val ) except : cell . set_property ( u'foreground' , u'black' ) else : if ( val < 0 ) : cell . set_property ( u'foreground' , u'red' ) else : cell . set_property ( u'foreground' , u'black' ) if ( isinstance ( format , mlab . FormatFloat ) or isinstance ( format , mlab . FormatInt ) ) : format . cell = negative_red_cell format . xalign = 1.0 elif isinstance ( format , mlab . FormatDate ) : format . xalign = 1.0 return format
copy the format .