Skip to content

Commit

Permalink
Merge pull request #11 from sprockets/remove-deprecation
Browse files Browse the repository at this point in the history
Remove _mark_deprecated wrapper.
  • Loading branch information
gmr committed Feb 29, 2016
2 parents 8a381c5 + d571209 commit 0c1c757
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 20 deletions.
5 changes: 5 additions & 0 deletions docs/history.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Version History
===============

`2.0.1`_ (29 Feb 2016)
----------------------
- Removed deprecation wrapper since it seems to cause really interesting
problems including the much feared meta-class error.

`2.0.0`_ (24 Feb 2016)
----------------------
- Repackage from a module into a package. Distributing raw modules inside
Expand Down
23 changes: 3 additions & 20 deletions sprockets/mixins/mediatype/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,8 @@ def _error_closure(*args, **kwargs):
set_default_content_type = _error_closure


def _mark_deprecated(func):
msg = '{0}.{1} is deprecated, use {0}.content.{1} instead'.format(
'sprockets.mixins.mediatype', func.__name__)

@functools.wraps(func)
def wrapper(*args, **kwargs):
warnings.warn(msg, category=DeprecationWarning)
return func(*args, **kwargs)

return wrapper

add_binary_content_type = _mark_deprecated(add_binary_content_type)
add_text_content_type = _mark_deprecated(add_text_content_type)
set_default_content_type = _mark_deprecated(set_default_content_type)
ContentMixin = _mark_deprecated(ContentMixin)
ContentSettings = _mark_deprecated(ContentSettings)

version_info = (2, 0, 0)
version_info = (2, 0, 1)
__version__ = '.'.join(str(v) for v in version_info)
__all__ = ('ContentMixin', 'ContentSettings', 'add_binary_content_type',
__all__ = ['ContentMixin', 'ContentSettings', 'add_binary_content_type',
'add_text_content_type', 'set_default_content_type',
'version_info', '__version__')
'version_info', '__version__']

0 comments on commit 0c1c757

Please sign in to comment.