PNG  IHDR* pHYs+ IDATx]n#; cdLb Ǚ[at¤_:uP}>!Usă cag޿ ֵNu`ݼTâabO7uL&y^wFٝA"l[|ŲHLN밪4*sG3|Dv}?+y߉{OuOAt4Jj.u]Gz*҉sP'VQKbA1u\`& Af;HWj hsO;ogTu uj7S3/QzUr&wS`M$X_L7r2;aE+ώ%vikDA:dR+%KzƉo>eOth$z%: :{WwaQ:wz%4foɹE[9<]#ERINƻv溂E%P1i01 |Jvҗ&{b?9g=^wζXn/lK::90KwrюO\!ջ3uzuGv^;騢wq<Iatv09:tt~hEG`v;3@MNZD.1]L:{ծI3`L(÷ba")Y.iljCɄae#I"1 `3*Bdz>j<fU40⨬%O$3cGt]j%Fߠ_twJ;ABU8vP3uEԑwQ V:h%))LfraqX-ۿX]v-\9I gl8tzX ]ecm)-cgʒ#Uw=Wlێn(0hPP/ӨtQ“&J35 $=]r1{tLuǮ*i0_;NƝ8;-vݏr8+U-kruȕYr0RnC]*ެ(M:]gE;{]tg(#ZJ9y>utRDRMdr9㪩̞zֹb<ģ&wzJM"iI( .ꮅX)Qw:9,i좜\Ԛi7&N0:asϓc];=ΗOӣ APqz93 y $)A*kVHZwBƺnWNaby>XMN*45~ղM6Nvm;A=jֲ.~1}(9`KJ/V F9[=`~[;sRuk]rєT!)iQO)Y$V ی ۤmzWz5IM Zb )ˆC`6 rRa}qNmUfDsWuˤV{ Pݝ'=Kֳbg,UҘVz2ﴻnjNgBb{? ߮tcsͻQuxVCIY۠:(V뺕 ٥2;t`@Fo{Z9`;]wMzU~%UA蛚dI vGq\r82iu +St`cR.6U/M9IENDB` REDROOM
PHP 5.6.40
Preview: controller.py Size: 3.46 KB
/lib/python3.6/site-packages/tuned/exports/controller.py

from . import interfaces
import inspect
import tuned.patterns

class ExportsController(tuned.patterns.Singleton):
	"""
	Controls and manages object interface exporting.
	"""

	def __init__(self):
		super(ExportsController, self).__init__()
		self._exporters = []
		self._objects = []
		self._exports_initialized = False

	def register_exporter(self, instance):
		"""Register objects exporter."""
		self._exporters.append(instance)

	def register_object(self, instance):
		"""Register object to be exported."""
		self._objects.append(instance)

	def _is_exportable_method(self, method):
		"""Check if method was marked with @exports.export wrapper."""
		return inspect.ismethod(method) and hasattr(method, "export_params")

	def _is_exportable_signal(self, method):
		"""Check if method was marked with @exports.signal wrapper."""
		return inspect.ismethod(method) and hasattr(method, "signal_params")

	def _is_exportable_getter(self, method):
		"""Check if method was marked with @exports.get_property wrapper."""
		return inspect.ismethod(method) and hasattr(method, "property_get_params")

	def _is_exportable_setter(self, method):
		"""Check if method was marked with @exports.set_property wrapper."""
		return inspect.ismethod(method) and hasattr(method, "property_set_params")

	def _export_method(self, method):
		"""Register method to all exporters."""
		for exporter in self._exporters:
			args = method.export_params[0]
			kwargs = method.export_params[1]
			exporter.export(method, *args, **kwargs)

	def _export_signal(self, method):
		"""Register signal to all exporters."""
		for exporter in self._exporters:
			args = method.signal_params[0]
			kwargs = method.signal_params[1]
			exporter.signal(method, *args, **kwargs)

	def _export_getter(self, method):
		"""Register property getter to all exporters."""
		for exporter in self._exporters:
			args = method.property_get_params[0]
			kwargs = method.property_get_params[1]
			exporter.property_getter(method, *args, **kwargs)

	def _export_setter(self, method):
		"""Register property setter to all exporters."""
		for exporter in self._exporters:
			args = method.property_set_params[0]
			kwargs = method.property_set_params[1]
			exporter.property_setter(method, *args, **kwargs)

	def send_signal(self, signal, *args, **kwargs):
		"""Register signal to all exporters."""
		for exporter in self._exporters:
			exporter.send_signal(signal, *args, **kwargs)

	def property_changed(self, *args, **kwargs):
		for exporter in self._exporters:
			exporter.property_changed(*args, **kwargs)

	def period_check(self):
		"""Allows to perform checks on exporters without special thread."""
		for exporter in self._exporters:
			exporter.period_check()

	def _initialize_exports(self):
		if self._exports_initialized:
			return

		for instance in self._objects:
			for name, method in inspect.getmembers(instance, self._is_exportable_method):
				self._export_method(method)
			for name, method in inspect.getmembers(instance, self._is_exportable_signal):
				self._export_signal(method)
			for name, method in inspect.getmembers(instance, self._is_exportable_getter):
				self._export_getter(method)
			for name, method in inspect.getmembers(instance, self._is_exportable_setter):
				self._export_setter(method)

		self._exports_initialized = True

	def start(self):
		"""Start the exports."""
		self._initialize_exports()
		for exporter in self._exporters:
			exporter.start()

	def stop(self):
		"""Stop the exports."""
		for exporter in self._exporters:
			exporter.stop()

Directory Contents

Dirs: 1 × Files: 6

Name Size Perms Modified Actions
- drwxr-xr-x 2025-03-30 04:15:50
Edit Download
3.46 KB lrw-r--r-- 2024-02-22 12:23:28
Edit Download
7.58 KB lrw-r--r-- 2024-02-22 12:23:28
Edit Download
3.04 KB lrw-r--r-- 2024-02-22 12:23:28
Edit Download
588 B lrw-r--r-- 2024-02-22 12:23:28
Edit Download
7.69 KB lrw-r--r-- 2024-02-22 12:23:28
Edit Download
1.86 KB lrw-r--r-- 2024-02-22 12:23:28
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).
© 2026 REDROOM — Secure File Manager. All rights reserved. Built with ❤️ & Red Dark UI