Commit graph

2,217 commits

Author SHA1 Message Date
Ondrej Grover
615871b927 Generator.get_files backwards compatibility for 1 path
This should prevent outdated plugins with generators from failing.
Also fixes #1382.
2014-06-28 16:18:47 -07:00
Ondrej Grover
138c8de1b9 Fix test_direct_templates_save_as_false test case
A non-existent asserts_called_count attr was used which would always
succeed, silently hiding the error.
2014-06-28 16:18:47 -07:00
Deniz Turgut
817bf6ff59 Patch docutils.io.FileInput to not use "U" mode in py3
"U" mode is redundant in py3 since "newline" argument replaces it and by default
universal newlines is enabled. As of py3.4, "U" mode triggers a deprecation warning.
2014-06-28 16:18:47 -07:00
Deniz Turgut
2d8116b84c Fix HTMLParser related deprecation warnings in Py3.4 2014-06-28 16:18:47 -07:00
Deniz Turgut
49d5c1c782 Fix test errors on OSX
On OSX, if LC_TIME and LC_CTYPE differs the output of strftime is not properly decoded
in Python 3. This makes sure that the 'utils.DateFormatter' and the related Jinja filter
'strftime' set the same value for LC_TIME and LC_CTYPE while formatting.

Also, '%a' is removed from DEFAULT_DATE_FORMAT in 'custom_locale' tests. OSX and *nix have
different conversions for '%a' ('Jeu' vs 'jeu.') and there is not a feasible way to handle
the difference for tests.
2014-06-28 16:18:47 -07:00
Ondrej Grover
21b7007a8d Fix #1198, enable custom locale in template rendering, fixes links
reverts getpelican/pelican@ddcccfeaa9

If one used a locale that made use of unicode characters (like fr_FR.UTF-8)
the files on disk would be in correct locale while links would be to C.

Uses a SafeDatetime class that works with unicode format strigns
by using custom strftime to prevent ascii decoding errors with Python2.

Also added unicode decoding for the calendar module to fix period
archives.
2014-06-28 16:18:47 -07:00
Kyle Fuller
294b213bf5 [coveralls] Exclude tests from coverage 2014-06-28 16:18:47 -07:00
Deniz Turgut
24aca13b3e Remove AsciiDocReader from core. Fixes #1355 2014-06-28 16:18:47 -07:00
OGINO Masanori
b7c23dc160 Use six.moves.urllib.
Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
2014-06-28 16:18:47 -07:00
OGINO Masanori
c319030259 Require six version 1.4.0 or later.
six.moves.urllib.parse is available since version 1.4.0.

Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
2014-06-28 16:18:47 -07:00
Ondrej Grover
8af9ecc719 catch arbitrary exceptions during cache unpickling
It is hard to forsee what could be raised.
2014-06-28 16:18:47 -07:00
Deniz Turgut
fdfa738be3 Docs update for *_{previous|next}_page variables 2014-06-28 16:18:47 -07:00
Ondrej Grover
1cb190df7f Fix RstReader authors metadata processing
The reader would return a list of authors already, but
METADATA_PROCESSORS['authors'] expects a string.
Added a test case for this (only the HTMLReader had it).
2014-06-28 16:18:47 -07:00
Ondrej Grover
5b68a3e633 Add {PAGE,ARTICLE}_PATHS to {ARTICLE,PAGE}_EXCLUDES automatically
This makes it easier for someone to change PAGE_PATHS without the
need to change ARTICLE_EXCLUDES accordingly.
2014-06-28 16:18:47 -07:00
Ondrej Grover
fe10d58aa4 Fix #1344 move PLUGIN_PATH -> PLUGIN_PATHS
Pelican uses *_PATHS names for settings that represent a list of paths.
2014-06-28 16:18:46 -07:00
Ondrej Grover
0d0ee07a27 move {ARTICLE,PAGE}_DIR -> {ARTICLE,PAGE}_PATHS
Instead of one path a list can be given. This is due to popular request.
Should help people not wanting to use Pelican for blogging.
Maintain backward compatibility though.
Thanks to @ingwinlu for pointing out the change in StaticGenerator.
2014-06-28 16:18:46 -07:00
Justin Mayer
cb55efd998 If PATH is undefined, Pelican uses PWD as content 2014-06-28 16:18:46 -07:00
Justin Mayer
bb38f66e4a Split Getting Started docs into separate sections
The "Getting Started" docs became overly long and unwieldy over time.
This splits it into separate sections, including:

