ok
Direktori : /lib/python3.6/site-packages/parsedatetime/__pycache__/ |
Current File : //lib/python3.6/site-packages/parsedatetime/__pycache__/context.cpython-36.pyc |
3 =y�], � @ s4 d Z ddlmZ G dd� de�ZG dd� de�ZdS )z4 parsedatetime/context.py Context related classes � )�localc @ sD e Zd ZdZdd� Zedd� �Zdd� Zdd � Zd d� Z dd � Z dS )�pdtContextStackz\ A thread-safe stack to store context(s) Internally used by L{Calendar} object c C s t � | _d S )N)r �_pdtContextStack__local)�self� r �/usr/lib/python3.6/context.py�__init__ s zpdtContextStack.__init__c C s t | jd�sg | j_| jjS )N�stack)�hasattrr r )r r r r Z__stack s zpdtContextStack.__stackc C s | j j|� d S )N)�_pdtContextStack__stack�append)r �ctxr r r �push s zpdtContextStack.pushc C s$ y | j j� S tk r d S X d S )N)r �pop� IndexError)r r r r r s zpdtContextStack.popc C s, y | j d S tk r& td��Y nX d S )N� zcontext stack is empty���)r r �RuntimeError)r r r r �last% s zpdtContextStack.lastc C s | j S )N)r )r r r r �isEmpty+ s zpdtContextStack.isEmptyN)�__name__� __module__�__qualname__�__doc__r �propertyr r r r r r r r r r s r c @ s* e Zd ZdZd)Zd*Zd+Zd,Zd-Zd.Z d/Z d0Zd1Zd2Z eeB eB eB Ze e B eB eB e B Zedfed fedfedfe dfe dfedfedfe dfg Zeeeeeeeee e e e e e e e e eeeeeeeee d�Zd3dd�Zdd� Zdd� Zedd� �Zedd� �Zed d!� �Zed"d#� �Zd$d%� Zd&d'� Zd(S )4� pdtContexta� Context contains accuracy flag detected by L{Calendar.parse()} Accuracy flag uses bitwise-OR operation and is combined by: ACU_YEAR - "next year", "2014" ACU_MONTH - "March", "July 2014" ACU_WEEK - "last week", "next 3 weeks" ACU_DAY - "tomorrow", "July 4th 2014" ACU_HALFDAY - "morning", "tonight" ACU_HOUR - "18:00", "next hour" ACU_MIN - "18:32", "next 10 minutes" ACU_SEC - "18:32:55" ACU_NOW - "now" �accuracy� r r � � � � � � �year�month�week�day�halfday�hour�min�sec�now)r$ Zyearsr% Zmonthsr&