Code cleanup and improved formatting
This commit is contained in:
@@ -86,7 +86,8 @@ class ValidateCustomFields(Validator):
|
|||||||
# We specify a settings.py file because when running on wsgi we can't detect it
|
# We specify a settings.py file because when running on wsgi we can't detect it
|
||||||
# automatically. The default path (which works in Docker) can be overriden with
|
# automatically. The default path (which works in Docker) can be overriden with
|
||||||
# an env variable.
|
# an env variable.
|
||||||
settings_path = os.environ.get('EVE_SETTINGS', '/data/git/pillar/pillar/settings.py')
|
settings_path = os.environ.get(
|
||||||
|
'EVE_SETTINGS', '/data/git/pillar/pillar/settings.py')
|
||||||
app = Eve(settings=settings_path, validator=ValidateCustomFields, auth=NewAuth)
|
app = Eve(settings=settings_path, validator=ValidateCustomFields, auth=NewAuth)
|
||||||
|
|
||||||
import config
|
import config
|
||||||
@@ -98,10 +99,9 @@ log = logging.getLogger(__name__)
|
|||||||
log.setLevel(logging.DEBUG if app.config['DEBUG'] else logging.INFO)
|
log.setLevel(logging.DEBUG if app.config['DEBUG'] else logging.INFO)
|
||||||
log.info('Pillar starting')
|
log.info('Pillar starting')
|
||||||
|
|
||||||
|
|
||||||
bugsnag.configure(
|
bugsnag.configure(
|
||||||
api_key = app.config['BUGSNAG_API_KEY'],
|
api_key=app.config['BUGSNAG_API_KEY'],
|
||||||
project_root = "/data/git/pillar/pillar",
|
project_root="/data/git/pillar/pillar",
|
||||||
)
|
)
|
||||||
handle_exceptions(app)
|
handle_exceptions(app)
|
||||||
|
|
||||||
@@ -211,7 +211,7 @@ def item_parse_attachments(response):
|
|||||||
"""Before returning a response, check if the 'attachments' property is
|
"""Before returning a response, check if the 'attachments' property is
|
||||||
defined. If yes, load the file (for the moment only images) in the required
|
defined. If yes, load the file (for the moment only images) in the required
|
||||||
variation, get the link and build a Markdown representation. Search in the
|
variation, get the link and build a Markdown representation. Search in the
|
||||||
'field' specified in the attachmentand replace the 'slug' tag with the
|
'field' specified in the attachment and replace the 'slug' tag with the
|
||||||
generated link.
|
generated link.
|
||||||
"""
|
"""
|
||||||
if 'properties' in response and 'attachments' in response['properties']:
|
if 'properties' in response and 'attachments' in response['properties']:
|
||||||
|
@@ -5,17 +5,13 @@ from eve.methods.put import put_internal
|
|||||||
from eve.methods.post import post_internal
|
from eve.methods.post import post_internal
|
||||||
from flask.ext.script import Manager
|
from flask.ext.script import Manager
|
||||||
from application import app
|
from application import app
|
||||||
from manage.node_types.act import node_type_act
|
|
||||||
from manage.node_types.asset import node_type_asset
|
from manage.node_types.asset import node_type_asset
|
||||||
from manage.node_types.blog import node_type_blog
|
from manage.node_types.blog import node_type_blog
|
||||||
from manage.node_types.comment import node_type_comment
|
from manage.node_types.comment import node_type_comment
|
||||||
from manage.node_types.group import node_type_group
|
from manage.node_types.group import node_type_group
|
||||||
from manage.node_types.post import node_type_post
|
from manage.node_types.post import node_type_post
|
||||||
from manage.node_types.project import node_type_project
|
from manage.node_types.project import node_type_project
|
||||||
from manage.node_types.scene import node_type_scene
|
|
||||||
from manage.node_types.shot import node_type_shot
|
|
||||||
from manage.node_types.storage import node_type_storage
|
from manage.node_types.storage import node_type_storage
|
||||||
from manage.node_types.task import node_type_task
|
|
||||||
from manage.node_types.texture import node_type_texture
|
from manage.node_types.texture import node_type_texture
|
||||||
from manage.node_types.group_texture import node_type_group_texture
|
from manage.node_types.group_texture import node_type_group_texture
|
||||||
|
|
||||||
@@ -23,6 +19,7 @@ manager = Manager(app)
|
|||||||
|
|
||||||
MONGO_HOST = os.environ.get('MONGO_HOST', 'localhost')
|
MONGO_HOST = os.environ.get('MONGO_HOST', 'localhost')
|
||||||
|
|
||||||
|
|
||||||
@manager.command
|
@manager.command
|
||||||
def runserver():
|
def runserver():
|
||||||
try:
|
try:
|
||||||
@@ -102,6 +99,7 @@ def setup_db():
|
|||||||
|
|
||||||
# TODO: Create a default project
|
# TODO: Create a default project
|
||||||
|
|
||||||
|
|
||||||
@manager.command
|
@manager.command
|
||||||
def clear_db():
|
def clear_db():
|
||||||
"""Wipes the database
|
"""Wipes the database
|
||||||
|
Reference in New Issue
Block a user