Moved shot-related code to a new attract.shots package

This commit is contained in:
2016-09-22 14:21:55 +02:00
parent 066fc91780
commit 8a360c0cda
3 changed files with 13 additions and 11 deletions

View File

@@ -1,11 +1,12 @@
import logging import logging
import attract.shots
import flask import flask
from werkzeug.local import LocalProxy from werkzeug.local import LocalProxy
from pillar.extension import PillarExtension from pillar.extension import PillarExtension
import attract.tasks import attract.tasks
import attract.shot_manager import attract.shots
EXTENSION_NAME = 'attract' EXTENSION_NAME = 'attract'
@@ -14,7 +15,7 @@ class AttractExtension(PillarExtension):
def __init__(self): def __init__(self):
self._log = logging.getLogger('%s.AttractExtension' % __name__) self._log = logging.getLogger('%s.AttractExtension' % __name__)
self.task_manager = attract.tasks.TaskManager() self.task_manager = attract.tasks.TaskManager()
self.shot_manager = attract.shot_manager.ShotManager() self.shot_manager = attract.shots.ShotManager()
@property @property
def name(self): def name(self):
@@ -54,15 +55,16 @@ class AttractExtension(PillarExtension):
:rtype: list of flask.Blueprint objects. :rtype: list of flask.Blueprint objects.
""" """
from . import modules, shots from . import modules
import attract.tasks.routes import attract.tasks.routes
import attract.shots.routes
return [ return [
modules.blueprint, modules.blueprint,
attract.tasks.routes.blueprint, attract.tasks.routes.blueprint,
attract.tasks.routes.perproject_blueprint, attract.tasks.routes.perproject_blueprint,
shots.blueprint, attract.shots.routes.blueprint,
shots.perproject_blueprint, attract.shots.routes.perproject_blueprint,
] ]
@property @property

View File

@@ -1,5 +1,6 @@
"""Shot management.""" """Shot management."""
import collections import collections
import attr import attr
@@ -8,9 +9,8 @@ import flask_login
import pillarsdk import pillarsdk
from pillar.web.system_util import pillar_api from pillar.web.system_util import pillar_api
from . import attrs_extra from attract import attrs_extra
from .node_types.shot import node_type_shot from attract.node_types import node_type_shot, node_type_task
from .node_types.task import node_type_task
@attr.s @attr.s

View File

@@ -6,9 +6,9 @@ import flask
import pillarsdk import pillarsdk
from pillar.web.system_util import pillar_api from pillar.web.system_util import pillar_api
from .modules import attract_project_view from attract.modules import attract_project_view
from .node_types.shot import node_type_shot from attract.node_types.shot import node_type_shot
from . import current_attract from attract import current_attract
blueprint = Blueprint('attract.shots', __name__, url_prefix='/shots') blueprint = Blueprint('attract.shots', __name__, url_prefix='/shots')
perproject_blueprint = Blueprint('attract.shots.perproject', __name__, perproject_blueprint = Blueprint('attract.shots.perproject', __name__,