# Path: watcher_dashboard/api/watcher.py
# LOG = logging.getLogger(__name__)
# WATCHER_SERVICE = 'infra-optim'
# def watcherclient(request, password=None):
# def insert_watcher_policy_file():
#     def __init__(self, apiresource, request=None):
#     def create(cls, request, audit_template_uuid, audit_type, name=None,
#                auto_trigger=False, interval=None):
#     def list(cls, request, **filters):
#     def get(cls, request, audit_id):
#     def delete(cls, request, audit_id):
#     def id(self):
#     def __init__(self, apiresource, request=None):
#     def create(cls, request, name, goal, strategy,
#                description, scope):
#     def patch(cls, request, audit_template_id, parameters):
#     def list(cls, request, **filters):
#     def get(cls, request, audit_template_id):
#     def delete(cls, request, audit_template_id):
#     def id(self):
#     def __init__(self, apiresource, request=None):
#     def list(cls, request, **filters):
#     def get(cls, request, action_plan_id):
#     def delete(cls, request, action_plan_id):
#     def start(cls, request, action_plan_id):
#     def id(self):
#     def __init__(self, apiresource, request=None):
#     def list(cls, request, **filters):
#     def get(cls, request, action_id):
#     def delete(cls, request, action_id):
#     def start(cls, request, action_id):
#     def id(self):
#     def __init__(self, apiresource, request=None):
#     def list(cls, request, **filters):
#     def get(cls, request, goal):
#     def id(self):
#     def __init__(self, apiresource, request=None):
#     def list(cls, request, **filters):
#     def get(cls, request, strategy):
#     def id(self):
#     def __init__(self, indicator):
# class Audit(base.APIDictWrapper):
# class AuditTemplate(base.APIDictWrapper):
# class ActionPlan(base.APIDictWrapper):
# class Action(base.APIDictWrapper):
# class Goal(base.APIDictWrapper):
# class Strategy(base.APIDictWrapper):
# class EfficacyIndicatorSpec(base.APIDictWrapper):
# class EfficacyIndicator(base.APIDictWrapper):
# 
# Path: watcher_dashboard/content/goals/tables.py
# class GoalsTable(horizon.tables.DataTable):
#     class Meta(object):
# class EfficacySpecificationTable(horizon.tables.DataTable):
#     class Meta(object):
#     def get_object_id(self, datum):
#     def get_object_id(self, datum):
# 
# Path: watcher_dashboard/content/goals/tabs.py
# class OverviewTab(tabs.Tab):
# class GoalDetailTabs(tabs.TabGroup):
#     def get_context_data(self, request):
# 
# Path: watcher_dashboard/content/strategies/tables.py
# class StrategiesFilterAction(horizon.tables.FilterAction):
# class StrategiesTable(horizon.tables.DataTable):
#     class Meta(object):
# class RelatedStrategiesTable(horizon.tables.DataTable):
#     class Meta(object):
#     def get_object_id(self, datum):
#     def get_object_id(self, datum):


import logging
import horizon.exceptions
import horizon.tables
import horizon.tabs
import horizon.workflows
from django.utils.translation import ugettext_lazy as _
from horizon.utils import memoized
from watcher_dashboard.api import watcher
from watcher_dashboard.content.goals import tables
from watcher_dashboard.content.goals import tabs as wtabs
from watcher_dashboard.content.strategies import tables as strategies_tables
            msg = _('Unable to retrieve details for goal "%s".') \
                % goal_uuid
            horizon.exceptions.handle(
                self.request, msg,
                redirect=self.redirect_url)
        return goal

    def get_related_strategies_data(self):
        try:
            goal = self._get_data()
            strategies = watcher.Strategy.list(self.request, goal=goal.uuid)
        except Exception as exc:
            LOG.exception(exc)
            strategies = []
            msg = _('Strategy list cannot be retrieved.')
            horizon.exceptions.handle(self.request, msg)

        return strategies

    def get_efficacy_specification_data(self):
        try:
            goal = self._get_data()
            indicators_spec = [watcher.EfficacyIndicatorSpec(spec)
                               for spec in goal.efficacy_specification]
        except Exception as exc:
            LOG.exception(exc)
            indicators_spec = []
            msg = _('Efficacy specification cannot be retrieved.')
            horizon.exceptions.handle(self.request, msg)