* Quickstart
* Installation
* Writing content
* Publish your site
2014-06-28 16:18:46 -07:00
Justin Mayer
3b78e15252 Prepare for splitting up Getting Started docs 2014-06-28 16:18:46 -07:00
Ondrej Grover
f1a0af54ec Fix typo in command-line option description. 2014-06-28 16:18:46 -07:00
Ondrej Grover
6d387f63f0 Fix intrasite links substitions in content
The Content.__eq__ method would indirectly call _update_content too
soon, resulting in failed intrasite links substitution
This effectively reverts fd77926700
for pelican/contents.py, it was unnecessary anyways.
Thanks to Strom for finding this.
2014-06-28 16:18:46 -07:00
Ondrej Grover
faa5f4763a Fix #1335 remove old and unmaintained French docs
Unfortunately nobody keeps them up to date, they would just spread
confusion.
2014-06-28 16:18:46 -07:00
Ondrej Grover
4fc448ac0d rename CACHE_DIR -> CACHE_PATH to unify with rest of Pelican
CACHE_PATH can now be relative to settings file like OUTPUT_PATH.
Also add --cache-path commandline option.
Change cache loading warning to a less scary and more helpful message.
2014-06-28 16:18:46 -07:00
Justin Mayer
4239b47b83 Remove errant backtick 2014-06-28 16:18:46 -07:00
Ondrej Grover
9e6c669949 Fix get_writer signal received result unpacking 2014-06-28 16:18:46 -07:00
Justin Mayer
0d3687866a Remove errant leading spaces from fabfile.py.in 2014-06-28 16:18:46 -07:00
Justin Mayer
01a0e727e3 Show setting defaults as actual code
For some reason, setting names on the Settings page have long been
wrapped in single back-ticks (usually meant for linking in reST) instead
of double back-ticks (meant for denoting code). This seems to be
widespread throughout the docs, and it's not clear if this is
intentional or simply a reST formatting error that got propagated by
others in order to stay consistent. This commit applies double
back-ticks in any case where something resembling code is shown, with
the idea that single back-ticks should only be used when linking.

More importantly, the settings denoted their default values in
parentheses, which hapless users often included when copying and pasting
these values into their config files. As one can imagine, confusion —
not hilarity — ensued. Setting defaults are now shown as they would
actually appear in one's settings file, with an equal sign and without
parentheses.

During this spelunking expedition, many other minor improvements were
concurrently conducted.
2014-06-28 16:18:46 -07:00
Justin Mayer
4c1009e59c Add Python 3.4 to Travic CI configuration 2014-06-28 16:18:46 -07:00
Ondrej Grover
91d4202a68 Fix #1277 use rsync -c option as all output is rewritten
Because Pelican always rewrites all output, the mtimes always change, so
rsync would always transfer all the files which defeats the purpose of
rsync. The '-c' option (--checksum) compares the checksums rather than
mtimes.
2014-06-28 16:18:46 -07:00
Ondrej Grover
9d5b2e9489 Really fix #1311 by declaring CSS overrides as !important
this is needed because on RTD the common hosted theme stylesheets get added
after the overrides.
2014-06-28 16:18:45 -07:00
Ondrej Grover
b3fe098c00 Fix #1311 wide tables in RTD theme, remove old theme files
This works by adding a CSS overrides file to the Sphinx app stylesheets.
2014-06-28 16:18:45 -07:00
Ondrej Grover
3b7189ec8a add get_writer signal and unify with get_generators
Fix outdated docs of get_generators to unify.
2014-06-28 16:18:45 -07:00
Ondrej Grover
a03881fd97 use correct CachingGenerator class in super() call
This was a leftover from code moving in c1324b0.
Detected by pylint.
2014-06-28 16:18:45 -07:00
Bernhard Scheirle
de3ed6c1ef send the static_generator_{init, finalized} signals.
Note: The two signals were already present but were never sent.
2014-06-28 16:18:45 -07:00
Ondrej Grover
3e12f40b08 split content caching into two layers
This is a reworked and improved version of content caching.
Notable changes:
- by default only raw content and metadata returned by readers are
  cached which should prevent conficts with plugins, the speed benefit
  of content objects caching is not very big with a simple setup
