Move deprecation warning

This commit is contained in:
Takeshi KOMIYA 2017-04-27 00:33:40 +09:00
parent b3f596a133
commit 02ff0863c6

View File

@ -96,19 +96,22 @@ class CSSContainer(list):
the entry with Stylesheet class. the entry with Stylesheet class.
""" """
def append(self, obj): def append(self, obj):
warnings.warn('builder.css_files is deprecated. '
'Please use app.add_stylesheet() instead.',
RemovedInSphinx20Warning)
if isinstance(obj, Stylesheet): if isinstance(obj, Stylesheet):
super(CSSContainer, self).append(obj) super(CSSContainer, self).append(obj)
else: else:
super(CSSContainer, self).append(Stylesheet(obj, None, 'stylesheet')) super(CSSContainer, self).append(Stylesheet(obj, None, 'stylesheet'))
def extend(self, other): def extend(self, other):
warnings.warn('builder.css_files is deprecated. '
'Please use app.add_stylesheet() instead.',
RemovedInSphinx20Warning)
for item in other: for item in other:
self.append(item) self.append(item)
def __iadd__(self, other): def __iadd__(self, other):
warnings.warn('builder.css_files is deprecated. '
'Please use app.add_stylesheet() instead.',
RemovedInSphinx20Warning)
for item in other: for item in other:
self.append(item) self.append(item)