Warning: session_start(): Session cannot be started after headers have already been sent in /home/tvrreohg/public_html/manga.php on line 13
3 Neb¥Xã@sDdZddlmZddlmZddlmZmZmZm Z m Z m Z m Z m Z mZmZmZmZmZddlTddlmZmZddlmZmZmZmZmZmZddlmZm Z dd lm!Z!dd l"m#Z#m$Z$dd l%m&Z&m'Z'dd l(m)Z)m*Z*m+Z+e,e)e*e+d �Z-ddl.m/Z0ddddddddddddddddd;di ddddddddddddddddddd6l?m@Z@Gd7d8„d8e@ƒZAGd9d:„d:e6ƒZBd!S)=z3.3.0é)Úcolors)Ú simpleSplit) ÚisNumberÚisNumberOrNoneÚOneOfÚ isColorOrNoneÚisStringÚ isTextAnchorÚ isBoxAnchorÚ isBooleanÚNoneOrÚ isInstanceOfÚisNoneOrStringÚisNoneOrCallableÚ isSubclassOf)Ú*)Ú stringWidthÚgetAscentDescent)ÚDrawingÚGroupÚCircleÚRectÚStringÚSTATE_DEFAULTS)ÚWidgetÚ PropHolder)Ú DirectDraw)Ú XPreformattedÚFlowable)ÚParagraphStyleÚ PropertySet)ÚTA_LEFTÚTA_RIGHTÚ TA_CENTER)ÚstartÚendÚmiddleé)Ú text2PathÚné-ÚneéZÚeé‡Úseé´ÚséáÚswiÚwi;Únw)ÚxÚy)ÚDirectDrawFlowableNr$r%r&) r4r5r3r-r+r/r)r1Úcc$@sÜeZdZdZeeedd�eedd�eedd�eedd�eedd�eedd�eedd�eed d�eed d�ee d d d dƒdd�eedd�eedd�eedd�ee dd�ee dd�eedd�ee dd�ee dd�ee dd�ee dd�ee dd�ee dd�eedd�eedd�eedd�eedd�ee dd�eed d!d"�eeeeƒd#ƒd$d!d"�eeeeƒd#ƒd%d!d"�eeeeƒeeƒfƒd&d!d"�d'�Zd(d)„Zd*d+„Zd,d-„Zd.d/„Zd0d1„Zd2d3„Zd4d5„Zd6d7„Zd8d9„Zd:d;„ZdS)?ÚLabelzïA text label to attach to something else, such as a chart axis. This allows you to specify an offset, angle and many anchor properties relative to the label's origin. It allows, for example, angled multiline axis labels. Ú)Údesczdelta x - offsetzdelta y - offsetzDangle of label: default (0), 90 is vertical, 180 is upside down, etczanchoring point of the labelzborder color of the boxz border widthzthe filling color of the boxÚnormalÚantiÚloÚhiz"one of ('normal','anti','lo','hi')zlabel text colorzlabel text border colorzlabel text border widthzthe actual text to displayzthe name of the font usedzthe size of the fontzthe width of the labelz#maximum width the label can grow tozthe height of the textz0the anchoring point of the text inside the labelz True if the label is to be drawnzpadding at top of boxzpadding at left of boxzpadding at right of boxzpadding at bottom of boxz^If True then the font's Ascent & Descent will be used to compute default heights and baseline.zDAn instance of CustomDrawChanger to modify the behavior at draw timeé)r<Z_advancedUsageZNoneOrDirectDrawzA DirectDrawFlowable instancez=A Flowable class for direct drawing (default is XPreformattedz-A style or style class for a ddfKlass or None)r6r7ÚdxÚdyÚangleÚ boxAnchorÚboxStrokeColorÚboxStrokeWidthÚ boxFillColorÚ boxTargetÚ fillColorÚ strokeColorÚ strokeWidthÚtextÚfontNameÚfontSizeÚleadingÚwidthÚmaxWidthÚheightÚ textAnchorÚvisibleÚ topPaddingÚ leftPaddingÚ rightPaddingÚ bottomPaddingÚuseAscentDescentÚcustomDrawChangerÚddfÚddfKlassÚddfStylec Ksb|jf|Ž|jddddddddddddddddddddtdtdtdd d d d tddd �dS)NzMulti-Line Stringr9rgà?r=rJrNrOgš™™™™™¹?r$rAF)Ú_textrErDr6r7rBrCrVrWrXrYrGrFrIrKrHrPrQrRrSrJrNrOrLrTrUrZr\r]r^)Z _setKeywordsrr8)ÚselfÚkw©rbúE/tmp/tmp4i9tl1d3/lib64/python/reportlab/graphics/charts/textlabels.pyÚ__init__Ms@ zLabel.__init__cCs ||_dS)zpSet the text property. May contain embedded newline characters. Called by the containing chart or axis.N)r_)r`rMrbrbrcÚsetTextpsz Label.setTextcCs||_||_dS)z‰Set the origin. This would be the tick mark or bar top relative to which it is defined. Called by the containing chart or axis.N)r6r7)r`r6r7rbrbrcÚ setOriginvszLabel.setOrigincCsltddƒ}|jtdddtjd�ƒtƒ}|jddƒd|_d|_d|_ d |_ tj|_ |j d ƒ|j|ƒ|S) zyThis shows a label positioned with its top right corner at the top centre of the drawing, and rotated 45 degrees.éÈédr,é)rJr+r*rézAnother Multi-Line Stringiìÿÿÿ) rÚaddrrZgreenr:rfrErDrBrCrFre)r`ÚdZlabrbrbrcÚdemo}s    z Label.democCst|j}|d krp|j}t|ddƒdd}|ds`||d}t|ƒdkr`||dkrZdp\d }t|d |}|S) z,hook for allowing special box anchor effectsÚautoxÚautoyihg€F@r*r,rirrA)rnroiÓÿÿÿéÿÿÿÿ)rErDÚintÚabsÚ_A2BA)r`ÚbarDÚnaÚdarbrbrcÚ _getBoxAnchor’s  zLabel._getBoxAnchorcCs<|jr2t|j|jƒ\|_|_|j|j|j|_nd|_dS)NrAg333333ó?g«ªªªªªê?)rZrrNrOÚ_ascentÚ_descentÚ_baselineRatio)r`rbrbrcÚ_getBaseLineRatioŸszLabel._getBaseLineRatiocCsØ|jp||j|j|_|j|j|j|_|j|j|j|_|j ƒ}|d kr\|j |_ n$|d krt|j|j|_ n d|j|_ |j |j|_ |d kr¦|j|j|_ n |d kr¸|j|_ n|j d|_ |j |j|_ dS)Nr)r+r5r1r3r/gà?r-r4)r)r+r5)r1r3r/)r+r-r/)r5r4r3)rSrVrYÚ_heightÚ_widthrWrXÚ_ewidthÚ_eheightrwÚ_topÚ_bottomÚ_leftÚ_right)r`ÚobjHrErbrbrcÚ_computeSizeEnd¦s    zLabel._computeSizeEndcs:tˆddƒ}|sÊgˆ_tˆjˆjˆjˆjƒˆ_ˆjstˆj ˆj ˆ_ ˆjr|‡fdd„ˆjDƒˆ_ˆj t ˆjƒ7_ nˆjˆ_ ˆj ƒˆjr”ˆjˆ_n"ˆjrªˆjˆjˆ_n ˆjdˆ_ˆjtˆjƒ}�nbˆjdkrÜtdƒ‚tdˆjˆjˆjˆjd�}ˆj�s tf|Ž}n&tˆjtƒ�r&ˆjf|Ž}n ˆjjƒ}|ˆ_ˆj ƒˆj�r\d|_ˆjˆj|_nˆj�rjˆjnˆjd|_|jˆ_ˆj ƒ}ˆj�p�d }|d k�rÎt!|_"|ˆj|d �}|j#|d ƒ\}}ˆj�pÌ|j$}t%||_"|ˆj|d �ˆ_&}|j#|d ƒ\}}ˆj�s$ˆj ˆj ˆ_ ˆj |j$7_ nˆjˆ_ ˆj'|ƒdS) Nr]csg|]}t|ˆjˆjƒ‘qSrb)rrNrO)Ú.0Úline)r`rbrcú Äsz%Label.computeSize..g333333ó?z[DirectDrawFlowable class is not available you need the rlextra package as well as reportlabzxlabel-generated)ÚnamerNrOrJrKTiÿÿÿr$)Ústyle)(ÚgetattrZ _lineWidthsrr_rNrOrRÚ_linesrQrWrXr}Úmaxr{rPÚ_leadingrZrxryÚlenr\Ú RuntimeErrorÚdictrJrKr^rÚ issubclassr ÚcloneÚ_styleZ autoLeadingÚ_getTextAnchorr!Ú alignmentÚwrapZ _width_maxÚ_ta2alÚ_ddfObjr…)r`r]r„ZstyÚtaZaWÚobjÚ_rb)r`rcÚ computeSize»sh          zLabel.computeSizecCs|j}|dkrt|jƒ}|S)z/This can be overridden to allow special effectsZboxauto)rTÚ_BA2TArw)r`ršrbrbrcr•üs zLabel._getTextAnchorc Cs |j}|p d|_|jƒ||_tƒ}|j|j|j|j|jƒ|j|j ƒt |ddƒ}|rd|j }nJ|j |j |j}|jƒ}|dkrŽ|j }n |dkr¨|j |jd}n|j}|jsÀ|jrö|jrö|jt|j |j|j|j|j|j|j|j|jd�ƒ|�r4tƒ}|j||j |jƒ|j|j|jƒƒ|j|ƒnÔ|j|j |j!}} } |j"|j#|j } } } t |diƒ}| �r¼x”|j$D]<}t%|||| | |ƒ}||_| |_"| |_#|j|ƒ|| 8}�qzWnLxJ|j$D]@}t&||||d�}||_'| |_ | |_!||_|j|ƒ|| 8}�qÄW|S) Nr;r]r$r&gà?)rKrLrJÚ _svgAttrs)rŸ)(r_r�rÚ translater6rBr7rCÚrotaterDr‹r‚r€rŽrzr•r~rƒrHrFrGrkrrWr�rYr}r|rr\r™rJrNrOrKrLrŒÚ _text2PathrrT)r`r_Úgr]r6r7rTZg1rJrNrOrKrLrPZsvgAttrsr‡r1rbrbrcÚ_rawDrawsd           zLabel._rawDrawc Cs>t|ddƒ}|r2|d|ƒz|jƒS|d|ƒXn|jƒSdS)Nr[TF)r‹r¤)r`r[rbrbrcÚdrawAs  z Label.drawN)!Ú__name__Ú __module__Ú __qualname__Ú__doc__ÚAttrMapÚ AttrMapValuerr rrrrr r rr rrrr r Ú_attrMaprdrerfrmrwr{r…r�r•r¤r¥rbrbrbrcr:!sX                           "# A?r:c@sòeZdZeeedd�eedd�eedd�eedd�eedd�eedd�eedd�eedd�eedd�eedd�eedd�eeƒdeedd�eedd�eedd�eedd�eedd�eedd�ee dd�ee dd�d�Z dd„Z dd„Z d d „Zd S) ÚLabelDecoratorr;)r<z True if the label is to be drawn)r6r7rBrCrDrErFrGrHrJrKrLr<rNrOrPrQrRrSrTrUcCs:d|_d|_x(|jjƒD]}t||ƒst||dƒqWdS)Nr$r4)rTrEr¬ÚkeysÚhasattrÚsetattr)r`Úarbrbrcrdds  zLabelDecorator.__init__c Cs>|j\ }}}}}}} } } } } }|j|jj|ƒ|j|ƒdS)N)Z _callOutInforeÚ categoryAxisZ categoryNamesrk)r`ÚlÚLÚchartr£ZrowNoZcolNor6r7rQrSZx00Zy00Zx0Zy0rbrbrcÚdecoratejszLabelDecorator.decoratecCsNtƒ}x6|jjƒD](\}}|dkr.t||dƒ}t|||ƒqW|j||ƒdS)N)r:Ú__dict__Úitemsr‹r°r¶)r`r³r´r±ÚvrbrbrcÚ__call__os  zLabelDecorator.__call__N)r¦r§r¨rªr«rr rrr r r¬rdr¶rºrbrbrbrcr­Ls0                  r­ÚhighÚlowÚbarÚaxisc@sLeZdZeeedd�eedd�eedd�eedd�d�Zdd„Zd d „Z d S) Ú LabelOffsetzWhere to base +ve offset)r<zValue for positive elementszWhere to base -ve offsetzValue for negative elements)ÚposModeÚposÚnegModeÚnegcCsd|_|_d|_|_dS)Nr¾r)rÀrÂrÁrÃ)r`rbrbrcrd~s zLabelOffset.__init__c Cs–|j}|j}|j}|dkr(|j}|j}n |j}|j}|r@|j}n|j}|rŽ|rV|j} n|j} |dkrp| |j }n|dkr~| }n|dkrŽ| |}||S)Nrr»r¼r½) Z_flipXYr²ZjoinAxisrÀrÁrÂrÃZ_xZ_yZ_length) r`rµÚvalZflipXYÚAZjAÚmodeÚdeltar¹Z_vrbrbrcÚ _getValue‚s, zLabelOffset._getValueN) r¦r§r¨rªr«Ú isOffsetModerr¬rdrÈrbrbrbrcr¿ws   r¿c@s.eZdZeed�Zdd„Zdd„Zdd„ZdS) ÚPMVLabel)ÚBASEcKstj|f|Žd|_dS)Nr)r:rdÚ_pmv)r`Úkwdsrbrbrcrd¤szPMVLabel.__init__c Cs4tj|ƒ}|jdkr0dddddddd d d œ |}|S) Nrr/r1r3r-r9r4r+r)r5) r5r)r+r4r9r-r3r1r/)r:rwrÌ)r`r±rbrbrcrw¨s  zPMVLabel._getBoxAnchorcCs(tj|ƒ}|jdkr$ddddœ|}|S)Nrr%r&r$)r$r&r%)r:r•rÌ)r`r±rbrbrcr•­s  zPMVLabel._getTextAnchorN) r¦r§r¨rªr:r¬rdrwr•rbrbrbrcrÊŸs rÊc@sjeZdZdZeeeedd�eedd�ee dd�ee dd�ee dd�ee dd d d d ƒd d�d�Z dd„Z dS)Ú BarChartLabelzF An extended Label allowing for nudging, lines visibility etc zNon-zero for a drawn line)r<zColor for a drawn linezNone or fixed draw ends +/-zNone or fixed draw starts +/-zNon-zero sign dependent nudger=r>r?r@Zmidz(one of ('normal','anti','lo','hi','mid'))rËÚlineStrokeWidthÚlineStrokeColorÚfixedEndÚ fixedStartÚnudgerIcKs0tj|f|Žd|_d|_d|_|_d|_dS)Nr)rÊrdrÏrÐrÒrÑrÓ)r`rÍrbrbrcrdÀs  zBarChartLabel.__init__N)r¦r§r¨r©rªrÊr«rrÚNoneOrInstanceOfLabelOffsetrrr¬rdrbrbrbrcrβs     rÎc@s,eZdZdZeeeedd�d�Zdd„Z dS)ÚNA_LabelzF An extended Label allowing for nudging, lines visibility etc zText to be used for N/A values)r<)rËrMcCstj|ƒd|_dS)Nzn/a)rÎrdrM)r`rbrbrcrdÏs zNA_Label.__init__N) r¦r§r¨r©rªrÎr«rr¬rdrbrbrbrcrÕÇs rÕ)ÚCustomDrawChangerc@s"eZdZejfdd„Zdd„ZdS)ÚRedNegativeChangercCstj|ƒ||_dS)N)rÖrdrJ)r`rJrbrbrcrdÖs zRedNegativeChanger.__init__cCs&i}|jjdƒr"|j|d<|j|_|S)Nú-rJ)r_Ú startswithrJ)r`r›ÚRrbrbrcÚ_changerÙs   zRedNegativeChanger._changerN)r¦r§r¨rZredrdrÛrbrbrbrcr×Õsr×c@s"eZdZdZeed�Zdd„ZdS)ÚXLabelz=like label but uses XPreFormatted/Paragraph to draw the _text)rËcOs4tj|f|ž|Ž|jdtƒ|_|jd|jƒ|_dS)Nr]ZdirectDrawClass)r:rdÚpoprr]r\)r`ÚargsrÍrbrbrcrdäszXLabel.__init__N)r¦r§r¨r©rªr:r¬rdrbrbrbrcrÜàs rÜiÓÿÿÿiÓÿÿÿ)CÚ __version__Z reportlab.librZreportlab.lib.utilsrZreportlab.lib.validatorsrrrrrr r r r r rrrZreportlab.lib.attrmapZreportlab.pdfbase.pdfmetricsrrZreportlab.graphics.shapesrrrrrrZreportlab.graphics.widgetbaserrrZreportlab.platypusrrZreportlab.lib.stylesrr Zreportlab.lib.enumsr!r"r#r‘r˜Úutilsr(r¢rsZrlextra.graphics.canvasadapterr8Ú ImportErrorržr:r­rÉr¿rÔrÊrÎrÕZNoneOrInstanceOfNA_LabelZreportlab.graphics.charts.utilsrÖr×rÜrbrbrbrcÚsD  <   &, -*&