# Path: watcher_dashboard/api/watcher.py
# LOG = logging.getLogger(__name__)
# WATCHER_SERVICE = 'infra-optim'
# def watcherclient(request, password=None):
# def insert_watcher_policy_file():
#     def __init__(self, apiresource, request=None):
#     def create(cls, request, audit_template_uuid, audit_type, name=None,
#                auto_trigger=False, interval=None):
#     def list(cls, request, **filters):
#     def get(cls, request, audit_id):
#     def delete(cls, request, audit_id):
#     def id(self):
#     def __init__(self, apiresource, request=None):
#     def create(cls, request, name, goal, strategy,
#                description, scope):
#     def patch(cls, request, audit_template_id, parameters):
#     def list(cls, request, **filters):
#     def get(cls, request, audit_template_id):
#     def delete(cls, request, audit_template_id):
#     def id(self):
#     def __init__(self, apiresource, request=None):
#     def list(cls, request, **filters):
#     def get(cls, request, action_plan_id):
#     def delete(cls, request, action_plan_id):
#     def start(cls, request, action_plan_id):
#     def id(self):
#     def __init__(self, apiresource, request=None):
#     def list(cls, request, **filters):
#     def get(cls, request, action_id):
#     def delete(cls, request, action_id):
#     def start(cls, request, action_id):
#     def id(self):
#     def __init__(self, apiresource, request=None):
#     def list(cls, request, **filters):
#     def get(cls, request, goal):
#     def id(self):
#     def __init__(self, apiresource, request=None):
#     def list(cls, request, **filters):
#     def get(cls, request, strategy):
#     def id(self):
#     def __init__(self, indicator):
# class Audit(base.APIDictWrapper):
# class AuditTemplate(base.APIDictWrapper):
# class ActionPlan(base.APIDictWrapper):
# class Action(base.APIDictWrapper):
# class Goal(base.APIDictWrapper):
# class Strategy(base.APIDictWrapper):
# class EfficacyIndicatorSpec(base.APIDictWrapper):
# class EfficacyIndicator(base.APIDictWrapper):
# 
# Path: watcher_dashboard/content/goals/tables.py
# class GoalsTable(horizon.tables.DataTable):
#     class Meta(object):
# class EfficacySpecificationTable(horizon.tables.DataTable):
#     class Meta(object):
#     def get_object_id(self, datum):
#     def get_object_id(self, datum):
# 
# Path: watcher_dashboard/content/goals/tabs.py
# class OverviewTab(tabs.Tab):
# class GoalDetailTabs(tabs.TabGroup):
#     def get_context_data(self, request):
# 
# Path: watcher_dashboard/content/strategies/tables.py
# class StrategiesFilterAction(horizon.tables.FilterAction):
# class StrategiesTable(horizon.tables.DataTable):
#     class Meta(object):
# class RelatedStrategiesTable(horizon.tables.DataTable):
#     class Meta(object):
#     def get_object_id(self, datum):
#     def get_object_id(self, datum):


# Path: watcher_dashboard/content/goals/views.py
import logging
import horizon.exceptions
import horizon.tables
import horizon.tabs
import horizon.workflows
from django.utils.translation import ugettext_lazy as _
from horizon.utils import memoized
from watcher_dashboard.api import watcher
from watcher_dashboard.content.goals import tables
from watcher_dashboard.content.goals import tabs as wtabs
from watcher_dashboard.content.strategies import tables as strategies_tables

            msg = _('Unable to retrieve details for goal "%s".') \
                % goal_uuid
            horizon.exceptions.handle(
                self.request, msg,
                redirect=self.redirect_url)
        return goal

    def get_related_strategies_data(self):
        try:
            goal = self._get_data()
            strategies = watcher.Strategy.list(self.request, goal=goal.uuid)
        except Exception as exc:
            LOG.exception(exc)
            strategies = []
            msg = _('Strategy list cannot be retrieved.')
            horizon.exceptions.handle(self.request, msg)

        return strategies

    def get_efficacy_specification_data(self):
        try:
            goal = self._get_data()
            indicators_spec = [watcher.EfficacyIndicatorSpec(spec)
                               for spec in goal.efficacy_specification]
        except Exception as exc:
            LOG.exception(exc)
            indicators_spec = []
            msg = _('Efficacy specification cannot be retrieved.')
            horizon.exceptions.handle(self.request, msg)


        return indicators_spec