signature stringlengths 8 3.44k | body stringlengths 0 1.41M | docstring stringlengths 1 122k | id stringlengths 5 17 |
|---|---|---|---|
@property<EOL><INDENT>@foundations.trace.untracable<EOL>def logging_session_handler_stream(self):<DEDENT> | return self.__logging_session_handler_stream<EOL> | Property for **self.__logging_session_handler_stream** attribute.
:return: self.__logging_session_handler_stream.
:rtype: StreamObject | f13098:c0:m50 |
@logging_session_handler_stream.setter<EOL><INDENT>@foundations.trace.untracable<EOL>@foundations.exceptions.handle_exceptions(foundations.exceptions.ProgrammingError)<EOL>def logging_session_handler_stream(self, value):<DEDENT> | raise foundations.exceptions.ProgrammingError(<EOL>"<STR_LIT>".format(self.__class__.__name__, "<STR_LIT>"))<EOL> | Setter for **self.__logging_session_handler_stream** attribute.
:param value: Attribute value.
:type value: StreamObject | f13098:c0:m51 |
@logging_session_handler_stream.deleter<EOL><INDENT>@foundations.trace.untracable<EOL>@foundations.exceptions.handle_exceptions(foundations.exceptions.ProgrammingError)<EOL>def logging_session_handler_stream(self):<DEDENT> | raise foundations.exceptions.ProgrammingError(<EOL>"<STR_LIT>".format(self.__class__.__name__, "<STR_LIT>"))<EOL> | Deleter for **self.__logging_session_handler_stream** attribute. | f13098:c0:m52 |
@property<EOL><INDENT>def logging_active_formatter(self):<DEDENT> | return self.__logging_active_formatter<EOL> | Property for **self.__logging_active_formatter** attribute.
:return: self.__logging_active_formatter.
:rtype: Formatter | f13098:c0:m53 |
@logging_active_formatter.setter<EOL><INDENT>@foundations.exceptions.handle_exceptions(AssertionError)<EOL>def logging_active_formatter(self, value):<DEDENT> | if value is not None:<EOL><INDENT>assert type(value) in (<EOL>str, QString), "<STR_LIT>".format(<EOL>"<STR_LIT>", value)<EOL><DEDENT>self.__logging_active_formatter = value<EOL> | Setter for **self.__logging_active_formatter** attribute.
:param value: Attribute value.
:type value: unicode or QString | f13098:c0:m54 |
@logging_active_formatter.deleter<EOL><INDENT>@foundations.exceptions.handle_exceptions(foundations.exceptions.ProgrammingError)<EOL>def logging_active_formatter(self):<DEDENT> | raise foundations.exceptions.ProgrammingError(<EOL>"<STR_LIT>".format(self.__class__.__name__, "<STR_LIT>"))<EOL> | Deleter for **self.__logging_active_formatter** attribute. | f13098:c0:m55 |
@property<EOL><INDENT>def verbosity_level(self):<DEDENT> | return self.__verbosity_level<EOL> | Property for **self.__verbosity_level** attribute.
:return: self.__verbosity_level.
:rtype: int | f13098:c0:m56 |
@verbosity_level.setter<EOL><INDENT>@foundations.exceptions.handle_exceptions(AssertionError)<EOL>def verbosity_level(self, value):<DEDENT> | if value is not None:<EOL><INDENT>assert type(value) is int, "<STR_LIT>".format("<STR_LIT>", value)<EOL>assert value >= <NUM_LIT:0> and value <= <NUM_LIT:4>, "<STR_LIT>".format(<EOL>"<STR_LIT>")<EOL><DEDENT>self.__verbosity_level = value<EOL> | Setter for **self.__verbosity_level** attribute.
:param value: Attribute value.
:type value: int | f13098:c0:m57 |
@verbosity_level.deleter<EOL><INDENT>@foundations.exceptions.handle_exceptions(foundations.exceptions.ProgrammingError)<EOL>def verbosity_level(self):<DEDENT> | raise foundations.exceptions.ProgrammingError(<EOL>"<STR_LIT>".format(self.__class__.__name__, "<STR_LIT>"))<EOL> | Deleter for **self.__verbosity_level** attribute. | f13098:c0:m58 |
@property<EOL><INDENT>def settings(self):<DEDENT> | return self.__settings<EOL> | Property for **self.__settings** attribute.
:return: self.__settings.
:rtype: Preferences | f13098:c0:m59 |
@settings.setter<EOL><INDENT>@foundations.exceptions.handle_exceptions(foundations.exceptions.ProgrammingError)<EOL>def settings(self, value):<DEDENT> | raise foundations.exceptions.ProgrammingError(<EOL>"<STR_LIT>".format(self.__class__.__name__, "<STR_LIT>"))<EOL> | Setter for **self.__settings** attribute.
:param value: Attribute value.
:type value: Preferences | f13098:c0:m60 |
@settings.deleter<EOL><INDENT>@foundations.exceptions.handle_exceptions(foundations.exceptions.ProgrammingError)<EOL>def settings(self):<DEDENT> | raise foundations.exceptions.ProgrammingError(<EOL>"<STR_LIT>".format(self.__class__.__name__, "<STR_LIT>"))<EOL> | Deleter for **self.__settings** attribute. | f13098:c0:m61 |
@property<EOL><INDENT>def parameters(self):<DEDENT> | return self.__parameters<EOL> | Property for **self.__parameters** attribute.
:return: self.__parameters.
:rtype: object | f13098:c0:m62 |
@parameters.setter<EOL><INDENT>@foundations.exceptions.handle_exceptions(foundations.exceptions.ProgrammingError)<EOL>def parameters(self, value):<DEDENT> | raise foundations.exceptions.ProgrammingError(<EOL>"<STR_LIT>".format(self.__class__.__name__, "<STR_LIT>"))<EOL> | Setter for **self.__parameters** attribute.
:param value: Attribute value.
:type value: object | f13098:c0:m63 |
@parameters.deleter<EOL><INDENT>@foundations.exceptions.handle_exceptions(foundations.exceptions.ProgrammingError)<EOL>def parameters(self):<DEDENT> | raise foundations.exceptions.ProgrammingError(<EOL>"<STR_LIT>".format(self.__class__.__name__, "<STR_LIT>"))<EOL> | Deleter for **self.__parameters** attribute. | f13098:c0:m64 |
@property<EOL><INDENT>def arguments(self):<DEDENT> | return self.__arguments<EOL> | Property for **self.__arguments** attribute.
:return: self.__arguments.
:rtype: list | f13098:c0:m65 |
@arguments.setter<EOL><INDENT>@foundations.exceptions.handle_exceptions(foundations.exceptions.ProgrammingError)<EOL>def arguments(self, value):<DEDENT> | raise foundations.exceptions.ProgrammingError(<EOL>"<STR_LIT>".format(self.__class__.__name__, "<STR_LIT>"))<EOL> | Setter for **self.__arguments** attribute.
:param value: Attribute value.
:type value: list | f13098:c0:m66 |
@arguments.deleter<EOL><INDENT>@foundations.exceptions.handle_exceptions(foundations.exceptions.ProgrammingError)<EOL>def arguments(self):<DEDENT> | raise foundations.exceptions.ProgrammingError(<EOL>"<STR_LIT>".format(self.__class__.__name__, "<STR_LIT>"))<EOL> | Deleter for **self.__arguments** attribute. | f13098:c0:m67 |
@property<EOL><INDENT>def worker_threads(self):<DEDENT> | return self.__worker_threads<EOL> | Property for **self.__worker_threads** attribute.
:return: self.__worker_threads.
:rtype: list | f13098:c0:m68 |
@worker_threads.setter<EOL><INDENT>@foundations.exceptions.handle_exceptions(foundations.exceptions.ProgrammingError)<EOL>def worker_threads(self, value):<DEDENT> | raise foundations.exceptions.ProgrammingError(<EOL>"<STR_LIT>".format(self.__class__.__name__, "<STR_LIT>"))<EOL> | Setter for **self.__worker_threads** attribute.
:param value: Attribute value.
:type value: list | f13098:c0:m69 |
@worker_threads.deleter<EOL><INDENT>@foundations.exceptions.handle_exceptions(foundations.exceptions.ProgrammingError)<EOL>def worker_threads(self):<DEDENT> | raise foundations.exceptions.ProgrammingError(<EOL>"<STR_LIT>".format(self.__class__.__name__, "<STR_LIT>"))<EOL> | Deleter for **self.__worker_threads** attribute. | f13098:c0:m70 |
@property<EOL><INDENT>def is_processing(self):<DEDENT> | return self.__is_processing<EOL> | Property for **self.__is_processing** attribute.
:return: self.__is_processing.
:rtype: bool | f13098:c0:m71 |
@is_processing.setter<EOL><INDENT>@foundations.exceptions.handle_exceptions(foundations.exceptions.ProgrammingError)<EOL>def is_processing(self, value):<DEDENT> | raise foundations.exceptions.ProgrammingError(<EOL>"<STR_LIT>".format(self.__class__.__name__, "<STR_LIT>"))<EOL> | Setter for **self.__is_processing** attribute.
:param value: Attribute value.
:type value: bool | f13098:c0:m72 |
@is_processing.deleter<EOL><INDENT>@foundations.exceptions.handle_exceptions(foundations.exceptions.ProgrammingError)<EOL>def is_processing(self):<DEDENT> | raise foundations.exceptions.ProgrammingError(<EOL>"<STR_LIT>".format(self.__class__.__name__, "<STR_LIT>"))<EOL> | Deleter for **self.__is_processing** attribute. | f13098:c0:m73 |
@property<EOL><INDENT>def locals(self):<DEDENT> | return self.__locals<EOL> | Property for **self.__locals** attribute.
:return: self.__locals.
:rtype: dict | f13098:c0:m74 |
@locals.setter<EOL><INDENT>@foundations.exceptions.handle_exceptions(foundations.exceptions.ProgrammingError)<EOL>def locals(self, value):<DEDENT> | raise foundations.exceptions.ProgrammingError(<EOL>"<STR_LIT>".format(self.__class__.__name__, "<STR_LIT>"))<EOL> | Setter for **self.__locals** attribute.
:param value: Attribute value.
:type value: dict | f13098:c0:m75 |
@locals.deleter<EOL><INDENT>@foundations.exceptions.handle_exceptions(foundations.exceptions.ProgrammingError)<EOL>def locals(self):<DEDENT> | raise foundations.exceptions.ProgrammingError(<EOL>"<STR_LIT>".format(self.__class__.__name__, "<STR_LIT>"))<EOL> | Deleter for **self.__locals** attribute. | f13098:c0:m76 |
def dragEnterEvent(self, event): | LOGGER.debug("<STR_LIT>")<EOL>event.accept()<EOL> | Reimplements the :meth:`QWidget.dragEnterEvent` method.
:param event: QEvent.
:type event: QEvent | f13098:c0:m77 |
def dragMoveEvent(self, event): | LOGGER.debug("<STR_LIT>")<EOL>event.accept()<EOL> | Reimplements the :meth:`QWidget.dragMoveEvent` method.
:param event: QEvent.
:type event: QEvent | f13098:c0:m78 |
def dropEvent(self, event): | LOGGER.debug("<STR_LIT>")<EOL>self.content_dropped.emit(event)<EOL> | Reimplements the :meth:`QWidget.dropEvent` method.
:param event: QEvent.
:type event: QEvent | f13098:c0:m79 |
def show(self): | super(Umbra, self).show(setGeometry=False)<EOL> | Reimplements the :meth:`QWidget.show` method. | f13098:c0:m80 |
def closeEvent(self, event): | self.quit(event=event)<EOL> | Reimplements the :meth:`QWidget.closeEvent` method.
:param event: QEvent.
:type event: QEvent | f13098:c0:m81 |
def resizeEvent(self, event): | LOGGER.debug("<STR_LIT>")<EOL>self.size_changed.emit(event)<EOL>event.accept()<EOL> | Reimplements the :meth:`QWidget.resizeEvent` method.
:param event: QEvent.
:type event: QEvent | f13098:c0:m82 |
def __set_components(self, requisite=True): | components = self.__components_manager.list_components()<EOL>candidate_components =getattr(set(components), "<STR_LIT>" if requisite else "<STR_LIT>")(self.__requisite_components)<EOL>deactivated_components = self.__settings.get_key("<STR_LIT>", "<STR_LIT>").toString().split("<STR_LIT:U+002C>")<EOL>candidate_components =sorted([x for x in candidate_components if x not in deactivated_components], key=(components).index)<EOL>for component in candidate_components:<EOL><INDENT>try:<EOL><INDENT>profile = self.__components_manager.components[component]<EOL>interface = self.__components_manager.get_interface(component)<EOL>setattr(self,<EOL>"<STR_LIT>".format(self.__class__.__name__, foundations.namespace.get_leaf(component, "<STR_LIT:.>")),<EOL>interface)<EOL>self.__splashscreen and self.__splashscreen.show_message(<EOL>"<STR_LIT>".format(self.__class__.__name__, Constants.version, component))<EOL>interface.activate(self)<EOL>if profile.category in ("<STR_LIT>", "<STR_LIT>"):<EOL><INDENT>interface.initialize()<EOL><DEDENT>elif profile.category == "<STR_LIT>":<EOL><INDENT>interface.add_widget()<EOL>interface.initialize_ui()<EOL><DEDENT><DEDENT>except Exception as error:<EOL><INDENT>if requisite:<EOL><INDENT>message = "<STR_LIT>"<EOL>handler = umbra.reporter.system_exit_exception_handler<EOL><DEDENT>else:<EOL><INDENT>message = "<STR_LIT>"<EOL>handler = umbra.reporter.base_exception_handler<EOL><DEDENT>exception = manager.exceptions.ComponentActivationError(message.format(component, error))<EOL>handler(exception)<EOL><DEDENT><DEDENT> | Sets the Components.
:param requisite: Set only requisite Components.
:type requisite: bool | f13098:c0:m83 |
def __set_locals(self): | for globals in (Constants, RuntimeGlobals, UiConstants):<EOL><INDENT>self.__locals[globals.__name__] = globals<EOL><DEDENT>self.__locals[Constants.application_name] = self<EOL>self.__locals["<STR_LIT>"] = self<EOL>self.__locals["<STR_LIT>"] = self.__patches_manager<EOL>self.__locals["<STR_LIT>"] = self.__components_manager<EOL>self.__locals["<STR_LIT>"] = self.__actions_manager<EOL>self.__locals["<STR_LIT>"] = self.__file_system_events_manager<EOL>self.__locals["<STR_LIT>"] = self.__notifications_manager<EOL>self.__locals["<STR_LIT>"] = self.__layouts_manager<EOL>self.__locals["<STR_LIT>"] = LOGGER<EOL>LOGGER.debug("<STR_LIT>".format(self.__locals))<EOL> | Sets the locals for the requests_stack. | f13098:c0:m84 |
def __process_requests_stack(self): | while self.__requests_stack:<EOL><INDENT>try:<EOL><INDENT>exec(self.__requests_stack.popleft(), self.__locals)<EOL><DEDENT>except Exception as error:<EOL><INDENT>umbra.exceptions.notify_exception_handler(error)<EOL><DEDENT><DEDENT> | Process the requests stack. | f13098:c0:m85 |
def __components_instantiation_callback(self, profile): | self.__splashscreen and self.__splashscreen.show_message(<EOL>"<STR_LIT>".format(self.__class__.__name__, Constants.version,<EOL>profile.name))<EOL> | Defines a callback for Components instantiation.
:param profile: Component Profile.
:type profile: Profile | f13098:c0:m86 |
def __store_processing_state(self): | steps = self.Application_Progress_Status_processing.Processing_progressBar.maximum()<EOL>value = self.Application_Progress_Status_processing.Processing_progressBar.value()<EOL>message = self.Application_Progress_Status_processing.Processing_label.text()<EOL>state = self.__is_processing<EOL>self.__processing_state = steps, value, message, state<EOL> | Stores the processing state. | f13098:c0:m87 |
def __restore_processing_state(self): | steps, value, message, state = self.__processing_state<EOL>self.Application_Progress_Status_processing.Processing_progressBar.setRange(<NUM_LIT:0>, steps)<EOL>self.Application_Progress_Status_processing.Processing_progressBar.setValue(value)<EOL>self.set_processing_message(message, warning=False)<EOL>self.__is_processing = state<EOL>state and self.Application_Progress_Status_processing.show()<EOL> | Restores the processing state. | f13098:c0:m88 |
def set_verbosity_level(self, verbosity_level): | self.__verbosity_level = verbosity_level<EOL>foundations.verbose.set_verbosity_level(verbosity_level)<EOL>self.__settings.set_key("<STR_LIT>", "<STR_LIT>", verbosity_level)<EOL>self.verbosity_level_changed.emit(verbosity_level)<EOL>return True<EOL> | Sets the Application verbosity level.
:param verbosity_level: Verbosity level.
:type verbosity_level: int
:return: Method success.
:rtype: bool
:note: The expected verbosity level value is an integer between 0 to 4. | f13098:c0:m89 |
@foundations.exceptions.handle_exceptions(foundations.exceptions.FileExistsError)<EOL><INDENT>def set_visual_style(self, full_screen_style=False):<DEDENT> | LOGGER.debug("<STR_LIT>")<EOL>platform_styles = {"<STR_LIT>": (("<STR_LIT>", "<STR_LIT>"),<EOL>UiConstants.windows_style,<EOL>UiConstants.windows_stylesheet_file,<EOL>UiConstants.windows_full_screen_stylesheet_file),<EOL>"<STR_LIT>": (("<STR_LIT>",),<EOL>UiConstants.darwin_style,<EOL>UiConstants.darwin_stylesheet_file,<EOL>UiConstants.darwin_full_screen_stylesheet_file),<EOL>"<STR_LIT>": (("<STR_LIT>",),<EOL>UiConstants.linux_style,<EOL>UiConstants.linux_stylesheet_file,<EOL>UiConstants.linux_full_screen_stylesheet_file)}<EOL>style_sheet_file = None<EOL>for platform_style, settings in platform_styles.items():<EOL><INDENT>LOGGER.debug("<STR_LIT>".format(platform_style))<EOL>platform_systems, style, styleSheeFile, full_screen_style_sheet_file = settings<EOL>if platform.system() in platform_systems:<EOL><INDENT>RuntimeGlobals.application.setStyle(style)<EOL>style_sheet_path = umbra.ui.common.get_resource_path(styleSheeFile)<EOL>if full_screen_style:<EOL><INDENT>full_screen_style_sheet_path = umbra.ui.common.get_resource_path(full_screen_style_sheet_file,<EOL>raise_exception=False)<EOL>style_sheet_path = full_screen_style_sheet_path or style_sheet_path<EOL><DEDENT>style_sheet_file = foundations.io.File(style_sheet_path)<EOL>break<EOL><DEDENT><DEDENT>if not style_sheet_file:<EOL><INDENT>raise foundations.exceptions.FileExistsError(<EOL>"<STR_LIT>".format(self.__class__.__name__))<EOL><DEDENT>if foundations.common.path_exists(style_sheet_file.path):<EOL><INDENT>LOGGER.debug("<STR_LIT>".format(style_sheet_file.path))<EOL>style_sheet_file.cache()<EOL>for i, line in enumerate(style_sheet_file.content):<EOL><INDENT>search = re.search(r"<STR_LIT>", line)<EOL>if not search:<EOL><INDENT>continue<EOL><DEDENT>style_sheet_file.content[i] = line.replace(search.group("<STR_LIT:url>"),<EOL>foundations.strings.to_forward_slashes(<EOL>umbra.ui.common.get_resource_path(search.group("<STR_LIT:url>"))))<EOL><DEDENT>RuntimeGlobals.application.setStyleSheet(QString("<STR_LIT>".join(style_sheet_file.content)))<EOL>return True<EOL><DEDENT>else:<EOL><INDENT>raise foundations.exceptions.FileExistsError(<EOL>"<STR_LIT>".format(<EOL>self.__class__.__name__, style_sheet_file.path))<EOL><DEDENT> | Sets the Application visual style.
:param full_screen_style: Use fullscreen stylesheet file.
:type full_screen_style: bool
:return: Method success.
:rtype: bool | f13098:c0:m90 |
def is_full_screen(self): | return True if self.windowState().__int__() == <NUM_LIT:4> else False<EOL> | Returns if Application is in fullscreen state.
:return: FullScreen state.
:rtype: bool | f13098:c0:m91 |
def toggle_full_screen(self, *args): | LOGGER.debug("<STR_LIT>")<EOL>if self.is_full_screen():<EOL><INDENT>self.setUnifiedTitleAndToolBarOnMac(True)<EOL>self.set_visual_style(full_screen_style=False)<EOL>self.showNormal()<EOL>platform.system() == "<STR_LIT>" and self.resize(self.size().width() + <NUM_LIT:1>, self.size().height() + <NUM_LIT:1>)<EOL><DEDENT>else:<EOL><INDENT>self.setUnifiedTitleAndToolBarOnMac(False)<EOL>self.set_visual_style(full_screen_style=True)<EOL>self.showFullScreen()<EOL><DEDENT>return True<EOL> | Toggles Application fullscreen state.
:param \*args: Arguments.
:type \*args: \*
:return: Method success.
:rtype: bool | f13098:c0:m92 |
def process_events(self, flags=QEventLoop.AllEvents): | QApplication.processEvents(flags)<EOL>return True<EOL> | Process Application events.
:param flags: Events flags.
:type flags: int
:return: Method success.
:rtype: bool | f13098:c0:m93 |
def set_processing_message(self, message, warning=True): | if not self.__is_processing:<EOL><INDENT>warning and LOGGER.warning(<EOL>"<STR_LIT>".format(<EOL>self.__class__.__name__))<EOL>return False<EOL><DEDENT>LOGGER.debug("<STR_LIT>")<EOL>self.Application_Progress_Status_processing.Processing_label.setText(message)<EOL>self.process_events()<EOL>return True<EOL> | Sets the processing operation message.
:param message: Operation description.
:type message: unicode
:param warning: Emit warning message.
:type warning: int
:return: Method success.
:rtype: bool | f13098:c0:m94 |
def start_processing(self, message, steps=<NUM_LIT:0>, warning=True): | if self.__is_processing:<EOL><INDENT>warning and LOGGER.warning(<EOL>"<STR_LIT>".format(<EOL>self.__class__.__name__))<EOL>return False<EOL><DEDENT>LOGGER.debug("<STR_LIT>")<EOL>self.__is_processing = True<EOL>self.Application_Progress_Status_processing.Processing_progressBar.setRange(<NUM_LIT:0>, steps)<EOL>self.Application_Progress_Status_processing.Processing_progressBar.setValue(<NUM_LIT:0>)<EOL>self.Application_Progress_Status_processing.show()<EOL>self.set_processing_message(message)<EOL>return True<EOL> | Registers the start of a processing operation.
:param message: Operation description.
:type message: unicode
:param steps: Operation steps.
:type steps: int
:param warning: Emit warning message.
:type warning: int
:return: Method success.
:rtype: bool | f13098:c0:m95 |
def step_processing(self, warning=True): | if not self.__is_processing:<EOL><INDENT>warning and LOGGER.warning(<EOL>"<STR_LIT>".format(<EOL>self.__class__.__name__))<EOL>return False<EOL><DEDENT>LOGGER.debug("<STR_LIT>")<EOL>self.Application_Progress_Status_processing.Processing_progressBar.setValue(<EOL>self.Application_Progress_Status_processing.Processing_progressBar.value() + <NUM_LIT:1>)<EOL>self.process_events()<EOL>return True<EOL> | Steps the processing operation progress indicator.
:param warning: Emit warning message.
:type warning: int
:return: Method success.
:rtype: bool | f13098:c0:m96 |
def stop_processing(self, warning=True): | if not self.__is_processing:<EOL><INDENT>warning and LOGGER.warning(<EOL>"<STR_LIT>".format(<EOL>self.__class__.__name__))<EOL>return False<EOL><DEDENT>LOGGER.debug("<STR_LIT>")<EOL>self.__is_processing = False<EOL>self.Application_Progress_Status_processing.Processing_label.setText(QString())<EOL>self.Application_Progress_Status_processing.Processing_progressBar.setRange(<NUM_LIT:0>, <NUM_LIT:100>)<EOL>self.Application_Progress_Status_processing.Processing_progressBar.setValue(<NUM_LIT:0>)<EOL>self.Application_Progress_Status_processing.hide()<EOL>return True<EOL> | Registers the end of a processing operation.
:param warning: Emit warning message.
:type warning: int
:return: Method success.
:rtype: bool | f13098:c0:m97 |
def garbage_collect(self): | LOGGER.debug("<STR_LIT>")<EOL>return gc.collect()<EOL> | Triggers the garbage collecting.
:return: Number of unreachable objects found.
:rtype: int | f13098:c0:m98 |
def quit(self, exit_code=<NUM_LIT:0>, event=None): | <EOL>for component in reversed(self.__components_manager.list_components()):<EOL><INDENT>interface = self.__components_manager.get_interface(component)<EOL>if not interface:<EOL><INDENT>continue<EOL><DEDENT>if not interface.activated:<EOL><INDENT>continue<EOL><DEDENT>if not hasattr(interface, "<STR_LIT>"):<EOL><INDENT>continue<EOL><DEDENT>if not interface.on_close():<EOL><INDENT>event and event.ignore()<EOL>return<EOL><DEDENT><DEDENT>self.__layouts_manager.store_startup_layout()<EOL>self.__settings.settings.sync()<EOL>for worker_thread in self.__worker_threads:<EOL><INDENT>LOGGER.debug("<STR_LIT>".format(worker_thread))<EOL>if not worker_thread.isFinished():<EOL><INDENT>worker_thread.quit()<EOL><DEDENT>worker_thread.wait()<EOL><DEDENT>foundations.verbose.remove_logging_handler(self.__logging_file_handler)<EOL>foundations.verbose.remove_logging_handler(self.__logging_session_handler)<EOL>self.__timer.stop()<EOL>self.__timer = None<EOL>self.deleteLater()<EOL>event and event.accept()<EOL>exit(exit_code)<EOL> | Quits the Application.
:param exit_code: Exit code.
:type exit_code: int
:param event: QEvent.
:type event: QEvent | f13098:c0:m99 |
def _set_package_directory(): | package_directory = os.path.normpath(os.path.join(os.path.dirname(__file__), "<STR_LIT>"))<EOL>package_directory not in sys.path and sys.path.append(package_directory)<EOL>return True<EOL> | Sets the package directory in the path.
:return: Definition success.
:rtype: bool | f13100:m0 |
def _gather_exceptions(): | for attribute in dir(umbra.exceptions):<EOL><INDENT>object = getattr(umbra.exceptions, attribute)<EOL>if not inspect.isclass(object):<EOL><INDENT>continue<EOL><DEDENT>if issubclass(object, Exception):<EOL><INDENT>EXCEPTIONS.append(object)<EOL><DEDENT><DEDENT> | Gathers the exceptions. | f13101:m0 |
def base_exception_handler(*args): | Reporter().handle_exception(*args)<EOL>return True<EOL> | Provides a base exception handler.
:param \*args: Arguments.
:type \*args: \*
:return: Definition success.
:rtype: bool | f13105:m0 |
def system_exit_exception_handler(*args): | reporter = Reporter()<EOL>reporter.Footer_label.setText(<EOL>"<STR_LIT>".format(<EOL>Constants.application_name))<EOL>base_exception_handler(*args)<EOL>foundations.core.exit(<NUM_LIT:1>)<EOL>return True<EOL> | Provides a system exit exception handler.
:param \*args: Arguments.
:type \*args: \*
:return: Definition success.
:rtype: bool | f13105:m1 |
def critical_exception_handler(object): | @functools.wraps(object)<EOL>def critical_exception_handler_wrapper(*args, **kwargs):<EOL><INDENT>"""<STR_LIT>"""<EOL>_exceptions__frame__ = True<EOL>try:<EOL><INDENT>return object(*args, **kwargs)<EOL><DEDENT>except Exception as error:<EOL><INDENT>system_exit_exception_handler(error)<EOL><DEDENT><DEDENT>return critical_exception_handler_wrapper<EOL> | Marks an object that would system exit in case of critical exception.
:param object: Object to decorate.
:type object: object
:return: Object.
:rtype: object | f13105:m2 |
def install_exception_reporter(report=True): | reporter = Reporter(report=report)<EOL>sys.excepthook = reporter<EOL>return reporter<EOL> | Installs the exceptions reporter.
:param report: Report to Crittercism.
:type report: bool
:return: Reporter instance.
:rtype: Reporter | f13105:m3 |
def uninstall_exception_reporter(): | return foundations.exceptions.install_exception_handler()<EOL> | Uninstalls the exceptions reporter.
:return: Definition success.
:rtype: bool | f13105:m4 |
def enable_exception_reporter(): | reporter = Reporter().enabled = True<EOL>return True<EOL> | Enables the exceptions reporter.
:return: Definition success.
:rtype: bool | f13105:m5 |
def disable_exception_reporter(): | reporter = Reporter().enabled = False<EOL>return True<EOL> | Disables the exceptions reporter.
:return: Definition success.
:rtype: bool | f13105:m6 |
def __new__(cls, *args, **kwargs): | if not cls._Reporter__instance:<EOL><INDENT>cls._Reporter__instance = super(Reporter, cls).__new__(cls, *args, **kwargs)<EOL><DEDENT>return cls._Reporter__instance<EOL> | Constructor of the class.
:param \*args: Arguments.
:type \*args: \*
:param \*\*kwargs: Keywords arguments.
:type \*\*kwargs: \*\*
:return: Class instance.
:rtype: Library | f13105:c0:m0 |
def __init__(self, parent=None, report=True, enabled=True, *args, **kwargs): | if hasattr(self, "<STR_LIT>"):<EOL><INDENT>return<EOL><DEDENT>LOGGER.debug("<STR_LIT>".format(self.__class__.__name__))<EOL>super(Reporter, self).__init__(parent, *args, **kwargs)<EOL>self.__initialized = True<EOL>self.__report = None<EOL>self.report = report<EOL>self.__enabled = None<EOL>self.enabled = enabled<EOL>self.__jquery_javascript_path = umbra.ui.common.get_resource_path(os.path.join("<STR_LIT>", "<STR_LIT>"))<EOL>self.__crittercism_javascript_path = umbra.ui.common.get_resource_path(<EOL>os.path.join("<STR_LIT>", "<STR_LIT>"))<EOL>self.__reporter_javascript_path = umbra.ui.common.get_resource_path(os.path.join("<STR_LIT>", "<STR_LIT>"))<EOL>self.__jquery_javascript = foundations.io.File(self.__jquery_javascript_path).read()<EOL>self.__crittercism_javascript = foundations.io.File(self.__crittercism_javascript_path).read()<EOL>self.__reporter_javascript = foundations.io.File(self.__reporter_javascript_path).read().format(<EOL>UiConstants.crittercism_id, Constants.version)<EOL>self.__style = """<STR_LIT>"""<EOL>self.__html = None<EOL>self.__onlineText = "<STR_LIT>"<EOL>self.__offlineText = "<STR_LIT>".format(__email__, Constants.application_name)<EOL>self.__footerText ="<STR_LIT>".format(<EOL>Constants.application_name)<EOL>self.__initialize_ui()<EOL> | Initializes the class.
:param parent: Object parent.
:type parent: QObject
:param report: Report to Crittercism.
:type report: bool
:param enabled: Is reporter enabled.
:type enabled: bool
:param \*args: Arguments.
:type \*args: \*
:param \*\*kwargs: Keywords arguments.
:type \*\*kwargs: \*\* | f13105:c0:m1 |
@property<EOL><INDENT>def report(self):<DEDENT> | return self.__report<EOL> | Property for **self.__report** attribute.
:return: self.__report.
:rtype: bool | f13105:c0:m2 |
@report.setter<EOL><INDENT>@foundations.exceptions.handle_exceptions(AssertionError)<EOL>def report(self, value):<DEDENT> | if value is not None:<EOL><INDENT>assert type(value) is bool, "<STR_LIT>".format("<STR_LIT>", value)<EOL><DEDENT>self.__report = value<EOL> | Setter for **self.__report** attribute.
:param value: Attribute value.
:type value: bool | f13105:c0:m3 |
@report.deleter<EOL><INDENT>@foundations.exceptions.handle_exceptions(foundations.exceptions.ProgrammingError)<EOL>def report(self):<DEDENT> | raise foundations.exceptions.ProgrammingError(<EOL>"<STR_LIT>".format(self.__class__.__name__, "<STR_LIT>"))<EOL> | Deleter for **self.__report** attribute. | f13105:c0:m4 |
@property<EOL><INDENT>def enabled(self):<DEDENT> | return self.__enabled<EOL> | Property for **self.__enabled** attribute.
:return: self.__enabled.
:rtype: bool | f13105:c0:m5 |
@enabled.setter<EOL><INDENT>@foundations.exceptions.handle_exceptions(AssertionError)<EOL>def enabled(self, value):<DEDENT> | if value is not None:<EOL><INDENT>assert type(value) is bool, "<STR_LIT>".format("<STR_LIT>", value)<EOL><DEDENT>self.__enabled = value<EOL> | Setter for **self.__enabled** attribute.
:param value: Attribute value.
:type value: bool | f13105:c0:m6 |
@enabled.deleter<EOL><INDENT>@foundations.exceptions.handle_exceptions(foundations.exceptions.ProgrammingError)<EOL>def enabled(self):<DEDENT> | raise foundations.exceptions.ProgrammingError(<EOL>"<STR_LIT>".format(self.__class__.__name__, "<STR_LIT>"))<EOL> | Deleter for **self.__enabled** attribute. | f13105:c0:m7 |
def __call__(self, *args): | self.handle_exception(*args)<EOL> | Caller of the class.
:param \*args: Arguments.
:type \*args: \*
:param \*\*kwargs: Keywords arguments.
:type \*\*kwargs: \*\*
:return: Class instance.
:rtype: Library | f13105:c0:m8 |
def show(self): | RuntimeGlobals.splashscreen and RuntimeGlobals.splashscreen.hide()<EOL>super(Reporter, self).show()<EOL>self.raise_()<EOL> | Reimplements the :meth:`QWidget.show` method. | f13105:c0:m9 |
def __initialize_ui(self): | LOGGER.debug("<STR_LIT>".format(self.__class__.__name__))<EOL>self.__view = self.Reporter_webView<EOL>self.setWindowTitle("<STR_LIT>".format(Constants.application_name))<EOL>self.Footer_label.setText(self.__footerText)<EOL>self.__initialize_context_ui()<EOL>self.__set_html()<EOL>self.Copy_Report_pushButton.clicked.connect(self.__Copy_Report_pushButton__clicked)<EOL>self.Disable_Reporter_pushButton.clicked.connect(self.__Disable_Reporter_pushButton__clicked)<EOL> | Initializes the Widget ui. | f13105:c0:m10 |
def __initialize_context_ui(self): | if foundations.common.is_internet_available():<EOL><INDENT>text = self.__onlineText<EOL><DEDENT>else:<EOL><INDENT>text = self.__offlineText<EOL><DEDENT>self.Header_label.setText(text)<EOL> | Sets the context Widget ui. | f13105:c0:m11 |
def __Copy_Report_pushButton__clicked(self, checked): | clipboard = QApplication.clipboard()<EOL>clipboard.setText(self.__view.page().mainFrame().toPlainText())<EOL> | Defines the slot triggered by **Copy_Report_pushButton** Widget when clicked.
:param checked: Checked state.
:type checked: bool | f13105:c0:m12 |
def __Disable_Reporter_pushButton__clicked(self, checked): | uninstall_exception_reporter()<EOL>self.__enabled = False<EOL> | Defines the slot triggered by **Disable_Reporter_pushButton** Widget when clicked.
:param checked: Checked state.
:type checked: bool | f13105:c0:m13 |
def __get_html(self, body=None): | output = []<EOL>output.append("<STR_LIT>")<EOL>output.append("<STR_LIT>")<EOL>for javascript in (self.__jquery_javascript,<EOL>self.__crittercism_javascript,<EOL>self.__reporter_javascript):<EOL><INDENT>output.append("<STR_LIT>")<EOL>output.append(javascript)<EOL>output.append("<STR_LIT>")<EOL><DEDENT>output.append("<STR_LIT>")<EOL>output.append(self.__style)<EOL>output.append("<STR_LIT>")<EOL>output.append("<STR_LIT>")<EOL>if body is not None:<EOL><INDENT>output.append(body)<EOL><DEDENT>else:<EOL><INDENT>output.append("<STR_LIT>")<EOL>output.append("<STR_LIT>")<EOL>output.append("<STR_LIT>")<EOL>output.append("<STR_LIT>")<EOL><DEDENT>output.append("<STR_LIT>")<EOL>return "<STR_LIT:\n>".join(output)<EOL> | Returns the html content with given body tag content.
:param body: Body tag content.
:type body: unicode
:return: Html.
:rtype: unicode | f13105:c0:m14 |
def __set_html(self, html=None): | self.__html = self.__get_html(html)<EOL>self.__view.setHtml(self.__html)<EOL> | Sets the html content in the View using given body.
:param html: Html content.
:type html: unicode | f13105:c0:m15 |
def __update_html(self, html): | if platform.system() in ("<STR_LIT>", "<STR_LIT>"):<EOL><INDENT>html = re.sub(r"<STR_LIT>",<EOL>lambda x: foundations.strings.to_forward_slashes(x.group(<NUM_LIT:1>)),<EOL>html)<EOL><DEDENT>html = foundations.strings.replace(html, OrderedDict([('<STR_LIT:">', '<STR_LIT>'), ("<STR_LIT:\n>", "<STR_LIT>")]))<EOL>self.__evaluate_javascript("<STR_LIT>".format(html))<EOL> | Updates the View with given html content.
:param html: Html content.
:type html: unicode | f13105:c0:m16 |
def __evaluate_javascript(self, javascript): | self.__view.page().mainFrame().evaluateJavaScript(javascript)<EOL> | Evaluates given javascript content in the View.
:param javascript: Javascript.
:type javascript: unicode | f13105:c0:m17 |
def handle_exception(self, *args): | if not self.__enabled:<EOL><INDENT>return<EOL><DEDENT>cls, instance, trcback = foundations.exceptions.extract_exception(*args)<EOL>LOGGER.info("<STR_LIT>".format(<EOL>self.__class__.__name__, foundations.strings.to_string(cls)))<EOL>self.__initialize_context_ui()<EOL>self.__update_html(self.format_html_exception(cls, instance, trcback))<EOL>self.show()<EOL>self.__report and self.report_exception_to_crittercism(cls, instance, trcback)<EOL>foundations.exceptions.base_exception_handler(cls, instance, trcback)<EOL>self.exec_()<EOL> | Handles given exception.
:param \*args: Arguments.
:type \*args: \* | f13105:c0:m18 |
@staticmethod<EOL><INDENT>def format_html_exception(*args):<DEDENT> | escape = lambda x: foundations.strings.replace(x,<EOL>OrderedDict([("<STR_LIT:&>", "<STR_LIT>"), ("<STR_LIT:<>", "<STR_LIT>"), ("<STR_LIT:>>", "<STR_LIT>")]))<EOL>format = lambda x: foundations.strings.replace(x.expandtabs(<NUM_LIT:8>),<EOL>OrderedDict(<EOL>[("<STR_LIT>", "<STR_LIT>"), ("<STR_LIT>", "<STR_LIT>"), ("<STR_LIT:U+0020>", "<STR_LIT>"),<EOL>("<STR_LIT:\n>", "<STR_LIT>")]))<EOL>verbose = <NUM_LIT:10><EOL>cls, instance, trcback = args<EOL>stack = foundations.exceptions.extract_stack(foundations.exceptions.get_inner_most_frame(trcback), verbose)<EOL>python = "<STR_LIT>".format(sys.version.split()[<NUM_LIT:0>], sys.executable)<EOL>date = time.ctime(time.time())<EOL>html = []<EOL>html.append(<EOL>"<STR_LIT>".format(<EOL>python, date, escape(foundations.strings.to_string(cls))))<EOL>html.append("<STR_LIT>")<EOL>for line in foundations.exceptions.format_exception(cls, instance, trcback):<EOL><INDENT>html.append("<STR_LIT>".format(format(escape(line))))<EOL><DEDENT>html.append("<STR_LIT>")<EOL>html.append("<STR_LIT>")<EOL>html.append("<STR_LIT>".format(<EOL>Constants.application_name, Constants.version))<EOL>html.append("<STR_LIT>")<EOL>html.append("<STR_LIT>")<EOL>for frame, file_name, line_number, name, context, index in stack:<EOL><INDENT>location = "<STR_LIT>".format(escape(name) if name != "<STR_LIT>" else "<STR_LIT>",<EOL>inspect.formatargvalues(*inspect.getargvalues(frame)))<EOL>html.append(<EOL>"<STR_LIT>".format(<EOL>file_name, line_number, location))<EOL>html.append("<STR_LIT>")<EOL>for i, line in enumerate(context):<EOL><INDENT>if i == index:<EOL><INDENT>html.append("<STR_LIT>".format(<EOL>line_number - index + i, format(line)))<EOL><DEDENT>else:<EOL><INDENT>html.append("<STR_LIT>".format(line_number - index + i, format(line)))<EOL><DEDENT><DEDENT>html.append("<STR_LIT>")<EOL>html.append("<STR_LIT>")<EOL><DEDENT>html.append("<STR_LIT>")<EOL>html.append("<STR_LIT>")<EOL>html.append("<STR_LIT>")<EOL>for line in traceback.format_exception_only(cls, instance):<EOL><INDENT>html.append("<STR_LIT>".format(format(line)))<EOL><DEDENT>html.append("<STR_LIT>")<EOL>html.append("<STR_LIT>")<EOL>html.append("<STR_LIT>")<EOL>for frame, locals in foundations.exceptions.extract_locals(trcback):<EOL><INDENT>name, file_name, line_number = frame<EOL>html.append(<EOL>"<STR_LIT>".format(<EOL>escape(name), file_name, line_number))<EOL>html.append("<STR_LIT>")<EOL>html.append("<STR_LIT>")<EOL>arguments, nameless_args, keyword_args, locals = locals<EOL>has_arguments, has_locals = any((arguments, nameless_args, keyword_args)), any(locals)<EOL>has_arguments and html.append("<STR_LIT>".format("<STR_LIT>"))<EOL>for key, value in arguments.iteritems():<EOL><INDENT>html.append("<STR_LIT>".format(key, escape(value)))<EOL><DEDENT>for value in nameless_args:<EOL><INDENT>html.append("<STR_LIT>".format(escape(value)))<EOL><DEDENT>for key, value in sorted(keyword_args.iteritems()):<EOL><INDENT>html.append("<STR_LIT>".format(key, escape(value)))<EOL><DEDENT>has_arguments and html.append("<STR_LIT>")<EOL>has_locals and html.append("<STR_LIT>".format("<STR_LIT>"))<EOL>for key, value in sorted(locals.iteritems()):<EOL><INDENT>html.append("<STR_LIT>".format(key, escape(value)))<EOL><DEDENT>has_locals and html.append("<STR_LIT>")<EOL>html.append("<STR_LIT>")<EOL>html.append("<STR_LIT>")<EOL><DEDENT>html.append("<STR_LIT>")<EOL>return "<STR_LIT>".join(html)<EOL> | Formats given exception as an html text.
:param \*args: Arguments.
:type \*args: \*
:return: Exception html text.
:rtype: unicode | f13105:c0:m19 |
@staticmethod<EOL><INDENT>def formatTextException(*args):<DEDENT> | format = lambda x: re.sub(r"<STR_LIT>", lambda y: "<STR_LIT>".format("<STR_LIT:.>" * len(y.group(<NUM_LIT:0>))), x.rstrip().expandtabs(<NUM_LIT:4>))<EOL>verbose = <NUM_LIT:10><EOL>cls, instance, trcback = args<EOL>stack = foundations.exceptions.extract_stack(foundations.exceptions.get_inner_most_frame(trcback), verbose)<EOL>text = []<EOL>text.append(foundations.strings.to_string(cls))<EOL>text.append("<STR_LIT>")<EOL>for line in foundations.exceptions.format_exception(cls, instance, trcback):<EOL><INDENT>text.append(format("<STR_LIT>".format(format(line))))<EOL><DEDENT>text.append("<STR_LIT>")<EOL>text.append("<STR_LIT>".format(Constants.application_name,<EOL>Constants.version))<EOL>text.append("<STR_LIT>")<EOL>text.append("<STR_LIT>")<EOL>for frame, file_name, line_number, name, context, index in stack:<EOL><INDENT>location = "<STR_LIT>".format(name if name != "<STR_LIT>" else "<STR_LIT>",<EOL>inspect.formatargvalues(*inspect.getargvalues(frame)))<EOL>text.append("<STR_LIT>".format(file_name, line_number, location))<EOL>for i, line in enumerate(context):<EOL><INDENT>if i == index:<EOL><INDENT>text.append(format("<STR_LIT>".format(line_number - index + i, format(format(line)))))<EOL><DEDENT>else:<EOL><INDENT>text.append(format("<STR_LIT>".format(line_number - index + i, format(format(line)))))<EOL><DEDENT><DEDENT>text.append("<STR_LIT>")<EOL><DEDENT>for line in traceback.format_exception_only(cls, instance):<EOL><INDENT>text.append("<STR_LIT>".format(format(line)))<EOL><DEDENT>text.append("<STR_LIT>")<EOL>text.append("<STR_LIT>")<EOL>text.append("<STR_LIT>")<EOL>for frame, locals in foundations.exceptions.extract_locals(trcback):<EOL><INDENT>name, file_name, line_number = frame<EOL>text.append("<STR_LIT>".format(name, file_name, line_number))<EOL>arguments, nameless_args, keyword_args, locals = locals<EOL>has_arguments, has_locals = any((arguments, nameless_args, keyword_args)), any(locals)<EOL>has_arguments and text.append(format("<STR_LIT>"))<EOL>for key, value in arguments.iteritems():<EOL><INDENT>text.append(format("<STR_LIT>".format(key, value)))<EOL><DEDENT>for value in nameless_args:<EOL><INDENT>text.append(format("<STR_LIT>".format(value)))<EOL><DEDENT>for key, value in sorted(keyword_args.iteritems()):<EOL><INDENT>text.append(format("<STR_LIT>".format(key, value)))<EOL><DEDENT>has_locals and text.append(format("<STR_LIT>"))<EOL>for key, value in sorted(locals.iteritems()):<EOL><INDENT>text.append(format("<STR_LIT>".format(key, value)))<EOL><DEDENT>text.append("<STR_LIT>")<EOL><DEDENT>return text<EOL> | Formats given exception as a text.
:param \*args: Arguments.
:type \*args: \*
:return: Exception text.
:rtype: unicode | f13105:c0:m20 |
def report_exception_to_crittercism(self, *args): | if foundations.common.is_internet_available():<EOL><INDENT>cls, instance, trcback = args<EOL>title = re.escape("<STR_LIT>".join(map(lambda x: x.strip(), traceback.format_exception_only(cls, instance))))<EOL>file = trcback.tb_frame.f_code.co_filename<EOL>line_number = trcback.tb_lineno<EOL>stack = repr(map(str, self.formatTextException(cls, instance, trcback)))<EOL>javascript = "<STR_LIT>".format(<EOL>title, file, line_number, stack)<EOL>self.__evaluate_javascript(javascript)<EOL>LOGGER.info("<STR_LIT>".format(self.__class__.__name__))<EOL>return True<EOL><DEDENT>else:<EOL><INDENT>LOGGER.warning("<STR_LIT>".format(self.__class__.__name__))<EOL>return False<EOL><DEDENT> | Reports given exception to Crittercism.
:param \*args: Arguments.
:type \*args: \*
:return: Method success.
:rtype: bool | f13105:c0:m21 |
def __init__(self, parent=None): | LOGGER.debug("<STR_LIT>".format(self.__class__.__name__))<EOL>QThread.__init__(self, parent)<EOL>self.__container = parent<EOL>self.__paths = {}<EOL>self.__timer = None<EOL>self.__timer_cycle_multiplier = <NUM_LIT:5><EOL> | Initializes the class. | f13106:c0:m0 |
@property<EOL><INDENT>def container(self):<DEDENT> | return self.__container<EOL> | Property for **self.__container** attribute.
:return: self.__container.
:rtype: QObject | f13106:c0:m1 |
@container.setter<EOL><INDENT>@foundations.exceptions.handle_exceptions(foundations.exceptions.ProgrammingError)<EOL>def container(self, value):<DEDENT> | raise foundations.exceptions.ProgrammingError(<EOL>"<STR_LIT>".format(self.__class__.__name__, "<STR_LIT>"))<EOL> | Setter for **self.__container** attribute.
:param value: Attribute value.
:type value: QObject | f13106:c0:m2 |
@container.deleter<EOL><INDENT>@foundations.exceptions.handle_exceptions(foundations.exceptions.ProgrammingError)<EOL>def container(self):<DEDENT> | raise foundations.exceptions.ProgrammingError(<EOL>"<STR_LIT>".format(self.__class__.__name__, "<STR_LIT>"))<EOL> | Deleter for **self.__container** attribute. | f13106:c0:m3 |
@property<EOL><INDENT>def paths(self):<DEDENT> | return self.__paths<EOL> | Property for **self.__paths** attribute.
:return: self.__paths.
:rtype: dict | f13106:c0:m4 |
@paths.setter<EOL><INDENT>@foundations.exceptions.handle_exceptions(foundations.exceptions.ProgrammingError)<EOL>def paths(self, value):<DEDENT> | raise foundations.exceptions.ProgrammingError(<EOL>"<STR_LIT>".format(self.__class__.__name__, "<STR_LIT>"))<EOL> | Setter for **self.__paths** attribute.
:param value: Attribute value.
:type value: dict | f13106:c0:m5 |
@paths.deleter<EOL><INDENT>@foundations.exceptions.handle_exceptions(foundations.exceptions.ProgrammingError)<EOL>def paths(self):<DEDENT> | raise foundations.exceptions.ProgrammingError(<EOL>"<STR_LIT>".format(self.__class__.__name__, "<STR_LIT>"))<EOL> | Deleter for **self.__paths** attribute. | f13106:c0:m6 |
@property<EOL><INDENT>def timer(self):<DEDENT> | return self.__timer<EOL> | Property for **self.__timer** attribute.
:return: self.__timer.
:rtype: QTimer | f13106:c0:m7 |
@timer.setter<EOL><INDENT>@foundations.exceptions.handle_exceptions(foundations.exceptions.ProgrammingError)<EOL>def timer(self, value):<DEDENT> | raise foundations.exceptions.ProgrammingError(<EOL>"<STR_LIT>".format(self.__class__.__name__, "<STR_LIT>"))<EOL> | Setter for **self.__timer** attribute.
:param value: Attribute value.
:type value: QTimer | f13106:c0:m8 |
@timer.deleter<EOL><INDENT>@foundations.exceptions.handle_exceptions(foundations.exceptions.ProgrammingError)<EOL>def timer(self):<DEDENT> | raise foundations.exceptions.ProgrammingError(<EOL>"<STR_LIT>".format(self.__class__.__name__, "<STR_LIT>"))<EOL> | Deleter for **self.__timer** attribute. | f13106:c0:m9 |
@property<EOL><INDENT>def timer_cycle_multiplier(self):<DEDENT> | return self.__timer_cycle_multiplier<EOL> | Property for **self.__timer_cycle_multiplier** attribute.
:return: self.__timer_cycle_multiplier.
:rtype: float | f13106:c0:m10 |
@timer_cycle_multiplier.setter<EOL><INDENT>@foundations.exceptions.handle_exceptions(foundations.exceptions.ProgrammingError)<EOL>def timer_cycle_multiplier(self, value):<DEDENT> | raise foundations.exceptions.ProgrammingError(<EOL>"<STR_LIT>".format(self.__class__.__name__, "<STR_LIT>"))<EOL> | Setter for **self.__timer_cycle_multiplier** attribute.
:param value: Attribute value.
:type value: float | f13106:c0:m11 |
@timer_cycle_multiplier.deleter<EOL><INDENT>@foundations.exceptions.handle_exceptions(foundations.exceptions.ProgrammingError)<EOL>def timer_cycle_multiplier(self):<DEDENT> | raise foundations.exceptions.ProgrammingError(<EOL>"<STR_LIT>".format(self.__class__.__name__, "<STR_LIT>"))<EOL> | Deleter for **self.__timer_cycle_multiplier** attribute. | f13106:c0:m12 |
def __getitem__(self, path): | return self.__paths.__getitem__(path)<EOL> | Reimplements the :meth:`object.__getitem__` method.
:param path: Path name.
:type path: unicode
:return: Path.
:rtype: Path | f13106:c0:m13 |
def __setitem__(self, path, modified_time): | self.register_path(path, modified_time)<EOL> | Reimplements the :meth:`object.__setitem__` method.
:param path: Path.
:type path: unicode
:param modified_time: Modified time.
:type modified_time: int or float | f13106:c0:m14 |
def __iter__(self): | return self.__paths.iteritems()<EOL> | Reimplements the :meth:`object.__iter__` method.
:return: Paths iterator.
:rtype: object | f13106:c0:m15 |
def __contains__(self, path): | return path in self.__paths<EOL> | Reimplements the :meth:`object.__contains__` method.
:param path: Path name.
:type path: unicode
:return: Path existence.
:rtype: bool | f13106:c0:m16 |
def __len__(self): | return len(self.__paths)<EOL> | Reimplements the :meth:`object.__len__` method.
:return: Paths count.
:rtype: int | f13106:c0:m17 |
def get(self, path, default=None): | try:<EOL><INDENT>return self.__getitem__(path)<EOL><DEDENT>except KeyError as error:<EOL><INDENT>return default<EOL><DEDENT> | Returns given path value.
:param path: Path name.
:type path: unicode
:param default: Default value if path is not found.
:type default: object
:return: Action.
:rtype: QAction | f13106:c0:m18 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.