On Sat, Aug 29, 2009 at 10:45:31PM -0500, John Hunter wrote:
> I've tried to apply your code properly.  Because it was not a patch,
> but a simple code file submission (and the original files have changed
> since your submission) and because I did not write the original ginput
> code, it was touch sledding to apply the patch.  I think I got it
> right, but I would like people who use ginput and blocking input to
> give it a test drive (I did what basic tests I could, not being a
> power user).

Thank John you for doing the grunt work. It pushed me enough to do the
review that you had asked for. I am attaching a patch correcting a bug,
as well as improving the docs, and fixing a few unecessary imports.

As a side note, you guys should run pyflakes on your codebase every once
in a while. You have a lot of unused imports. Also, there seems to be
bigger problems such as

    finance.py:169: undefined name 'url'
    font_manager.py:221: undefined name 'WindowsError'
    config/checkdep.py:67: undefined name 'verbose'
    cbook.py:787: undefined name '__Full'
    cbook.py:1414: undefined name 'glob'
    cbook.py:1577: undefined name 'x'
    cbook.py:1577: undefined name 'y'
    cbook.py:1577: undefined name 'xi'
    cbook.py:1577: undefined name 'extrap'

And many others that I am passing.

These might be bugs, or might not. I didn't take the time to check.

Cheers,

Gaƫl
Index: blocking_input.py
===================================================================
--- blocking_input.py	(revision 7596)
+++ blocking_input.py	(working copy)
@@ -17,9 +17,6 @@
     Note: Subclass of BlockingMouseInput.  Used by clabel
 """
 
-import time
-import numpy as np
-
 from matplotlib import path, verbose
 from matplotlib.cbook import is_sequence_of_strings
 
@@ -151,7 +148,7 @@
         button = event.button
 
         if button == self.button_pop:
-            self.mouse_event_pop(event,-1)
+            self.mouse_event_pop(event)
         elif button == self.button_stop:
             self.mouse_event_stop(event)
         else:
@@ -162,7 +159,7 @@
         Process a key click event.  This maps certain keys to appropriate
         mouse click events.
         '''
-        
+
         event = self.events[-1]
         key = event.key.lower()
 
Index: figure.py
===================================================================
--- figure.py	(revision 7596)
+++ figure.py	(working copy)
@@ -12,12 +12,11 @@
 
 """
 import numpy as np
-import time
 
 import artist
 from artist import Artist, allow_rasterization
 from axes import Axes, SubplotBase, subplot_class_factory
-from cbook import flatten, allequal, Stack, iterable, dedent
+from cbook import flatten, allequal, Stack, iterable
 import _image
 import colorbar as cbar
 from image import FigureImage
@@ -1114,6 +1113,12 @@
 
         Right clicking cancels last input.
 
+        The buttons used for the various actions (adding points, removing
+        points, terminating the inputs) can be overriden via the
+        arguments *mouse_add*, *mouse_pop* and *mouse_stop*, that give
+        the associated mouse button: 1 for left, 2 for middle, 3 for
+        right.
+
         The keyboard can also be used to select points in case your mouse
         does not have one or more of the buttons.  The delete and backspace
         keys act like right clicking (i.e., remove last point), the enter key
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Reply via email to