HEX
Server: Apache
System: Linux opal14.opalstack.com 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64
User: curbgloabal_opal (1234)
PHP: 8.1.29
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //usr/share/inkscape/extensions/hpgl_decoder.pyo
�
��Yc@sEdZddlZddlmZddlZddd��YZdS(s�
Copyright (C) 2013 Sebastian Wüst, sebi@timewaster.de

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����N(tStringIOthpglDecodercBs#eZd�Zd�Zd�ZRS(cCs{||_||_|jd|_|jd|_d|_td�|_td�|_	i|_
d|jjf|_dS(s� options:
                "resolutionX":float
                "resolutionY":float
                "showMovements":bool
                "docWidth":float
                "docHeight":float
        gffffff9@tt	MovementssPen gN(
t
hpglStringtoptionstresolutionXtscaleXtresolutionYtscaleYtwarningt_t
textMovementst
textPenNumbertlayerst	docHeighttoldCoordinates(tselfRR((s./usr/share/inkscape/extensions/hpgl_decoder.pyt__init__s				cCs;d}tjjtdtjddtjdd|jj|jj|jj|jjf��|_tjj	|jj
�tjdd�idtjd	d�6�|jjrtjj	|jj
�d
idtjdd�6|j
tjd
d�6|j
d6�|jd<n|jjd�}t|�dkrBtd��nx�t|�D]�\}}|j�dkrO|d dks$|d dks$|d dkr�q'|d dkr�t|d�}q'|d dkr�|j|ddt�q'|d dkr|j|d|dt�q'd|_qOqOW|j|jfS(Nis<svg xmlns:sodipodi="tsodipodis" xmlns:inkscape="tinkscapes7" width="%smm" height="%smm" viewBox="0 0 %s %s"></svg>t	namedviewtmmsdocument-unitstgtlayert	groupmodetlabeltidt;itNO_HPGL_DATARitINtFStVStSPtPUtPDitUNKNOWN_COMMANDS(tinkextetreetparseRtNSSRtdocWidthRtdoct
SubElementtgetroottaddNSt
showMovementsRRRtsplittlent	Exceptiont	enumeratetstriptinttparametersToPathtTruetFalseR
(RtactualLayerthpglDatatitcommand((s./usr/share/inkscape/extensions/hpgl_decoder.pytgetSvg/s*,5>^0cCs�|j�jd�}t|�dkr�t|�ddkr�xqt|�D]c\}}|ddkr�tt|�|j�||<qJt|jjt|�|j	�||<qJW|s�|jj
r�|r�y|j|Wn�tk
rct
jj|jj�didt
jdd�6|jt|d�t
jd	d�6|jt|d�d
6�|j|<nXd|jd|jddj|�f}t
jj|j|di|d
6d|r�dnddd6�nt|d�t|d�f|_ndS(Nt,iiRRRRiRRsM %f,%f L %stpathtdsstroke:#tff0000t000000s; stroke-width:0.2; fill:none;tstylei����i����(R3R/R0R2tstrtfloatRRRR	R.RtKeyErrorR%R&R+R*R,R-R
Rtjoin(Rt
parameterstlayerNumtisPUR:tparamR>((s./usr/share/inkscape/extensions/hpgl_decoder.pyR5Os( +
c*B(t__name__t
__module__RR<R5(((s./usr/share/inkscape/extensions/hpgl_decoder.pyRs		 ((t__doc__tmathRR%R(((s./usr/share/inkscape/extensions/hpgl_decoder.pyt<module>s