File: //usr/share/inkscape/extensions/simplepath.pyo
�
��Yc @ s� d Z d d l Z d d l Z d � Z i
d d e e g d d g g d 6d d e e g d d g g d 6d d
e g d g g d 6d d
e g d g g d 6d d
e e e e e e g d d d d d d g g d 6d d e e e e g d d d d g g d 6d d e e e e g d d d d g g d 6d d e e g d d g g d 6d d e e e e e e e g d d d d d d d g g d 6d d g g g d 6Z d � Z d � Z d � Z d � Z
d d d � Z d S( s'
simplepath.py
functions for digesting paths into a simple list structure
Copyright (C) 2005 Aaron Spike, aaron@ekips.org
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
i����Nc c s
d } t | � } t j d � } t j d � } t j d � } x� | j | | � } | ri | j � } n | | k ry Pn | j | | � } | r� | | | j � !t g V| j � } qB n | j | | � } | r� | | | j � !t g V| j � } qB n t d � qB d S( sa
returns and iterator that breaks path data
identifies command and parameter tokens
i s [ \t\r\n,]+s [MLHVCSQTAZmlhvcsqtaz]s: (([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)s Invalid path data!N( t lent ret compilet matcht endt Truet Falset Exception( t dt offsett lengtht delimt commandt parametert m( ( s, /usr/share/inkscape/extensions/simplepath.pyt lexPath s, t Li t xt yt Mt Hi t Vt Ci t Si t Qt Tt Ai t rt ai t st Zc C s� g } t | � } d } | } | } d } xVy | j � \ } } Wn t k
rW Pn Xg } t }
| r� | r� | j � d k r� t d � q� | } nO t }
| r� | j � r� t | d } q� t | j � d j � } n t d � t | j � d } x| d k r|
rXy( | j � \ } } | r7t d � n WqXt k
rTt d � qXXn t | j � d
| }
|
| � } | j
� r�t | j � d | d k r�| | d 7} q�t | j � d | d
k r�| | d 7} q�n | j | � t }
| d 8} q� W| j � } | d k rq| d k rE| j | d � n | d k rh| j d | d � n d } n | d k r�| j d | d | d | d � | j d | d | d | d � | d k r�d } n | d k r�d } q�n | d k rt
| d d
!� } | } n | d k r/| } n t
| d � } | d k rat
| d d !� } n | } | } | j | | g � q- | S( s�
Parse SVG path and return an array of segments.
Removes all shorthand notation.
Converts coordinates to absolute.
g t R s% Invalid path, must begin with moveto.i s! Invalid path, no initial command.i s Invalid number of parameterss Unexpected end of pathi i R R R R R R R R R R i����i����( g g ( R R ( R R ( R R ( R t nextt
StopIterationR t upperR R t isuppert pathdefst lowert islowert appendt insertt tuple( R t retvalt lexert pent subPathStartt lastControlt lastCommandt tokent isCommandt paramst needParamR t numParamst castt paramt
outputCommand( ( s, /usr/share/inkscape/extensions/simplepath.pyt parsePathI s�
$$ c C sL d j g | D]8 \ } } | d j g | D] } t | � ^ q) � ^ q
� S( s"