diff --git a/attract/__init__.py b/attract/__init__.py index 1cb8d64..51b6c7f 100644 --- a/attract/__init__.py +++ b/attract/__init__.py @@ -1,11 +1,12 @@ import logging +import attract.shots import flask from werkzeug.local import LocalProxy from pillar.extension import PillarExtension import attract.tasks -import attract.shot_manager +import attract.shots EXTENSION_NAME = 'attract' @@ -14,7 +15,7 @@ class AttractExtension(PillarExtension): def __init__(self): self._log = logging.getLogger('%s.AttractExtension' % __name__) self.task_manager = attract.tasks.TaskManager() - self.shot_manager = attract.shot_manager.ShotManager() + self.shot_manager = attract.shots.ShotManager() @property def name(self): @@ -54,15 +55,16 @@ class AttractExtension(PillarExtension): :rtype: list of flask.Blueprint objects. """ - from . import modules, shots + from . import modules import attract.tasks.routes + import attract.shots.routes return [ modules.blueprint, attract.tasks.routes.blueprint, attract.tasks.routes.perproject_blueprint, - shots.blueprint, - shots.perproject_blueprint, + attract.shots.routes.blueprint, + attract.shots.routes.perproject_blueprint, ] @property diff --git a/attract/shot_manager.py b/attract/shots/__init__.py similarity index 96% rename from attract/shot_manager.py rename to attract/shots/__init__.py index 820597a..dcd4b6b 100644 --- a/attract/shot_manager.py +++ b/attract/shots/__init__.py @@ -1,5 +1,6 @@ """Shot management.""" + import collections import attr @@ -8,9 +9,8 @@ import flask_login import pillarsdk from pillar.web.system_util import pillar_api -from . import attrs_extra -from .node_types.shot import node_type_shot -from .node_types.task import node_type_task +from attract import attrs_extra +from attract.node_types import node_type_shot, node_type_task @attr.s diff --git a/attract/shots.py b/attract/shots/routes.py similarity index 95% rename from attract/shots.py rename to attract/shots/routes.py index f95103c..bfae4d2 100644 --- a/attract/shots.py +++ b/attract/shots/routes.py @@ -6,9 +6,9 @@ import flask import pillarsdk from pillar.web.system_util import pillar_api -from .modules import attract_project_view -from .node_types.shot import node_type_shot -from . import current_attract +from attract.modules import attract_project_view +from attract.node_types.shot import node_type_shot +from attract import current_attract blueprint = Blueprint('attract.shots', __name__, url_prefix='/shots') perproject_blueprint = Blueprint('attract.shots.perproject', __name__,