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:
@@ -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
|
||||
|
@@ -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')
|
||||
|
Reference in New Issue
Block a user