本文整理汇总了Python中pyanaconda.core.signal.Signal类的典型用法代码示例。如果您正苦于以下问题:Python Signal类的具体用法?Python Signal怎么用?Python Signal使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Signal类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: CheckResult
class CheckResult(object):
"""Result of an input check."""
def __init__(self):
self._success = False
self._error_message = ""
self.error_message_changed = Signal()
@property
def success(self):
return self._success
@success.setter
def success(self, value):
self._success = value
@property
def error_message(self):
"""Optional error message describing why the input is not valid.
:returns: why the input is bad (provided it is bad) or None
:rtype: str or None
"""
return self._error_message
@error_message.setter
def error_message(self, new_error_message):
self._error_message = new_error_message
self.error_message_changed.emit(new_error_message)
示例2: __init__
def __init__(self):
self.module_properties_changed = Signal()
self.a_changed = Signal()
self.b_changed = Signal()
self._a = 1
self._b = 2
示例3: __init__
def __init__(self):
super().__init__()
self._firewall_module = FirewallModule()
self.hostname_changed = Signal()
self._hostname = "localhost.localdomain"
self.current_hostname_changed = Signal()
self._hostname_service_proxy = None
if conf.system.provides_system_bus:
self._hostname_service_proxy = HOSTNAME.get_proxy()
self._hostname_service_proxy.PropertiesChanged.connect(self._hostname_service_properties_changed)
self.connected_changed = Signal()
self.nm_client = None
# TODO fallback solution - use Gio/GNetworkMonitor ?
if SystemBus.check_connection():
nm_client = NM.Client.new(None)
if nm_client.get_nm_running():
self.nm_client = nm_client
self.nm_client.connect("notify::%s" % NM.CLIENT_STATE, self._nm_state_changed)
initial_state = self.nm_client.get_state()
self.set_connected(self._nm_state_connected(initial_state))
else:
log.debug("NetworkManager is not running.")
示例4: Test3Implementation
class Test3Implementation(object):
def __init__(self):
self.module_properties_changed = Signal()
self.a_changed = Signal()
self.b_changed = Signal()
self._a = 1
self._b = 2
@property
def a(self):
return self._a
def set_a(self, a):
self._a = a
self.a_changed.emit()
@property
def b(self):
return self._b
@b.setter
def b(self, b):
self._b = b
self.b_changed.emit()
def do_external_changes(self, a, b):
self.set_a(a)
self.b = b
def do_secret_changes(self, a, b):
self._a = a
self._b = b
示例5: __init__
def __init__(self):
"""Initialize the module."""
super().__init__()
self.bootloader_mode_changed = Signal()
self._bootloader_mode = BootloaderMode.ENABLED
self.bootloader_type_changed = Signal()
self._bootloader_type = BootloaderType.DEFAULT
self.preferred_location_changed = Signal()
self._preferred_location = BOOTLOADER_LOCATION_DEFAULT
self.drive_changed = Signal()
self._drive = ""
self.drive_order_changed = Signal()
self._drive_order = []
self.keep_mbr_changed = Signal()
self._keep_mbr = False
self.keep_boot_order_changed = Signal()
self._keep_boot_order = False
self.extra_arguments_changed = Signal()
self._extra_arguments = []
self.timeout_changed = Signal()
self._timeout = BOOTLOADER_TIMEOUT_UNSET
self.password_is_set_changed = Signal()
self._password = ""
self._password_is_encrypted = False
示例6: __init__
def __init__(self, storage, payload):
"""Create a new Hub instance.
The arguments this base class accepts defines the API that Hubs
have to work with. A Hub does not get free reign over everything
in the anaconda class, as that would be a big mess. Instead, a
Hub may count on the following:
data -- An instance of a pykickstart Handler object. The
Hub uses this to populate its UI with defaults
and to pass results back after it has run. The data
property must be implemented by classes inheriting
from Hub.
storage -- An instance of storage.Storage. This is useful for
determining what storage devices are present and how
they are configured.
payload -- An instance of a payload.Payload subclass. This
is useful for displaying and selecting packages to
install, and in carrying out the actual installation.
"""
self._storage = storage
self.payload = payload
self.paths = {}
self._spokes = {}
# entry and exit signals
# - get the hub instance as a single argument
self.entered = Signal()
self.exited = Signal()
# connect the default callbacks
self.entered.connect(self.entry_logger)
self.exited.connect(self.exit_logger)
示例7: InputField
class InputField(object):
"""An input field containing data to be checked.
The input field can have an initial value that can be
monitored for change via signals.
"""
def __init__(self, initial_content):
self._initial_content = initial_content
self._content = initial_content
self.changed = Signal()
self._initial_change_signal_fired = False
self.changed_from_initial_state = Signal()
@property
def content(self):
return self._content
@content.setter
def content(self, new_content):
old_content = self._content
self._content = new_content
# check if the input changed from the initial state
if old_content != new_content:
self.changed.emit()
# also fire the changed-from-initial-state signal if required
if not self._initial_change_signal_fired and new_content != self._initial_content:
self.changed_from_initial_state.emit()
self._initial_change_signal_fired = True
示例8: __init__
def __init__(self):
"""Initialize the module."""
super().__init__()
self.enabled_changed = Signal()
self._enabled = False
self.mount_points_changed = Signal()
self._mount_points = list()
示例9: __init__
def __init__(self):
super().__init__()
self._password_score = 0
self.password_score_changed = Signal()
self._status_text = ""
self.status_text_changed = Signal()
self._password_quality = 0
self.password_quality_changed = Signal()
self._length_ok = False
self.length_ok_changed = Signal()
示例10: __init__
def __init__(self):
super().__init__()
self.timezone_changed = Signal()
self._timezone = "America/New_York"
self.is_utc_changed = Signal()
self._is_utc = False
self.ntp_enabled_changed = Signal()
self._ntp_enabled = True
self.ntp_servers_changed = Signal()
self._ntp_servers = []
示例11: __init__
def __init__(self, message_bus, service_name):
"""Creates an DBus service observer.
:param message_bus: a message bus
:param service_name: a DBus name of a service
"""
self._message_bus = message_bus
self._service_name = service_name
self._is_service_available = False
self._service_available = Signal()
self._service_unavailable = Signal()
self._watched_id = None
示例12: __init__
def __init__(self):
super().__init__()
self.selinux_changed = Signal()
self._selinux = SELinuxMode.DEFAULT
self.authselect_changed = Signal()
self._authselect_args = []
self.authconfig_changed = Signal()
self._authconfig_args = []
self.realm_changed = Signal()
self._realm = self.create_realm()
示例13: __init__
def __init__(self):
super().__init__()
self.language_changed = Signal()
self._language = ""
self.language_support_changed = Signal()
self._language_support = []
self.language_seen_changed = Signal()
self._language_seen = False
self.keyboard_changed = Signal()
self._keyboard = ""
self.vc_keymap_changed = Signal()
self._vc_keymap = ""
self.x_layouts_changed = Signal()
self._x_layouts = []
self.switch_options_changed = Signal()
self._switch_options = []
self.keyboard_seen_changed = Signal()
self._keyboard_seen = False
示例14: __init__
def __init__(self):
super().__init__()
self.rootpw_seen_changed = Signal()
self._rootpw_seen = False
self.root_password_is_set_changed = Signal()
self._root_password_is_set = False
self._root_password = ""
self._root_password_is_crypted = False
self.root_account_locked_changed = Signal()
self._root_account_locked = False
self.users_changed = Signal()
self._users = {}
示例15: __init__
def __init__(self):
super().__init__()
self._progress_changed_signal = Signal()
self.__progress_lock = Lock()
self.__progress_step = 0
self.__progress_msg = ""