mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
contents: Add deprecation warnings for Page.filename and StaticContent.filepath
This commit is contained in:
parent
ec50e18a3e
commit
13cd0a4cb3
1 changed files with 9 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue