Exemplo n.º 1
0
    def __init__(self, filename):
        self.filename = filename

        config = coreaux_api.get_plugin_configuration('wxscheduler')(
                                                                'TreeIcons')
        char = config['symbol']

        if char != '':
            bits_to_colour = {1: wx.Colour()}
            bits_to_colour[1].SetFromString(config['color'])

            self.property_shift, self.property_mask = \
                                            wxgui_api.add_item_property(
                                            filename, 1, char, bits_to_colour)

            organism_api.bind_to_update_item_rules_conditional(
                                                    self._handle_update_rules)
            organism_api.bind_to_history_insert(self._handle_history)
            organism_api.bind_to_history_update(self._handle_history)

            wxgui_api.bind_to_open_database(self._handle_open_database)
            wxgui_api.bind_to_close_database(self._handle_close_database)

            if wxcopypaste_api:
                wxcopypaste_api.bind_to_items_pasted(self._handle_paste)
Exemplo n.º 2
0
    def __init__(self, filename):
        self.filename = filename

        config = coreaux_api.get_plugin_configuration('wxscheduler')(
                                                                'TreeIcons')
        char = config['symbol']

        if char != '':
            bits_to_colour = {1: wx.Colour()}
            bits_to_colour[1].SetFromString(config['color'])

            self.property_shift, self.property_mask = \
                                            wxgui_api.add_item_property(
                                            filename, 1, char, bits_to_colour)

            organism_api.bind_to_update_item_rules_conditional(
                                                    self._handle_update_rules)
            organism_api.bind_to_history_insert(self._handle_history)
            organism_api.bind_to_history_update(self._handle_history)

            wxgui_api.bind_to_open_database(self._handle_open_database)
            wxgui_api.bind_to_close_database(self._handle_close_database)

            if wxcopypaste_api:
                wxcopypaste_api.bind_to_items_pasted(self._handle_paste)
Exemplo n.º 3
0
    def _handle_close_database(self, kwargs):
        if kwargs['filename'] == self.filename:
            organism_api.bind_to_update_item_rules_conditional(
                                            self._handle_update_rules, False)
            organism_api.bind_to_history_insert(self._handle_history, False)
            organism_api.bind_to_history_update(self._handle_history, False)

            wxgui_api.bind_to_open_database(self._handle_open_database, False)
            wxgui_api.bind_to_close_database(self._handle_close_database,
                                                                        False)

            if wxcopypaste_api:
                wxcopypaste_api.bind_to_items_pasted(self._handle_paste, False)
Exemplo n.º 4
0
    def _handle_close_database(self, kwargs):
        if kwargs['filename'] == self.filename:
            organism_api.bind_to_update_item_rules_conditional(
                                            self._handle_update_rules, False)
            organism_api.bind_to_history_insert(self._handle_history, False)
            organism_api.bind_to_history_update(self._handle_history, False)

            wxgui_api.bind_to_open_database(self._handle_open_database, False)
            wxgui_api.bind_to_close_database(self._handle_close_database,
                                                                        False)

            if wxcopypaste_api:
                wxcopypaste_api.bind_to_items_pasted(self._handle_paste, False)
Exemplo n.º 5
0
    def __init__(self):
        self.rules = timer.Rules()
        self.databases = {}
        self.nextoccsengine = timer.NextOccurrencesEngine(
            self.databases, self.rules.handlers)

        core_api.bind_to_open_database_dirty(self._handle_open_database_dirty)
        core_api.bind_to_close_database(self._handle_close_database)
        core_api.bind_to_delete_subtree(
            self._handle_search_next_occurrences_request)
        core_api.bind_to_history(self._handle_search_next_occurrences_request)
        core_api.bind_to_exit_app_1(
            self._handle_search_next_occurrences_cancel_request)

        organism_api.bind_to_open_database(self._handle_open_database)
        organism_api.bind_to_update_item_rules_conditional(
            self._handle_search_next_occurrences_request)

        if copypaste_api:
            copypaste_api.bind_to_items_pasted(
                self._handle_search_next_occurrences_request)
Exemplo n.º 6
0
    def __init__(self):
        self.rules = timer.Rules()
        self.databases = {}
        self.nextoccsengine = timer.NextOccurrencesEngine(self.databases,
                                                        self.rules.handlers)

        core_api.bind_to_open_database_dirty(self._handle_open_database_dirty)
        core_api.bind_to_close_database(self._handle_close_database)
        core_api.bind_to_delete_subtree(
                                self._handle_search_next_occurrences_request)
        core_api.bind_to_history(self._handle_search_next_occurrences_request)
        core_api.bind_to_exit_app_1(
                        self._handle_search_next_occurrences_cancel_request)

        organism_api.bind_to_open_database(self._handle_open_database)
        organism_api.bind_to_update_item_rules_conditional(
                                self._handle_search_next_occurrences_request)

        if copypaste_api:
            copypaste_api.bind_to_items_pasted(
                                self._handle_search_next_occurrences_request)