- renamed --full-rebuild to --ignore-cache
- added more elaborate logging to caching code
2014-06-28 16:18:45 -07:00
Shauna
55cab63714 Add feeds for each author 2014-06-28 16:18:45 -07:00
Tastalian
5c317329b3 Make docutils requirement explicit. Fixes #1243.
Previously, the error returned by Python when docutils is not installed
was not explicit, instead saying that HTMLTranslator is not defined
(needed by FeedGenerator and such), forcing the user to go into
readers.py to figure out that this happens because "import docutils"
failed.

This pull request makes the docutils dependency explicit, so that there
is an ImportError if doctutils is not found.
2014-06-28 16:18:45 -07:00
Justin Mayer
be22bc807c Text tweaks for "PLUGIN_PATH as list" feature 2014-06-28 16:18:45 -07:00
Lonewolf
2f916d0154 Ability to specify PLUGIN_PATH as list
PLUGIN_PATH added to settings table
2014-06-28 16:18:45 -07:00
James Lee
e046f59ce2 Handle list metadata as list of string in MarkdownReader 2014-06-28 16:18:45 -07:00
Ondrej Grover
75feec21d6 set _cache_open func even if not loading cache, fixes autoreload
The _cache_open attribute of the FileDataCacher class was not set when
settings[load_policy_key] was not True, so saving later failed.
As a precaution, replaced the `if ...: return` style with a plain
if structure to prevent such readability issues and added tests.
2014-06-28 16:18:45 -07:00
Simon Conseil
f1a93d68fb Add python 3.4 to tox config. 2014-06-28 16:18:45 -07:00
Ondrej Grover
23c1f2f3d0 enable writing of only selected output paths
- add WRITE_SELECTED setting
- add --write-selected commandline option
2014-06-28 16:18:45 -07:00
Antoine Brenner
cb17f11d9b Test to reproduce an issue that occurs with python3.3 under macos10 only
This test passes fine under linux
2014-06-28 16:18:44 -07:00
Justin Mayer
60905163c8 Fix settings table in docs 2014-06-28 16:18:44 -07:00
Antoine Brenner
b9a647547b Make sure locale is what we want before/after the tests
The locale is a global state, and it was not properly reset to
whatever it was before the unitttest possibly changed it.
This is now fixed.

Not restoring the locale led to weird issues: depending on
the order chosen by "python -m unittest discover" to run
the unit tests, some tests would apparently randomly fail
due to the locale not being what was expected.

For example, test_period_in_timeperiod_archive would
call mock('posts/1970/ 1月/index.html',...) instead of
expected mock('posts/1970/Jan/index.html',...) and fail.
2014-06-28 16:18:44 -07:00
Antoine Brenner
103e8e293a Fix unittest issue related to python2/python3 differences
Under python 2, with non-ascii locales, u"{:%b}".format(date) can raise UnicodeDecodeError
because u"{:%b}".format(date) will call date.__format__(u"%b"), which will return a byte string
and not a unicode string.
eg:
locale.setlocale(locale.LC_ALL, 'ja_JP.utf8')
date.__format__(u"%b") == '12\xe6\x9c\x88' # True

This commit catches UnicodeDecodeError and calls date.__format__() with byte strings instead
of characters, since it to work with character strings
2014-06-28 16:18:44 -07:00
Lonewolf
900fa755ba Added new sphinxtheme as requirement for docs Modified docs conf to support the theme update 2014-06-28 16:18:44 -07:00
Federico Ceratto
d0aa16e854 Add s3cmd MIME type detection 2014-06-28 16:18:44 -07:00
Ondrej Grover
6c06ee9e5b Cache content to speed up reading. Fixes #224.
Cache read content so that it doesn't have to be read next time if its
source has not been modified.
2014-06-28 16:18:44 -07:00