| Server IP : 93.86.61.54 / Your IP : 216.73.216.60 Web Server : Apache/2.4.62 (Ubuntu) System : Linux rasin.ddns.net 6.8.0-124-generic #124~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 21:05:19 UTC x86_64 User : www-data ( 33) PHP Version : 8.4.22 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /usr/share/inkscape/extensions/__pycache__/ |
Upload File : |
o
0�a�E � @ s~ d Z dZddlZddlZddlZddlZddlZddlmZ ejd dkr)dd� Z G dd � d ej
�Zed
kr=e� �
� dS dS )a
A calendar generator plugin for Inkscape, but also can be used as a standalone
command line application.
#
More on ISO week number calculation on:
http://en.wikipedia.org/wiki/ISO_week_date
(The first week of a year is the week that contains the first Thursdayof the year.)
z0.3� N)�TextElement� c C s t | t�r
| �|�S | S )N)�
isinstance�bytes�decode)�s�encoding� r �-/usr/share/inkscape/extensions/svgcalendar.py�unicode) s
r c @ s\ e Zd ZdZdd� Zdd� ZdZdZdZdd� Z d d
� Z
dd� Zd
d� Zdd� Z
dd� ZdS )�CalendarzGenerate Calendar in SVGc C s |j dtdd� |j dtddd� |j dtdd d� |j d
tjddd
d� |j dtjdddd� |j dddd� |j dddd� |j dtjdddd� |j dtddd d� |j d!td"d#d$d� |j d%td&d'd(d� |j d)td*d+d,d� |j d-td.d/d0d� |j d1td2d3d4d� |j d5td6d7d8d� |j d9td:d;d<d� |j d=td>d?d@d� |j dAtdBdCdDd� |j dEtdFdGdHd� |j dItdJdGdKd� |j dLtdMdGdNd� |j dOtdPdGdQd� |j dRtdSdTdUd� |j dVtdWdXdYd� |j dZtd[d\d]d� |j d^td_d`dad� d S )bNz--tab�tab)�type�destz--monthr zCMonth to be generated. If 0, then the entry year will be generated.)r �default�helpz--yearzDYear to be generated. If 0, then the current year will be generated.z--fill-empty-day-boxes�fill_edbTz*Fill empty day boxes with next month days.)r r r r z--show-week-number�show_weeknrFzInclude a week number column.z--start-day�sunz Week start day. ("sun" or "mon"))r r z --weekend�sat+sunz6Define the weekend days. ("sat+sun" or "sat" or "sun")z--auto-organize�
auto_organizez)Automatically set the size and positions.z--months-per-line�months_per_line� zNumber of months side by side.z
--month-width�month_width�6cmz The width of the month days box.z--month-margin�month_margin�1cmz"The space between the month boxes.z--color-year�
color_yearz#888zColor for the year header.z
--color-month�color_monthz#666z Color for the month name header.z--color-day-name�color_day_namez#999z$Color for the week day names header.z--color-day� color_dayz#000zColor for the common day box.z--color-weekend�
color_weekendz#777zColor for the weekend days.z--color-nmd� color_nmdz#BBBz1Color for the next month day, in empty day boxes.z--color-weeknr�color_weeknrz#808080zColor for the week numbers.z--font-year� font_year�arialzFont for the year string.z--font-month�
font_monthzFont for the month strings.z--font-day-name�
font_day_namez&Font for the days of the week strings.z
--font-day�font_dayzFont for the day strings.z
--month-names�month_nameszUJanuary February March April May June July August September October November Decemberz!The month names for localization.z--day-names� day_nameszSun Mon Tue Wed Thu Fri Satz$The week day names for localization.z
--weeknr-name�weeknr_name�Wkz-The week number column name for localization.z
--encoding�input_encodezutf-8z The input encoding of the names.)�add_argument�str�int�inkex�Boolean)�self�parsr r r
�
add_arguments1 s�
�
�
�
��
������������������
�zCalendar.add_argumentsc C s6 t �d| jj�}t �d|�d��| j_t �d| jj�}t �d|�d��| j_t| jj�dkrAt� dt
| jj� d � g d�| j_t| jj�dkr\t� d t
| jj� d � g d
�| j_| jjdkrjtj�
� j| j_| jjdkrtd| j_| jjd
kr�t�d� nt�d� | j�| jj�| j_| j�| jj�| j_d S )Nz\s*(.*[^\s])\s*z\s+� � zThe month name list "z" is invalid. Using default.)�January�February�March�April�May�June�July�August� September�October�November�December� zThe day name list ")�Sun�Mon�Tue�Wed�Thu�Fri�Satr �monr � )�re�match�optionsr) �split�groupr* �lenr1 �errormsgr/ �year�datetime�today� start_day�calendar�setfirstweekday�svg�unittouur r )r3 �mr r r
�validate_options| s6
��
��
zCalendar.validate_optionsr c C s~ | j �| j�� �d��| _| j �| j�� �d��| _| jjr"d| _ nd| _ | jj
r7| j| jkr3d| _n d| _n| jj| _| jj
rP| jd | j | _| jd | _
n
| jj| _| jj
| _
| jd | j | _| jd
| _| jd | _| jjdkr�| j| j | j| j | j
| jd d | _n | j| j d | _t| jd �| jjdd
| jjd�| _| j�� | _| jj| jd<