€cdocutils.nodes document q)q}q(U nametypesq}qX+caf api tests: size and bitmapsize propertyqNsUsubstitution_defsq}qUparse_messagesq ]q Ucurrent_sourceq NU decorationq NUautofootnote_startq KUnameidsq}qhU*caf-api-tests-size-and-bitmapsize-propertyqsUchildrenq]q(cdocutils.nodes comment q)q}q(U rawsourceqX -*- rest -*-qUparentqhUsourceqcdocutils.nodes reprunicode qX4/home/pmajka/4/doc/sphinx/source/test_slide-size.rstq…q}qbUtagnameqUcommentqU attributesq }q!(U xml:spaceq"Upreserveq#Uidsq$]q%Ubackrefsq&]q'Udupnamesq(]q)Uclassesq*]q+Unamesq,]q-uUlineq.KUdocumentq/hh]q0cdocutils.nodes Text q1X -*- rest -*-q2…q3}q4(hUhhubaubh)q5}q6(hXvim:syntax=restq7hhhhhhh }q8(h"h#h$]q9h&]q:h(]q;h*]qh1Xvim:syntax=restq?…q@}qA(hUhh5ubaubcdocutils.nodes section qB)qC}qD(hUhhhhhUsectionqEh }qF(h(]qGh*]qHh&]qIh$]qJhah,]qKhauh.Kh/hh]qL(cdocutils.nodes title qM)qN}qO(hX5CAF API tests: ``size`` and ``bitmapSize`` propertyqPhhChhhUtitleqQh }qR(h(]qSh*]qTh&]qUh$]qVh,]qWuh.Kh/hh]qX(h1XCAF API tests: qY…qZ}q[(hXCAF API tests: q\hhNubcdocutils.nodes literal q])q^}q_(hX``size``q`h }qa(h(]qbh*]qch&]qdh$]qeh,]qfuhhNh]qgh1Xsizeqh…qi}qj(hUhh^ubahUliteralqkubh1X and ql…qm}qn(hX and qohhNubh])qp}qq(hX``bitmapSize``qrh }qs(h(]qth*]quh&]qvh$]qwh,]qxuhhNh]qyh1X bitmapSizeqz…q{}q|(hUhhpubahhkubh1X propertyq}…q~}q(hX propertyq€hhNubeubcdocutils.nodes paragraph q)q‚}qƒ(hX'Obviously, we need to import bar moduleq„hhChhhU paragraphq…h }q†(h(]q‡h*]qˆh&]q‰h$]qŠh,]q‹uh.Kh/hh]qŒh1X'Obviously, we need to import bar moduleq…qŽ}q(hh„hh‚ubaubcdocutils.nodes literal_block q)q‘}q’(hX>>> import barq“hhChhhU literal_blockq”h }q•(U testnodetypeq–Xdoctestq—h"h#h$]q˜h&]q™h(]qšh*]q›h,]qœUgroupsq]qžUdefaultqŸaUoptionsq }q¡uh.K h/hh]q¢h1X>>> import barq£…q¤}q¥(hUhh‘ubaubh)q¦}q§(hX9Let's create an exemplary CAF slide with default settingsq¨hhChhhh…h }q©(h(]qªh*]q«h&]q¬h$]q­h,]q®uh.Kh/hh]q¯h1X9Let's create an exemplary CAF slide with default settingsq°…q±}q²(hh¨hh¦ubaubh)q³}q´(hX>>> slide = bar.barCafSlide()qµhhChhhh”h }q¶(U testnodetypeq·Xdoctestq¸h"h#h$]q¹h&]qºh(]q»h*]q¼h,]q½Ugroupsq¾]q¿hŸah }qÀuh.Kh/hh]qÁh1X>>> slide = bar.barCafSlide()qÂ…qÃ}qÄ(hUhh³ubaubh)qÅ}qÆ(hXDWe can read the dimensions of the SVG drawing representing CAF slideqÇhhChhhh…h }qÈ(h(]qÉh*]qÊh&]qËh$]qÌh,]qÍuh.Kh/hh]qÎh1XDWe can read the dimensions of the SVG drawing representing CAF slideqÏ…qÐ}qÑ(hhÇhhÅubaubh)qÒ}qÓ(hX>>> slide.size (1200, 900)qÔhhChhhh”h }qÕ(U testnodetypeqÖXdoctestq×h"h#h$]qØh&]qÙh(]qÚh*]qÛh,]qÜUgroupsqÝ]qÞhŸaUtestqßX+>>> slide.size #doctest: +SKIP (1200, 900)qàh }qáuh.Kh/hh]qâh1X>>> slide.size (1200, 900)qã…qä}qå(hUhhÒubaubh)qæ}qç(hX*Size is provided as tuple of two IntergersqèhhChhhh…h }qé(h(]qêh*]qëh&]qìh$]qíh,]qîuh.Kh/hh]qïh1X*Size is provided as tuple of two Intergersqð…qñ}qò(hhèhhæubaubh)qó}qô(hX2>>> map(type, slide.size) == map(type, (1,1)) TrueqõhhChhhh”h }qö(U testnodetypeq÷Xdoctestqøh"h#h$]qùh&]qúh(]qûh*]qüh,]qýUgroupsqþ]qÿhŸah }ruh.Kh/hh]rh1X2>>> map(type, slide.size) == map(type, (1,1)) Truer…r}r(hUhhóubaubh)r}r(hXoAlso the rendering size of the slide (which is not the same property as dimensions of the CAF slide) can be setrhhChhhh…h }r(h(]r h*]r h&]r h$]r h,]r uh.K"h/hh]rh1XoAlso the rendering size of the slide (which is not the same property as dimensions of the CAF slide) can be setr…r}r(hjhjubaubh)r}r(hXZ>>> slide.bitmapSize (1200, 900) >>> map(type, slide.bitmapSize) == map(type, (1,1)) TruerhhChhhh”h }r(U testnodetyperXdoctestrh"h#h$]rh&]rh(]rh*]rh,]rUgroupsr]rhŸahßXi>>> slide.bitmapSize #doctest: +SKIP (1200, 900) >>> map(type, slide.bitmapSize) == map(type, (1,1)) Truerh }r uh.K%h/hh]r!h1XZ>>> slide.bitmapSize (1200, 900) >>> map(type, slide.bitmapSize) == map(type, (1,1)) Truer"…r#}r$(hUhjubaubh)r%}r&(hXzSize, as well as bitmapsize can be altered. Only tuple of two integers is accepted as new value Altering slide dimensions:r'hhChhhh…h }r((h(]r)h*]r*h&]r+h$]r,h,]r-uh.K,h/hh]r.h1XzSize, as well as bitmapsize can be altered. Only tuple of two integers is accepted as new value Altering slide dimensions:r/…r0}r1(hj'hj%ubaubh)r2}r3(hX7>>> slide.size = (1000, 500) >>> slide.size (1000, 500)r4hhChhhh”h }r5(U testnodetyper6Xdoctestr7h"h#h$]r8h&]r9h(]r:h*]r;h,]r<Ugroupsr=]r>hŸah }r?uh.K/h/hh]r@h1X7>>> slide.size = (1000, 500) >>> slide.size (1000, 500)rA…rB}rC(hUhj2ubaubh)rD}rE(hX >>> slide.size = ("1000", 500) Traceback (most recent call last): AssertionError: (int,int) Tuple of two integers required >>> slide.bitmapSize = 'invalid slide dimensions' Traceback (most recent call last): AssertionError: (int,int) Tuple of two integers requiredrFhhChhhh”h }rG(U testnodetyperHXdoctestrIh"h#h$]rJh&]rKh(]rLh*]rMh,]rNUgroupsrO]rPhŸah }rQuh.K5h/hh]rRh1X >>> slide.size = ("1000", 500) Traceback (most recent call last): AssertionError: (int,int) Tuple of two integers required >>> slide.bitmapSize = 'invalid slide dimensions' Traceback (most recent call last): AssertionError: (int,int) Tuple of two integers requiredrS…rT}rU(hUhjDubaubh)rV}rW(hXä`Size` and `bitmap size` are related with some internal properies that can be edited by advanded user to better customize the slides. Changing the slide size alters the slide template as well as tracing and rendering propertiesrXhhChhhh…h }rY(h(]rZh*]r[h&]r\h$]r]h,]r^uh.K?h/hh]r_(cdocutils.nodes title_reference r`)ra}rb(hX`Size`rch }rd(h(]reh*]rfh&]rgh$]rhh,]riuhjVh]rjh1XSizerk…rl}rm(hUhjaubahUtitle_referencernubh1X and ro…rp}rq(hX and rrhjVubj`)rs}rt(hX `bitmap size`ruh }rv(h(]rwh*]rxh&]ryh$]rzh,]r{uhjVh]r|h1X bitmap sizer}…r~}r(hUhjsubahjnubh1XÌ are related with some internal properies that can be edited by advanded user to better customize the slides. Changing the slide size alters the slide template as well as tracing and rendering propertiesr€…r}r‚(hXÌ are related with some internal properies that can be edited by advanded user to better customize the slides. Changing the slide size alters the slide template as well as tracing and rendering propertiesrƒhjVubeubh)r„}r…(hXz>>> slide._rendererConf {'ReferenceHeight': 500, 'ReferenceWidth': 1000, 'imageSize': (1200, 900)} >>> slide._tracingConf r†hhChhhh”h }r‡(U testnodetyperˆXdoctestr‰h"h#h$]rŠh&]r‹h(]rŒh*]rh,]rŽUgroupsr]rhŸahßX‰>>> slide._rendererConf {'ReferenceHeight': 500, 'ReferenceWidth': 1000, 'imageSize': (1200, 900)} >>> slide._tracingConf #doctest: +SKIPr‘h }r’uh.KCh/hh]r“h1Xz>>> slide._rendererConf {'ReferenceHeight': 500, 'ReferenceWidth': 1000, 'imageSize': (1200, 900)} >>> slide._tracingConf r”…r•}r–(hUhj„ubaubh)r—}r˜(hX]Changing the slide size alters the slide template as well as tracing and rendering propertiesr™hhChhhh…h }rš(h(]r›h*]rœh&]rh$]ržh,]rŸuh.KIh/hh]r h1X]Changing the slide size alters the slide template as well as tracing and rendering propertiesr¡…r¢}r£(hj™hj—ubaubh)r¤}r¥(hX£>>> slide.size = (1000,500) >>> slide.bitmapSize = (2000, 1000) >>> slide._rendererConf {'ReferenceHeight': 500, 'ReferenceWidth': 1000, 'imageSize': (2000, 1000)}r¦hhChhhh”h }r§(U testnodetyper¨Xdoctestr©h"h#h$]rªh&]r«h(]r¬h*]r­h,]r®Ugroupsr¯]r°hŸah }r±uh.KLh/hh]r²h1X£>>> slide.size = (1000,500) >>> slide.bitmapSize = (2000, 1000) >>> slide._rendererConf {'ReferenceHeight': 500, 'ReferenceWidth': 1000, 'imageSize': (2000, 1000)}r³…r´}rµ(hUhj¤ubaubh)r¶}r·(hXNSlide with customized size can be obviously saved to and loaded from XML file:r¸hhChhhh…h }r¹(h(]rºh*]r»h&]r¼h$]r½h,]r¾uh.KSh/hh]r¿h1XNSlide with customized size can be obviously saved to and loaded from XML file:rÀ…rÁ}rÂ(hj¸hj¶ubaubh)rÃ}rÄ(hXñ>>> from xml.dom import minidom as dom >>> slide.writeXMLtoFile('testSlide.svg') >>> testSlide = bar.barCafSlide.fromXML('testSlide.svg') >>> testSlide._rendererConf {'ReferenceHeight': 500, 'ReferenceWidth': 1000, 'imageSize': (2000, 1000)}rÅhhChhhh”h }rÆ(U testnodetyperÇXdoctestrÈh"h#h$]rÉh&]rÊh(]rËh*]rÌh,]rÍUgroupsrÎ]rÏhŸah }rÐuh.KUh/hh]rÑh1Xñ>>> from xml.dom import minidom as dom >>> slide.writeXMLtoFile('testSlide.svg') >>> testSlide = bar.barCafSlide.fromXML('testSlide.svg') >>> testSlide._rendererConf {'ReferenceHeight': 500, 'ReferenceWidth': 1000, 'imageSize': (2000, 1000)}rÒ…rÓ}rÔ(hUhjÃubaubh)rÕ}rÖ(hX&All slide size settings are preserved:r×hhChhhh…h }rØ(h(]rÙh*]rÚh&]rÛh$]rÜh,]rÝuh.K]h/hh]rÞh1X&All slide size settings are preserved:rß…rà}rá(hj×hjÕubaubh)râ}rã(hX@>>> testSlide.size (1000, 500) >>> slide.bitmapSize (2000, 1000)rähhChhhh”h }rå(U testnodetyperæXdoctestrçh"h#h$]rèh&]réh(]rêh*]rëh,]rìUgroupsrí]rîhŸah }rïuh.K_h/hh]rðh1X@>>> testSlide.size (1000, 500) >>> slide.bitmapSize (2000, 1000)rñ…rò}ró(hUhjâubaubh)rô}rõ(hX5Just remove the temporary file containing test slide.röhhChhhh…h }r÷(h(]røh*]rùh&]rúh$]rûh,]rüuh.Kfh/hh]rýh1X5Just remove the temporary file containing test slide.rþ…rÿ}r(hjöhjôubaubh)r}r(hX,>>> import os >>> os.remove('testSlide.svg')rhhChhhh”h }r(U testnodetyperXdoctestrh"h#h$]rh&]rh(]r h*]r h,]r Ugroupsr ]r hŸah }ruh.Khh/hh]rh1X,>>> import os >>> os.remove('testSlide.svg')r…r}r(hUhjubaubeubehUU transformerrNU footnote_refsr}rUrefnamesr}rUsymbol_footnotesr]rUautofootnote_refsr]rUsymbol_footnote_refsr]rU citationsr]rh/hU current_liner NUtransform_messagesr!]r"Ureporterr#NUid_startr$KU autofootnotesr%]r&U citation_refsr'}r(Uindirect_targetsr)]r*Usettingsr+(cdocutils.frontend Values r,or-}r.(Ufootnote_backlinksr/KUrecord_dependenciesr0NU rfc_base_urlr1Uhttp://tools.ietf.org/html/r2U tracebackr3ˆUpep_referencesr4NUstrip_commentsr5NU toc_backlinksr6Uentryr7U language_coder8Uenr9U datestampr:NU report_levelr;KU _destinationr<NU halt_levelr=KU strip_classesr>NhQNUerror_encoding_error_handlerr?Ubackslashreplacer@UdebugrANUembed_stylesheetrB‰Uoutput_encoding_error_handlerrCUstrictrDU sectnum_xformrEKUdump_transformsrFNU docinfo_xformrGKUwarning_streamrHNUpep_file_url_templaterIUpep-%04drJUexit_status_levelrKKUconfigrLNUstrict_visitorrMNUcloak_email_addressesrNˆUtrim_footnote_reference_spacerO‰UenvrPNUdump_pseudo_xmlrQNUexpose_internalsrRNUsectsubtitle_xformrS‰U source_linkrTNUrfc_referencesrUNUoutput_encodingrVUutf-8rWU source_urlrXNUinput_encodingrYU utf-8-sigrZU_disable_configr[NU id_prefixr\UU tab_widthr]KUerror_encodingr^UANSI_X3.4-1968r_U_sourcer`U4/home/pmajka/4/doc/sphinx/source/test_slide-size.rstraUgettext_compactrbˆU generatorrcNUdump_internalsrdNU pep_base_urlreUhttp://www.python.org/dev/peps/rfUsyntax_highlightrgUshortrhUinput_encoding_error_handlerrijDUauto_id_prefixrjUidrkUdoctitle_xformrl‰Ustrip_elements_with_classesrmNU _config_filesrn]roUfile_insertion_enabledrpKU raw_enabledrqKU dump_settingsrrNubUsymbol_footnote_startrsKUidsrt}ruhhCsUsubstitution_namesrv}rwhh/h }rx(h(]ryh$]rzh&]r{Usourcer|hh*]r}h,]r~uU footnotesr]r€Urefidsr}r‚ub.