contents: Add deprecation warnings for Page.filename and StaticContent.filepath

This commit is contained in:
W. Trevor King 2013-01-04 13:03:19 -05:00
commit 13cd0a4cb3

View file

@ -15,7 +15,7 @@ from sys import platform, stdin
from pelican.settings import _DEFAULT_CONFIG
from pelican.utils import (slugify, truncate_html_words, memoized,
python_2_unicode_compatible)
python_2_unicode_compatible, deprecated_attribute)
from pelican import signals
import pelican.utils
@ -31,6 +31,10 @@ class Page(object):
mandatory_properties = ('title',)
default_template = 'page'
@deprecated_attribute(old='filename', new='source_path', since=(3, 2, 0))
def filename():
return None
def __init__(self, content, metadata=None, settings=None,
source_path=None, context=None):
# init parameters
@ -301,6 +305,10 @@ class Author(URLWrapper):
@python_2_unicode_compatible
class StaticContent(object):
@deprecated_attribute(old='filepath', new='source_path', since=(3, 2, 0))
def filepath():
return None
def __init__(self, src, dst=None, settings=None):
if not settings:
settings = copy.deepcopy(_DEFAULT_CONFIG)