-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from sprockets/repackage
Repackage into a package
- Loading branch information
Showing
15 changed files
with
223 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ language: python | |
python: | ||
- 2.7 | ||
- 3.4 | ||
- 3.5 | ||
- pypy | ||
install: | ||
- pip install codecov | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,6 @@ | |
universal = 1 | ||
|
||
[nosetests] | ||
with-coverage = 1 | ||
cover-branches = 1 | ||
cover-erase = 1 | ||
cover-package = sprockets.mixins |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
""" | ||
sprockets.mixins.media_type | ||
""" | ||
import functools | ||
import warnings | ||
|
||
try: | ||
from .content import (ContentMixin, ContentSettings, | ||
add_binary_content_type, add_text_content_type, | ||
set_default_content_type) | ||
|
||
except ImportError as error: # pragma no cover | ||
def _error_closure(*args, **kwargs): | ||
raise error | ||
|
||
ContentMixin = _error_closure | ||
ContentSettings = _error_closure | ||
add_binary_content_type = _error_closure | ||
add_text_content_type = _error_closure | ||
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 = (1, 0, 4) | ||
__version__ = '.'.join(str(v) for v in version_info) | ||
__all__ = ('ContentMixin', 'ContentSettings', 'add_binary_content_type', | ||
'add_text_content_type', 'set_default_content_type', | ||
'version_info', '__version__') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.