Page MenuHome

__init__.py
No OneTemporary

__init__.py

from flask import request
from werkzeug import exceptions as wz_exceptions
def blender_cloud_addon_version():
"""Returns the version of the Blender Cloud Addon, or None if not given in the request.
Uses the 'Blender-Cloud-Addon' HTTP header.
:returns: the version of the addon, as tuple (major, minor, micro)
:rtype: tuple or None
:raises: werkzeug.exceptions.BadRequest if the header is malformed.
"""
header = request.headers.get('Blender-Cloud-Addon')
if not header:
return None
parts = header.split('.')
try:
return tuple(int(part) for part in parts)
except ValueError:
raise wz_exceptions.BadRequest('Invalid Blender-Cloud-Addon header')
def setup_app(app, url_prefix):
from . import texture_libs, home_project
texture_libs.setup_app(app, url_prefix=url_prefix)
home_project.setup_app(app, url_prefix=url_prefix)

File Metadata

Mime Type
text/x-python
Expires
Fri, Mar 5, 9:00 AM (2 d)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
7a/f4/0257cfda05b129930b3f25e839b4

Event Timeline