Changeset 1107
- Timestamp:
- 12/14/06 05:43:13 (2 years ago)
- Files:
-
- gaphas/trunk/gaphas/canvas.py (modified) (3 diffs)
- gaphas/trunk/gaphas/constraint.py (modified) (3 diffs)
- gaphas/trunk/gaphas/decorators.py (modified) (2 diffs)
- gaphas/trunk/gaphas/tool.py (modified) (10 diffs)
- gaphas/trunk/gaphas/util.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
gaphas/trunk/gaphas/canvas.py
r1075 r1107 11 11 pygtk.require('2.0') 12 12 13 import logging 13 14 from gaphas import tree 14 15 from gaphas import solver … … 348 349 item.pre_update(c) 349 350 except Exception, e: 350 print 'Error while updating item %s' % item 351 import traceback 352 traceback.print_exc() 351 logging.error('Error while updating item %s', item, exc_info=e) 353 352 354 353 self.update_matrices() … … 371 370 item.update(c) 372 371 except Exception, e: 373 print 'Error while updating item %s' % item 374 import traceback 375 traceback.print_exc() 372 logging.error('Error while updating item %s', item, exc_info=e) 376 373 377 374 finally: gaphas/trunk/gaphas/constraint.py
r1045 r1107 25 25 __version__ = "$Revision$" 26 26 # $HeadURL$ 27 28 import logging 29 27 30 28 31 class Constraint(object): … … 222 225 close_flag = False 223 226 if n > ITERLIMIT: 224 print "Failed to converge; exceeded iteration limit"227 logging.warn("Failed to converge; exceeded iteration limit") 225 228 break 226 229 slope = (fx1 - fx0) / (x1 - x0) … … 229 232 break 230 233 else: 231 print 'Zero slope and not close enough to solution'234 logging.warn('Zero slope and not close enough to solution') 232 235 break 233 236 x2 = x0 - fx0 / slope # New 'x1' gaphas/trunk/gaphas/decorators.py
r949 r1107 87 87 elif not self.single: 88 88 def async_wrapper(): 89 if DEBUG_ASYNC: print 'async:', func, args, kwargs89 #if DEBUG_ASYNC: print 'async:', func, args, kwargs 90 90 func(*args, **kwargs) 91 91 gobject.idle_add(async_wrapper, priority=self.priority) … … 98 98 except AttributeError, e: 99 99 def async_wrapper(): 100 if DEBUG_ASYNC: print 'async:', func, args, kwargs100 #if DEBUG_ASYNC: print 'async:', func, args, kwargs 101 101 try: 102 102 func(*args, **kwargs) gaphas/trunk/gaphas/tool.py
r1092 r1107 59 59 on_button_release 60 60 """ 61 if DEBUG_TOOL: print 'on_button_press', context, event61 #if DEBUG_TOOL: print 'on_button_press', context, event 62 62 63 63 def on_button_release(self, context, event): … … 65 65 Not that double and tripple clicks'... 66 66 """ 67 if DEBUG_TOOL: print 'on_button_release', context, event67 #if DEBUG_TOOL: print 'on_button_release', context, event 68 68 pass 69 69 … … 72 72 on the View. 73 73 """ 74 if DEBUG_TOOL: print 'on_double_click', context, event74 #if DEBUG_TOOL: print 'on_double_click', context, event 75 75 pass 76 76 … … 79 79 on the View. 80 80 """ 81 if DEBUG_TOOL: print 'on_triple_click', context, event81 #if DEBUG_TOOL: print 'on_triple_click', context, event 82 82 pass 83 83 … … 85 85 """Mouse (pointer) is moved. 86 86 """ 87 if DEBUG_TOOL: print 'on_motion_notify', context, event87 #if DEBUG_TOOL: print 'on_motion_notify', context, event 88 88 pass 89 89 … … 91 91 """Keyboard key is pressed. 92 92 """ 93 if DEBUG_TOOL: print 'on_key_press', context, event93 #if DEBUG_TOOL: print 'on_key_press', context, event 94 94 pass 95 95 … … 97 97 """Keyboard key is released again (follows a key press normally). 98 98 """ 99 if DEBUG_TOOL: print 'on_key_release', context, event99 #if DEBUG_TOOL: print 'on_key_release', context, event 100 100 pass 101 101 … … 159 159 def grab(self, tool): 160 160 if not self._grabbed_tool: 161 if DEBUG_TOOL_CHAIN: print 'Grab tool', tool161 #if DEBUG_TOOL_CHAIN: print 'Grab tool', tool 162 162 self._grabbed_tool = tool 163 163 164 164 def ungrab(self, tool): 165 165 if self._grabbed_tool is tool: 166 if DEBUG_TOOL_CHAIN: print 'UNgrab tool', self._grabbed_tool166 #if DEBUG_TOOL_CHAIN: print 'UNgrab tool', self._grabbed_tool 167 167 self._grabbed_tool = None 168 168 … … 177 177 else: 178 178 for tool in self._tools: 179 if DEBUG_TOOL_CHAIN: print 'tool', tool179 #if DEBUG_TOOL_CHAIN: print 'tool', tool 180 180 context.set_tool(tool) 181 181 rt = getattr(tool, func)(context, event) … … 574 574 def _on_key_press_event(self, widget, event, buffer): 575 575 if event.keyval == gtk.keysyms.Return: 576 print 'Enter!'576 #print 'Enter!' 577 577 #widget.get_toplevel().destroy() 578 578 elif event.keyval == gtk.keysyms.Escape: 579 print 'Escape!'579 #print 'Escape!' 580 580 widget.get_toplevel().destroy() 581 581 582 582 def _on_focus_out_event(self, widget, event, buffer): 583 print 'focus out!', buffer.get_text(buffer.get_start_iter(), buffer.get_end_iter())583 #print 'focus out!', buffer.get_text(buffer.get_start_iter(), buffer.get_end_iter()) 584 584 widget.destroy() 585 585 gaphas/trunk/gaphas/util.py
r1103 r1107 78 78 #cr.move_to(x, y) 79 79 for line in text.split('\n'): 80 print 'line', line80 #print 'line', line 81 81 x_bear, y_bear, w, h, x_adv, y_adv = cr.text_extents(line) 82 82 cr.move_to(x, y)
