X7ROOT File Manager
Current Path:
/usr/lib/python3.6/site-packages/tuned/profiles/functions
usr
/
lib
/
python3.6
/
site-packages
/
tuned
/
profiles
/
functions
/
📁
..
📄
__init__.py
(35 B)
📁
__pycache__
📄
base.py
(1.02 KB)
📄
function_assertion.py
(767 B)
📄
function_assertion_non_equal.py
(811 B)
📄
function_calc_isolated_cores.py
(1.6 KB)
📄
function_check_net_queue_count.py
(650 B)
📄
function_cpuinfo_check.py
(1011 B)
📄
function_cpulist2devs.py
(460 B)
📄
function_cpulist2hex.py
(470 B)
📄
function_cpulist2hex_invert.py
(624 B)
📄
function_cpulist_invert.py
(659 B)
📄
function_cpulist_online.py
(651 B)
📄
function_cpulist_pack.py
(637 B)
📄
function_cpulist_present.py
(691 B)
📄
function_cpulist_unpack.py
(511 B)
📄
function_exec.py
(487 B)
📄
function_hex2cpulist.py
(472 B)
📄
function_kb2s.py
(405 B)
📄
function_regex_search_ternary.py
(554 B)
📄
function_s2kb.py
(417 B)
📄
function_strip.py
(406 B)
📄
function_virt_check.py
(595 B)
📄
functions.py
(2.1 KB)
📄
repository.py
(1.25 KB)
Editing: base.py
import os import tuned.logs from tuned.utils.commands import commands log = tuned.logs.get() class Function(object): """ Built-in function """ def __init__(self, name, nargs_max, nargs_min = None): self._name = name self._nargs_max = nargs_max self._nargs_min = nargs_min self._cmd = commands() # checks arguments # nargs_max - maximal number of arguments, there mustn't be more arguments, # if nargs_max is 0, number of arguments is unlimited # nargs_min - minimal number of arguments, if not None there must # be the same number of arguments or more @classmethod def _check_args(cls, args, nargs_max, nargs_min = None): if args is None or nargs_max is None: return False la = len(args) return (nargs_max == 0 or nargs_max >= la) and (nargs_min is None or nargs_min <= la) def execute(self, args): if self._check_args(args, self._nargs_max, self._nargs_min): return True else: log.error("invalid number of arguments for builtin function '%s'" % self._name) return False
Upload File
Create Folder