File: //usr/share/inkscape/extensions/guides_creator.pyc
�
��Yc @ s1 d Z d d l Z e j j d � d d l m Z d d l m Z d d l Z d d l
Td d l m Z d d l m Z d d l m Z d d l m Z d d l
Z
e
j
Z d � Z d
d � Z d
d � Z d
� Z d � Z d � Z d � Z d e j f d � � YZ e d k r-e � Z e j � n d S( s3
Guides Creator v2.31 (05/07/2009)
http://code.google.com/p/inkscape-guides-creator/
Copyright (C) 2008 Jonas Termeau - jonas.termeau **AT** gmail.com
Thanks to:
Bernard Gray - bernard.gray **AT** gmail.com (python helping)
Jamie Heames (english translation issues)
~suv (bug report in v2.3)
http://www.gutenberg.eu.org/publications/ (9x9 margins settings)
## This basic extension allows you to automatically draw guides in inkscape.
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; version 2 of the License.
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����Ns /usr/share/inkscape/extensions( t ElementTree( t sqrt( t *( t cos( t sinc C s t j t t | � � � d S( N( t inkext errormsgt _t str( t string( ( s0 /usr/share/inkscape/extensions/guides_creator.pyt
printDebugD s i c
C s� | d k r� | r d } n d } x� t d | d d | � D]` } t t | | | | | | | d � � d } t t | d � � d } t | | | � q= Wn d S( Ni i i i s ,0( t rangeR t roundt createGuide(
t divisiont wt ht edgest parentt vertical_shiftt vart vt positiont orientation( ( s0 /usr/share/inkscape/extensions/guides_creator.pyt drawVerticalGuidesG s "1c
C s� | d k r� | r d } n d } x� t d | d d | � D]` } d t t | | | | | | | d � � } d t t | d � � } t | | | � q= Wn d S( Ni i i s 0,i ( R R R R
(
R R R R R t horizontal_shiftR t xR R ( ( s0 /usr/share/inkscape/extensions/guides_creator.pyt drawHorizontalGuidesU s "1c C s( t j j | d i | d 6| d 6� d S( Ns9 {http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd}guideR R ( R t etreet
SubElement( R R R ( ( s0 /usr/share/inkscape/extensions/guides_creator.pyR
c s c C s# | j d � } t | d � } | S( Nt ;i ( t splitt int( t presett str_arrayt result( ( s0 /usr/share/inkscape/extensions/guides_creator.pyt getVerticalDivisionsFromPreseti s c C s# | j d � } t | d � } | S( NR i ( R R ( R! R"