Revision: 7505
          http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7505&view=rev
Author:   efiring
Date:     2009-08-18 22:18:59 +0000 (Tue, 18 Aug 2009)

Log Message:
-----------
Small cleanup of logic in handling drawstyle in Line2D

Modified Paths:
--------------
    trunk/matplotlib/lib/matplotlib/lines.py

Modified: trunk/matplotlib/lib/matplotlib/lines.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/lines.py    2009-08-18 22:13:11 UTC (rev 
7504)
+++ trunk/matplotlib/lib/matplotlib/lines.py    2009-08-18 22:18:59 UTC (rev 
7505)
@@ -99,6 +99,8 @@
     drawStyles = {}
     drawStyles.update(_drawStyles_l)
     drawStyles.update(_drawStyles_s)
+    # Need a list ordered with long names first:
+    drawStyleKeys = _drawStyles_l.keys() + _drawStyles_s.keys()
 
     markers = _markers =  {  # hidden names deprecated
         '.'  : '_draw_point',
@@ -712,15 +714,14 @@
         any drawstyle in combination with a linestyle, e.g. 'steps--'.
         """
 
-        # handle long drawstyle names before short ones !
-        for ds in flatten([k.keys() for k in (self._drawStyles_l,
-                self._drawStyles_s)], is_string_like):
+        for ds in self.drawStyleKeys:  # long names are first in the list
             if linestyle.startswith(ds):
                 self.set_drawstyle(ds)
                 if len(linestyle) > len(ds):
                     linestyle = linestyle[len(ds):]
                 else:
                     linestyle = '-'
+                break
 
         if linestyle not in self._lineStyles:
             if linestyle in ls_mapper:


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
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-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins

Reply via email to