Пример #1
0
    def __init__(self, availableFilters, availableFiltersFilter):
        self.available_filters = availableFilters
        self.available_filters_filter = availableFiltersFilter

        self.filters_dict = dict()
        self.removed_filters_dict = dict()

        config = Config()
        available_filter = config.get_config("available_filters_filter")
        if (available_filter):
            self.available_filters_filter.insert(available_filter)

        existing_filters = config.get_config('existing_filters')

        for existing_filters_key, existing_filters_value in existing_filters.items(
        ):
            self.filters_dict[existing_filters_value[
                'text']] = existing_filters_value['statusTip']

        self.filter_available_filters()

        ava_filters_style_str = config.array_config_str(
            'available_filters_style')
        if ava_filters_style_str:
            self.available_filters.setStyleSheet(ava_filters_style_str)

        ava_filters_filter_style_str = config.array_config_str(
            'available_filters_filter_style')
        if ava_filters_filter_style_str:
            self.available_filters_filter.setStyleSheet(
                ava_filters_filter_style_str)
Пример #2
0
    def __init__(self, availablelogsfilter, availablelogs):
        self.available_logs_filter = availablelogsfilter
        self.available_logs = availablelogs

        # setup class variables
        self.path_file_dict = dict()
        self.removed_logs_dict = dict()

        config = Config()
        available_filter = config.get_config("available_logs_filter")
        if(available_filter):
            self.available_logs_filter.insert(available_filter)

        selected_logs = config.get_config('selected_logs')

        for selected_log_item_key, selected_log_item_value in selected_logs.items():
            self.removed_logs_dict[selected_log_item_value['text']] = selected_log_item_value['statusTip']

        existing_log_locations = config.get_config("existing_log_locations")
        self.add_log_files(existing_log_locations)

        ava_log_style_str = config.array_config_str('available_logs_style')
        if ava_log_style_str:
            self.available_logs.setStyleSheet(ava_log_style_str)

        ava_log_filter_style_str = config.array_config_str('available_log_filter_style')
        if ava_log_filter_style_str:
            self.available_logs_filter.setStyleSheet(ava_log_filter_style_str)
Пример #3
0
    def __init__(self, logFileLocation, logTextDisplay, parent=None):
        super(DisplayLogProcessingOps, self).__init__(parent)

        self.log_file_location = logFileLocation
        self.log_text_display = logTextDisplay

        self.search_history = []
        self.goto_line_history = []
        self.log_filters = dict()

        # cache the log lines internally with a pandas Dataframe
        self.log_df = pd.DataFrame(columns=['line_number', 'log_line'])

        self.init_read_logfile()

        config = Config()
        style_str = config.array_config_str('log_display_style')
        if style_str:
            self.log_text_display.getTextEdit().setStyleSheet(style_str)

        log_processing_config = config.get_config(self.log_file_location)
        if log_processing_config:
            self.search_history = log_processing_config['search_history']
            self.goto_line_history = log_processing_config['goto_line_history']
            self.log_filters = log_processing_config['log_filters']

        # init the text highlighting class
        self.highlighter = Highlighter(
            self.log_text_display.getTextEdit().document())

        self.lock = threading.Lock()
Пример #4
0
    def __init__(self):
        self.dialog = QtWidgets.QDialog()
        self.ui = Ui_logLocations()
        self.ui.setupUi(self.dialog)

        config = Config()
        existing_log_locations = config.get_config("existing_log_locations")

        for log_location in existing_log_locations:
            self.ui.existingLogLocation.addItem(log_location)

        self.configure_locations_dialog()
        self.configure_locations_actions()
Пример #5
0
    def __init__(self, parent=None):
        super(Highlighter, self).__init__(parent)

        self.searchFormat = QTextCharFormat()
        self.searchFormat.setForeground(Qt.darkYellow)

        self.highlightingRules = []

        config = Config()
        highlight_config = config.get_config('log_highlighter')
        if highlight_config:
            for hl_config in highlight_config:
                text_format = QTextCharFormat()
                text_format.setForeground(QColor(hl_config['color']))
                self.highlightingRules.append((QRegExp(hl_config['regex']),text_format))
Пример #6
0
    def __init__(self, selectedLogsList):
        QListWidget.__init__(self, selectedLogsList)

        self.selected_logs = dict()

        config = Config()
        self.selected_logs = config.get_config('selected_logs')

        for selected_log_item_key, selected_log_item_value in self.selected_logs.items(
        ):
            list_item = self.create_list_widget_item(
                selected_log_item_value['text'],
                selected_log_item_value['statusTip'])
            self.add_new_log(list_item, False)

        selected_logs_style = config.array_config_str('selected_logs_style')
        if selected_logs_style:
            self.setStyleSheet(selected_logs_style)
Пример #7
0
    def __init__(self, appliedFilters):
        self.dialog = QtWidgets.QDialog()
        self.ui = Ui_logFilters()
        self.ui.setupUi(self.dialog)

        self.applied_filters = appliedFilters

        self.selected_items = []

        config = Config()
        existing_filters = config.get_config('existing_filters')

        for filter_item_key, filter_item_value in existing_filters.items():
            list_item = self.create_new_item(filter_item_value['text'],
                                             filter_item_value['statusTip'])
            self.ui.existingFilters.addItem(list_item)

        self.configure_filters_dialog()
        self.configure_filters_actions()