403Webshell
Server IP : 23.254.227.96  /  Your IP : 216.73.216.7
Web Server : Apache/2.4.62 (Unix) OpenSSL/1.1.1k
System : Linux hwsrv-1277026.hostwindsdns.com 4.18.0-477.13.1.el8_8.x86_64 #1 SMP Tue May 30 14:53:41 EDT 2023 x86_64
User : viralblo ( 1001)
PHP Version : 8.1.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python3.6/site-packages/tuned/plugins/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3.6/site-packages/tuned/plugins/__pycache__/plugin_usb.cpython-36.opt-1.pyc
3

��c��@sPddlmZddlTddlZddlmZddlZejj	�Z
Gdd�dej�ZdS)�)�base)�*�N)�commandsc@sjeZdZdZdd�Zdd�Zedd��Zdd	�Zd
d�Z	dd
�Z
eddd�dd��Ze
d�ddd��ZdS)�	USBPlugina�
	`usb`::
	
	Sets autosuspend timeout of USB devices to the value specified by the
	[option]`autosuspend` option in seconds. If the [option]`devices`
	option is specified, the [option]`autosuspend` option applies to only
	the USB devices specified, otherwise it applies to all USB devices.
	+
	The value `0` means that autosuspend is disabled.
	+
	.To turn off USB autosuspend for USB devices `1-1` and `1-2`
	====
	----
	[usb]
	devices=1-1,1-2
	autosuspend=0
	----
	====
	cCsNd|_t�|_t�|_x*|jjd�jdd�D]}|jj|j�q,Wt	�|_
dS)NT�usbZDEVTYPEZ
usb_device)Z_devices_supported�setZ
_free_devicesZ_assigned_devices�_hardware_inventoryZget_devicesZmatch_property�addZsys_namer�_cmd)�self�device�r� /usr/lib/python3.6/plugin_usb.py�
_init_devicesszUSBPlugin._init_devicescs�fdd�|D�S)Ncsg|]}�jjd|��qS)r)r	Z
get_device)�.0�x)rrr�
<listcomp>)sz1USBPlugin._get_device_objects.<locals>.<listcomp>r)rZdevicesr)rr�_get_device_objects(szUSBPlugin._get_device_objectscCsddiS)N�autosuspendr)rrrr�_get_config_options+szUSBPlugin._get_config_optionscCsd|_d|_dS)NTF)Z_has_static_tuningZ_has_dynamic_tuning)r�instancerrr�_instance_init1szUSBPlugin._instance_initcCsdS)Nr)rrrrr�_instance_cleanup5szUSBPlugin._instance_cleanupcCsd|S)Nz)/sys/bus/usb/devices/%s/power/autosuspendr)rr
rrr�_autosuspend_sysfile8szUSBPlugin._autosuspend_sysfilerT)Z
per_devicecCsB|j|�}|dkrdS|rdnd}|s>|j|�}|jj||�|S)N�1�0)Z_option_boolrrZ
write_to_file)r�valuer
Zsim�enable�val�sys_filerrr�_set_autosuspend;s

zUSBPlugin._set_autosuspendFcCs|j|�}|jj||d�j�S)N)Zno_error)rrZ	read_file�strip)rr
Zignore_missingr rrr�_get_autosuspendGs
zUSBPlugin._get_autosuspendN)F)�__name__�
__module__�__qualname__�__doc__rr�classmethodrrrrZcommand_setr!Zcommand_getr#rrrrr	s
r)
�rZ
decoratorsZ
tuned.logsZtunedZtuned.utils.commandsrZglobZlogs�get�logZPluginrrrrr�<module>s


Youez - 2016 - github.com/yon3zu
LinuXploit