'(Re)build phase_handlers in this plugin'

def build_phase_handlers(self):

    for (phase, method_name) in phase_methods.items():
        if (phase in self.phase_handlers):
            continue
        if hasattr(self.instance, method_name):
            method = getattr(self.instance, method_name)
            if (not callable(method)):
                continue
            if hasattr(method, u'priority'):
                handler_prio = method.priority
            else:
                handler_prio = DEFAULT_PRIORITY
            event = add_phase_handler((u'plugin.%s.%s' % (self.name, phase)), method, handler_prio)
            event.plugin = self
            self.phase_handlers[phase] = event
