Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/cherrypy/lib/__pycache__/__init__.cpython-39.pyc
Ðазад
a v�h� � @ s: d Z dd� Zdd� ZG dd� de�Zd dd �Zd d� ZdS )zCherryPy Library.c C s8 ddl m} t| |�rdS t| d�s(dS t| �| u S dS )z�Detect if the object provided implements the iterator protocol. (i.e. like a generator). This will return False for objects which are iterable, but not iterators themselves. � )� GeneratorTypeT�__iter__FN)�typesr � isinstance�hasattr�iter)�objr � r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/cherrypy/lib/__init__.py�is_iterator s r c C sh t | �sdS ddl}|�| �r"dS t| d�r6t| j�s:dS z|�| j� W n ty^ Y dS 0 dS dS )z9Detect if the given object is both closable and iterator.Fr NT�close)r �inspect�isgeneratorr �callabler �getcallargs� TypeError)r r r r r �is_closable_iterator s r c @ s6 e Zd ZdZddd�Zdd� Zdd� ZeZd d � ZdS ) �file_generatorzOYield the given input (a file object) in chunks (default 64k). (Core) � c C s || _ || _dS )zAInitialize file_generator with file ``input`` for chunked access.N)�input� chunkSize)�selfr r r r r �__init__5 s zfile_generator.__init__c C s | S )zReturn iterator.r �r r r r r : s zfile_generator.__iter__c C s6 | j �| j�}|r|S t| j d�r,| j �� t� �dS )zReturn next chunk of file.r N)r �readr r r � StopIteration)r �chunkr r r �__next__>