文件操作 - _ossighelper.cpython-310.pyc
返回文件管理
返回主菜单
删除本文件
文件: /usr/lib/python3/dist-packages/gi/__pycache__/_ossighelper.cpython-310.pyc
编辑文件内容
o b�^� � @ s� d dl mZ d dlZd dlZd dlZd dlZd dlmZmZ ddl m Z dd� Zda ed d � �Z e jZe�ej�eju rCeej�ZndZdd � Zedd� �Zdd� Zg adaedd� �ZdS )� )�print_functionN)�closing�contextmanager� )�_gic C sl t | d�r| �d� dS zddl}W n ty td��w | �� }|�||j�}|�||j||jB � dS )z�Ensures that the socket is not inherited by child processes Raises: EnvironmentError NotImplementedError: With Python <3.4 on Windows �set_inheritableFr Nz+Not implemented for older Python on Windows) �hasattrr �fcntl�ImportError�NotImplementedError�fileno�F_GETFD�F_SETFD� FD_CLOEXEC)�sockr �fd�flags� r �1/usr/lib/python3/dist-packages/gi/_ossighelper.py�ensure_socket_not_inheritable s ��r Fc # s� � t rdV dS ddlm� t�� \�} t���� t| ��� �| fD ]}|�d� t|� q"z t� | � � �}W n tyP dV Y W d � W d � dS w da � �fdd�}zRtj dkri� j��� � �}n� j��� � �}� �|� j� jj� jjB � jjB � jjB |�}z dV W � �|� n� �|� w W t� |�}|| � � kr�t� |� da nt� |�}|| � � kr�t� |� da w W d � n1 s�w Y W d � dS W d � dS 1 s�w Y dS ) a� A decorator for functions which create a glib event loop to keep Python signal handlers working while the event loop is idling. In case an OS signal is received will wake the default event loop up shortly so that any registered Python signal handlers registered through signal.signal() can run. In case the wrapped function is not called from the main thread it will be called as is and it will not wake up the default loop for signals. Nr )�GLibFTc sN |� j @ r%zt��d��W S ty$ } zt|� W Y d }~dS d }~ww dS )Nr F)�IO_IN�bool�recv�EnvironmentError�print)�source� condition�e�r �read_socketr r � signal_notify\ s ��z'wakeup_on_signal.<locals>.signal_notify�nt)�_wakeup_fd_is_active� gi.repositoryr �socket� socketpairr �setblockingr �signal� set_wakeup_fdr � ValueError�os�name� IOChannel�win32_new_socket�unix_new�io_add_watch�PRIORITY_DEFAULT�IOCondition�IN�HUP�NVAL�ERR� source_remove)�write_socketr �orig_fdr! �channel� source_id�write_fdr r r �wakeup_on_signal7 s^ � � ���� � P�r= ���c C s t �t j�t ju ott j�tkS )z?Returns if on SIGINT the default Python handler would be called)r( � getsignal�SIGINT�default_int_handler�PyOS_getsig�startup_sigint_ptrr r r r �sigint_handler_is_default� s �rD c c s� � t � sJ �t�tj| � ttj�}z!dV W t�tj�| u r0ttj�|kr2t�tjtj� dS dS dS t�tj�| u rLttj�|krMt�tjtj� w w w )z�Context manager for saving/restoring the SIGINT handler default state. Will only restore the default handler again if the handler is not changed while the context is active. N)rD r( r@ rB r? rA )�handler�sig_ptrr r r �&sigint_handler_set_and_restore_default� s � ���rG c C s t �� jdkS )z@Returns True in case the function is called from the main thread� MainThread)� threading�current_threadr, r r r r �is_main_thread� s rK c c s� � t � s dV dS t� s3tr.t�| � zdV W t�� }tr!|� dS t�� }tr-|� w w dV dS dadd� }t�| � z)t|�� dV W d � n1 sQw Y W trbt�tj d� dS t�� dS trrt�tj d� w t�� w )a� Installs a SIGINT signal handler in case the default Python one is active which calls 'callback' in case the signal occurs. Only does something if called from the main thread. In case of nested context managers the signal handler will be only installed once and the callbacks will be called in the reverse order of their registration. The old signal handler will be restored in case no signal handler is registered while the context is active. NFc S s t rd S da t�� � d S )NT)�_sigint_called�_callback_stack�pop)�sig_num�framer r r �sigint_handler� s z0register_sigint_fallback.<locals>.sigint_handler) rK rD rM �appendrN rL rG r( rA r@ )�callback�cbrQ r r r �register_sigint_fallback� sB � �� ��� rU )� __future__r r+ r% r( rI � contextlibr r � r r r# r= �pyos_getsigrB r? r@ rA rC rD rG rK rM rL rU r r r r �<module> s0 I
修改文件时间
将文件时间修改为当前时间的前一年
删除文件