
    Kwg3                     ~    d Z dZddlmZ ddlmZmZmZmZ ddl	m
Z
 ddlmZ  G d de      Zd	 Zed
k(  r e        yy)z3.3.0zThis file is a
    )colors)RectDrawingGroupString)Label)Widgetc                   <    e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
y	)
EventCalendarc                     d| _         d| _        d| _        d| _        d | _        d| _        g | _        d | _        d | _        d | _	        d| _
        g | _        d | _        d | _        d| _        g | _        g | _        y )Nr   i,        )xywidthheighttimeColWidthtrackRowHeightdata
trackNames	startTimeendTimeday_talksVisible
_startTime_endTime_trackCount
_colWidths_colLeftEdges)selfs    Z/var/www/horilla/myenv/lib/python3.12/site-packages/reportlab/graphics/widgets/eventcal.py__init__zEventCalendar.__init__   s    
  	      c                     | j                  | j                        | _        t        | j	                               | _        | j                          | j                  g| _        | j                  z| j                  d| j
                  z   z  }|gd| j
                  z   z  | _        t        | j
                        D ]-  }| j                  j                  | j                  d   |z          / y| j                  g| _        | j                  | j                  z
  | j
                  z  }t        | j
                        D ]H  }| j                  j                  |       | j                  j                  | j                  d   |z          J y)z4Called at start of draw.  Sets various column widthsN   )getRelevantTalksr   r   lengetAllTracksr   computeStartAndEndTimesr   r   r   r   r   rangeappend)r    wis      r!   computeSizezEventCalendar.computeSize*   sJ   !22499=t0023$$&"ffX$

a$"2"223A cQ(8(8%89DO4++, F""))$*<*<R*@1*DEF  $001DOd///43C3CCA4++, F&&q)""))$*<*<R*@1*DEFr#   c                    | j                   r| j                   | _        nC| j                  D ]4  \  }}}}}}| j                  || _        || j                  k  s.|| _        6 | j                  r| j                  | _        y| j                  D ]=  \  }}}}}}| j                  ||z   | _        !||z   | j                  kD  s4||z   | _        ? y)z(Work out first and last times to displayN)r   r   r   r   r   )r    titlespeakertrackIdr   startdurations          r!   r*   z%EventCalendar.computeStartAndEndTimes>   s    >>"nnDOCGCUCU 0?#uh??*&+DOt.*/0 << LLDMCGCUCU 9?#uh==($)H$4DMx'$--7(-(89r#   c                     g }| j                   D ]"  \  }}}}}}|||vs|j                  |       $ |j                          |S )N)r   r,   sort)r    tracksr1   r2   r3   r   hoursr5   s           r!   r)   zEventCalendar.getAllTracksX   sQ    ?Cyy 	+;UGWc5("&(MM'*	+ 	r#   c                     g }|D ]s  }|\  }}}}}}	|dk7  sJ d       || j                   k(  s(| j                  ||	z   | j                  k\  sG| j                  || j                  k  sc|j                  |       u |S )zScans for tracks actually usedr   z2trackId must be None or 1,2,3... zero not allowed!)r   r   r   r,   )
r    talkListusedtalkr1   r2   r3   r   r9   r5   s
             r!   r'   zEventCalendar.getRelevantTalksa   s     	&D>B;UGWc5(a<U!UU<dhhnn,583C2Vll*0EKK%	& r#   c                     | j                   | j                  z
  }|| j                  z
  | j                  | j                  z
  z  }| j                  |z   ||z  z
  }|S )z+Return y-value corresponding to times given)r   r   r   r   r   )r    theTime
axisHeightproportionUpr   s        r!   	scaleTimezEventCalendar.scaleTimem   sS    [[4#6#66
 4??2t}}t7VWFFZ:#<=r#   c                 0   t               }| j                  ||z         }| j                  |      }||z
  }|,| j                  d   }	| j                  | j                  d   z
  }
n| j                  |   }	| j                  |   }
t               }|j                  |       |j                  |	d|
z  z   |d|z  z          d|_        |
|_        ||_	        d|_
        t        |	||
