Moved attract.shots to attract.shots_and_assets

Assets are going to be pretty much the same thing as shots, with a few
different properties. Hooks and much other code can be reused.
This commit is contained in:
2016-11-09 13:00:07 +01:00
parent 2bb332c58a
commit 88a4a2fab3
5 changed files with 7 additions and 7 deletions

View File

@@ -10,7 +10,7 @@ from pillar.web.nodes.routes import url_for_node
import pillarsdk
import attract.tasks
import attract.shots
import attract.shots_and_assets
EXTENSION_NAME = 'attract'
@@ -22,7 +22,7 @@ class AttractExtension(PillarExtension):
def __init__(self):
self._log = logging.getLogger('%s.AttractExtension' % __name__)
self.task_manager = attract.tasks.TaskManager()
self.shot_manager = attract.shots.ShotManager()
self.shot_manager = attract.shots_and_assets.ShotManager()
@property
def name(self):
@@ -64,14 +64,14 @@ class AttractExtension(PillarExtension):
from . import routes
import attract.tasks.routes
import attract.shots.routes
import attract.shots_and_assets.routes
import attract.subversion.routes
return [
routes.blueprint,
attract.tasks.routes.blueprint,
attract.tasks.routes.perproject_blueprint,
attract.shots.routes.perproject_blueprint,
attract.shots_and_assets.routes.perproject_blueprint,
attract.subversion.routes.blueprint,
attract.subversion.routes.api_blueprint,
]
@@ -89,12 +89,12 @@ class AttractExtension(PillarExtension):
def setup_app(self, app):
"""Connects Blinker signals and sets up other app-dependent stuff in submodules."""
from . import comments, subversion, tasks, eve_hooks, shots
from . import comments, subversion, tasks, eve_hooks, shots_and_assets
subversion.task_logged.connect(self.task_manager.api_task_logged_in_svn)
comments.setup_app(app)
tasks.setup_app(app)
shots.setup_app(app)
shots_and_assets.setup_app(app)
eve_hooks.setup_app(app)
# Imports for side-effects

View File

@@ -407,7 +407,7 @@ class RequiredAfterCreationTest(AbstractShotTest):
class ProjectSummaryTest(unittest.TestCase):
def setUp(self):
from attract.shots import ProjectSummary
from attract.shots_and_assets import ProjectSummary
self.summ = ProjectSummary()
self.summ.count(u'todo')