← Back
Editing: _twistw.cpython-38.pyc
U W[ � @ sp d dl mZ d dlmZ d dlmZmZmZ d dlm Z d dl Z d dlZG dd� dej�ZG dd � d ej �ZdS ) � )�print_function)�log)�app�service�internet)� copyrightNc @ s$ e Zd ZdZdddggZdd� ZdS )� ServerOptionszUsage: twistd [options]Znodaemon�nz(for backwards compatibility).c C s2 t d�tj�| jd� t tj| jd� t�� dS )z5 Print version information and exit. z&twistd (the Twisted Windows runner) {})�fileN)�print�formatr �version�stdout�sys�exit��self� r �9/usr/lib/python3/dist-packages/twisted/scripts/_twistw.py�opt_version s �zServerOptions.opt_versionN)�__name__� __module__�__qualname__ZsynopsisZoptFlagsr r r r r r s r c @ s e Zd ZdZdd� Zdd� ZdS )�WindowsApplicationRunnerzn An ApplicationRunner which avoids unix-specific things. No forking, no PID files, no privileges. c C s$ t j| _t j| _t�| jd � dS )z4 Do pre-application-creation setup. ZrundirN)r r � oldstdout�stderr� oldstderr�os�chdir�configr r r r �preApplication% s z'WindowsApplicationRunner.preApplicationc C s^ t �| j��� t�| j| jd � t�t�ddd� �d� | � d| j | j� t� d� dS )z< Start the application and run the reactor. Zno_saveg�������?c S s d S )Nr r r r r �<lambda>4 � z:WindowsApplicationRunner.postApplication.<locals>.<lambda>r NzServer Shut Down.)r ZIServiceZapplicationZprivilegedStartServicer ZstartApplicationr r ZTimerServiceZstartReactorr r r �msgr r r r �postApplication. s z(WindowsApplicationRunner.postApplicationN)r r r �__doc__r r$ r r r r r s r )Z __future__r Ztwisted.pythonr Ztwisted.applicationr r r Ztwistedr r r r ZApplicationRunnerr r r r r �<module> s
Save File
Cancel