1
0
Fork 0
forked from github/pelican
pelican-theme/pelican
W. Trevor King 004adfa5cc content: Convert Path.filename to .source_path
Making everything consistent is a bit awkward, since this is a
commonly used attribute, but I've done my best.

Reasons for not consolidating on `filename`:

* It is often used for the "basename" (last component in the path).
  Using `source_path` makes it clear that this attribute can contain
  multiple components.

Reasons for not consolidating on `filepath`:

* It is barely used in the Pelican source, and therefore easy to
  change.
* `path` is more Pythonic.  The only place `filepath` ever show up in
  the documentation for `os`, `os.path`, and `shutil` is in the
  `os.path.relpath` documentation [1].

Reasons for not consolidating on `path`:

* The Page elements have both a source (this attribute) and a
  destination (.save_as).  To avoid confusion for developers not aware
  of this, make it painfully obvious that this attribute is for the
  source.  Explicit is better than implicit ;).

Where I was touching the line, I also updated the string formatting in
StaticGenerator.generate_output to use the forward compatible
'{}'.format() syntax.

[1]: http://docs.python.org/2/library/os.path.html#os.path.relpath
2013-01-18 07:57:35 -05:00
..
plugins Annotate py3k code when needed. 2013-01-11 18:55:04 +01:00
themes Strip tags from title in simple index. Fixes #612 2012-12-02 16:10:11 -08:00
tools Annotate py3k code when needed. 2013-01-11 18:55:04 +01:00
__init__.py Port pelican to python 3. 2013-01-11 03:20:09 +01:00
contents.py content: Convert Path.filename to .source_path 2013-01-18 07:57:35 -05:00
generators.py content: Convert Path.filename to .source_path 2013-01-18 07:57:35 -05:00
log.py Port pelican to python 3. 2013-01-11 03:20:09 +01:00
paginator.py Port pelican to python 3. 2013-01-11 03:20:09 +01:00
readers.py content: Convert Path.filename to .source_path 2013-01-18 07:57:35 -05:00
rstdirectives.py Port pelican to python 3. 2013-01-11 03:20:09 +01:00
server.py Port pelican to python 3. 2013-01-11 03:20:09 +01:00
settings.py content: Convert Path.filename to .source_path 2013-01-18 07:57:35 -05:00
signals.py Port pelican to python 3. 2013-01-11 03:20:09 +01:00
utils.py content: Convert Path.filename to .source_path 2013-01-18 07:57:35 -05:00
writers.py content: Convert Path.filename to .source_path 2013-01-18 07:57:35 -05:00