|t        j                        }|j                  |       |j                  |       |S )z!Return shapes for a specific talkr%   r         ?c   	fillColor)r   rB   r   r   r   r   setText	setOrigin	boxAnchorr   fontSizer   r   cyanadd)r    r   r5   r3   textgy_bottomy_topy_heightr   r   labrs                r!   getTalkRectzEventCalendar.getTalkRectv   s   G>>)h"67y)8#?""1%AJJ!33E ""7+AOOG,EgDa#e)mXc(l%:;	
HeXE	a	c
 r#   c           	      8   | j                          t               }|j                  t        | j                  | j
                  | j                  d   | j                  | j                  z
  t        j                               | j                  | j                  d   z   }| j
                  | j                  z   | j                  z
  }t        | j                        D ]{  }| j                  |dz      }t        |||| j                  t        j                        }t        |d|z  z   |d|z  d      }|j                  |       |j                  |       ||z   }} | j                  D ]6  }|\  }	}
}}}}| j!                  ||||	dz   |
z         }|j                  |       8 |S )	Nr   rG   r%   rD   zTrack %dmiddle)align
)r/   r   rN   r   r   r   r   r   r   r   cornsilkr+   r   yellowr   r   rV   )r    rP   r   r   trkwidrU   sr=   r1   r2   r3   r   r4   r5   s                  r!   drawzEventCalendar.draw   sk   G 	
d4664664??1#5t{{TEXEX7Xdjdsdstu FFT__Q''FFT[[ 4#6#66))* 	C//#a%(CQ3 3 3v}}MAq3s7{AzC'7xHAEE!HEE!HCA	 && 	D>B;UGWc5(  '54<';QRAEE!H	 r#   N)__name__
__module____qualname__r"   r/   r*   r)   r'   rB   rV   r`    r#   r!   r   r      s,     2F(94
Br#   r   c                     t        dd      } t               }d|_        d|_        g d|_        d|_        | j                  |       dD ]?  }| j                  |      }t        d|z  d	      j                  |       t        d
|z         A y)z3Make a conference event for day 1 of UP Python 2003i     2      )B)z1Keynote: Why design another programming language?zGuido van RossumNr%         "@      ?)zSiena Web Service ArchitecturezMarc-Andre Lemburgr%   r%         %@      ?)zExtreme Programming in PythonzChris Withers   r%   rk   rl   )zPattern Experiences in C++zMark Radford   r%   rk   rl   )z"What is the Type of std::toupper()zGabriel Dos Reis   r%   rk   rl   )z6Linguistic Variables: Clear Thinking with Fuzzy Logic zWalter Banks   r%   rk   rl   )0lunch, short presentations, vendor presentations Nr%         (@       @)zCORBA? Isn't that obsoletezDuncan Grisbyr%   r%         ,@rl   )zPython Design PatternsDuncan Boothrm   r%   ru   rl   )z*Inside Security Checks and Safe ExceptionsBrandon Brayrn   r%   ru   rl   )zStudying at a DistanceCPanel Discussion, Panel to include Alan Lenton & Francis Glassborowro   r%   ru   rl   )zRCoding Standards - Given the ANSI C Standard why do I still need a coding StandardRandy Marquesrp   r%   ru   rl   )zRESTful PythonzHamish Lawsonr%   r%         0@rl   )z(Parsing made easier - a radical old ideazAndrew Koenigrm   r%   rz   rl   )zC++ & MultimethodszJulian Smithrn   r%   rz   rl   )zC++ ThreadingzKevlin Henneyro   r%   rz   rl   )zThe Organisation Strikes BackzAlan Griffiths & Sarah Leesrp   r%   rz   rl   )Birds of a Feather meetingrr   Nr%        1@rt   )zKeynote: In the Spirit of CzGreg ColvinNrm   ri   rj   )z6The Infinite Filing Cabinet - object storage in PythonzJacob Hallenr%   rm   rk   rl   )z>Introduction to Python and Jython for C++ and Java ProgrammerszAlex Martellirm   rm   rk   rl   )z#Template metaprogramming in HaskellzSimon Peyton Jonesrn   rm   rk   rl   )zQPlenty People Programming: C++ Programming in a Group, Workshop with a differencezNico Josuttisro   rm   rk   rl   )z4Design and Implementation of the Boost Graph LibraryzJeremy Siekrp   rm   rk   rl   )rq   rr   Nrm   rs   rt   )z5Building GUI Applications with PythonCard and PyCrustz	Andy Toddr%   rm   ru   rl   )zIntegrating Python, C and C++rv   rm   rm   ru   rl   )z!Secrets and Pitfalls of Templatesz$Nicolai Josuttis & David Vandevoordern   rm   ru   rl   )zBeing a Mentorrx   ro   rm   ru   rl   )zThe Embedded C Extensions to CzWillem Wakkerrp   rm   ru   rl   )zLightning Talksz
Paul Brianr%   rm   rz   rl   )z'Scripting Java Applications with JythonzAnthony Edenrm   rm   rz   rl   )z5Metaprogramming and the Boost Metaprogramming LibraryDavid Abrahamsrn   rm   rz   rl   )z6A Common Vendor ABI for C++ -- GCC's why, what and notz!Nathan Sidwell & Gabriel Dos Reisro   rm   rz   rl   )zThe Timing and Cost of ChoiceszHubert Matthewsrp   rm   rz   rl   )r{   rr   Nrm   r|   rt   )z.Keynote: The Cost of C &amp; C++ CompatibilityzAndy KoenigNrn   ri   rj   )z4Prying Eyes: Generic Observer Implementations in C++Andrei Alexandrescur%   rm   rk   rl   )z.The Roadmap to Generative Programming With C++zUlrich Eiseneckerrm   rm   rk   rl   )z=Design Patterns in C++ and C# for the Common Language Runtimerw   rn   rm   rk   rl   )z@Extreme Hour (XH): (workshop) - Jutta Eckstein and Nico JosuttiszJutta Ecsteinro   rm   rk   rl   )z.The Lambda Library : Unnamed Functions for C++zJaako Jarvirp   rm   rk   rl   )rq   rr   Nrn   rs   rt   )zReflective MetaprogrammingzDaveed Vandevoorder%   rn   ru   rl   )z7Advanced Template Issues and Solutions (double session)zHerb Sutterrm   rn   ru   rn   )z/Concurrent Programming in Java (double session)zAngelika Langerrn   rn   ru   rn   )z)What can MISRA-C (2nd Edition) do for us?zChris Hillsro   rn   ru   rl   )z(C++ Metaprogramming Concepts and ResultszWalter E Brownrp   rn   ru   rl   )z3Binding C++ to Python with the Boost Python Libraryr}   r%   rn   rz   rl   )zHUsing Aspect Oriented Programming for Enterprise Application IntegrationzArno Schmidmeierro   rn   rz   rl   )zDefective C++zMarc Paternorp   rn   rz   rl   )z.Speakers' Banquet & Birds of a Feather meetingrr   Nrn   r|   rt   )z=Keynote: The Internet, Software and Computers - A Report CardzAlan LentonNro   ri   rj   )zEMulti-Platform Software Development; Lessons from the Boost librarieszBeman Dawesr%   rp   rk   rl   )zThe Stability of the C++ ABIzSteve Clamagerm   rp   rk   rl   )zJGeneric Build Support - A Pragmatic Approach to the Software Build Processry   rn   rp   rk   rl   )z0How to Handle Project Managers: a survival guidez	Barb Byroro   rp   rk   rl   )zlunch, ACCU AGMrr   Nrp   rs   rt   )zESauce: An OO recursive descent parser; its design and implementation.z
Jon Jaggerr%   rp   ru   rl   )zKGNIRTS ESAC REWOL -  Bringing the UNIX filters to the C++ iostream library.zJC van Winkelrm   rp   ru   rl   )z Pattern Writing: Live and DirectzFrank Buschmann & Kevlin Henneyrn   rp   ru   g      @)z5The Future of Programming Languages - A Goldfish BowlzFrancis Glassborow and friendsrn   rp   ru   rl   )zSHoney, I Shrunk the Threads: Compile-time checked multithreaded transactions in C++r~   r%   rp   rz   rl   )z#Fun and Functionality with FunctorszLois Goldthwaiterm   rp   rz   rl   )zAgile Enough?zAlan Griffithsro   rp   rz   rl   )z+Conference Closure: A brief plenary sessionrr   Nrp   r|   rD   r%   )pdfzeventcal.%swbzsaved eventcal.%sN)r   r   r   r   r   r   rN   asStringopenwriteprint)dcalformatouts       r!   testr      s     	CA
/CCECE`
CHF CGEE#J  ,jj ]V#T*005!F*+,r#   __main__N)__version____doc__reportlab.libr   reportlab.graphics.shapesr   r   r   r   $reportlab.graphics.charts.textlabelsr   reportlab.graphics.widgetbaser	   r   r   ra   rd   r#   r!   <module>r      sN    	 ! B B 6 0_F _Ht,l ZF r#   