Commit graph

2,333 commits

Author SHA1 Message Date
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
Antoine Brenner
8b022b3508 Fix error in download_attachments() triggered by python2 unit test
The download_attachments error is triggered in the unit tests by a japanese
error message (接続を拒否されました) (connexion denied), that
python is not able to serialize the into a byte string.

This error weirdly does not appear every time the unit tests are run.
It might be related to the order in which the tests are run.

This error was found and fixed during the PyconUS 2014 pelican
sprint. It was discovered on a Linux Fedora20 computer running
Python2.7 in virtualenv
2014-06-28 16:18:44 -07:00
Justin Mayer
dafa2c36b1 Minor text changes to log message limitation 2014-06-28 16:18:44 -07:00
Antoine Brenner
9ca86adffc Fix unittest issue related to python2/python3 differences
The test_datetime test passed on python3 but not python2 because
datetime.strftime is a byte string in python2, and a unicode string in python3

This patch allows the test to pass in both python2 and python3 (3.3+ only)
2014-06-28 16:18:44 -07:00
Justin Mayer
3b9564b069 Minor correction to settings documentation 2014-06-28 16:18:44 -07:00
Justin Mayer
a14b432084 Fix deprecated logger warning for Python 3
logger.warn() has been deprecated in Python 3 in favor of logger.warning()
2014-06-28 16:18:44 -07:00
Rogdham
1fb04bfc21 Limit and filter logs
Drop duplicates logs.
Allow for logs to be grouped, enforcing a maximum number of logs per group.
Add the LOG_FILTER setting to ask from the configuration file to ignore some
logs (of level up to warning).
2014-06-28 16:18:44 -07:00
Helmut Grohne
cb4b2e7dfa change the inhibition value of *_SAVE_AS to ''
Previously, the documentation claimed the value of None for this purpose
even though False was used for certain defaults. The values False and
None cause warnings to be emitted from URLWrapper._from_settings though,
so the new way of inhibiting page generation is to set a *_SAVE_AS value
to the empty string.
2014-06-28 16:18:44 -07:00
Justin Mayer
da5849d1a0 Fix docs last_stable version and copyright date 2014-06-28 16:18:44 -07:00
th3aftermath
715b9eae68 Fix indentation error in the settings doc
This was accidentally caused by me in #1248
As a result the Basic Settings table was not being updated.
2014-06-28 16:18:43 -07:00
Jean Lauliac
3779306de5 Apply typogrify on article summary as well 2014-06-28 16:18:43 -07:00
th3aftermath
7baeb6f70b Fix Issue #1165 allows extensions to be set by certain settings
PAGINATION_PATTERNS was hard coded so that all files had a ".html" extension. This fixes that and add a test to
ensure that the pagination code is not changing the filename incorrectly.
2014-06-28 16:18:43 -07:00
th3aftermath
6533f803b7 Add the setting SLUGIFY_ATTRIBUTE 2014-06-28 16:18:43 -07:00
Justin Mayer
49a0559912 Minor improvements to Settings docs 2014-06-28 16:18:43 -07:00
Stefan hr Berder
fde856ec45 add lang support for drafts (#826 & #1107)
Fix #826
Fix #1107
2014-06-28 16:18:43 -07:00
Stefan hr Berder
656e85a2dd change date metadata parsing to dateutil.parser 2014-06-28 16:18:43 -07:00
Ben Bridts
a8c772289a Split multiple authors on ',' 2014-06-28 16:18:43 -07:00
Mario Lang
c3a8d80f42 Run tag name through escape filter to avoid invalid HTML
If a tag contains characters like <> or &, we currently generate invalid HTML.
This is easily fixed by sending the tag through the jinja escape filter.

(This bug is not theoretical, I hit it when using C++ template names for tags,
 like "boost::variant<>".)
2014-06-28 16:18:43 -07:00
Mario Lang
d4c3b616a9 Some browsers like Lynx render adjacent links without implicit spaces.
Put an extra space at the end of each link to a tag so that Lynx doesnt render
the tags as a single word.
2014-06-28 16:18:43 -07:00
Mario Lang
66441e0efb Fix stray </ol> and </section> if only one article is displayed.
We already check if loop.length > 1 before outputting <section> and <ol>
tags, but we neglected to do the same check when outputting the corresponding
end tags.

Also, since I had to read the code when I touched it, simplified a conditional:
if (a) if (a and (b or not b and c))
can be simplified to
if (a) if (b or c)

Note the "b or not b", it was just too ugly to not fix.
2014-06-28 16:18:43 -07:00
Mario Lang
43f8c2c246 HTML error in notmyidea: <li> not allowed in <section>.
<li> tags need to be inside of <ul> or <ol>.
Thanks to the w3c_validate plugin for finding this.
2014-06-28 16:18:43 -07:00
Justin Mayer
47ec2bc4a4 Add squashing to CONTRIBUTING docs. Fix URLs. 2014-06-28 16:18:43 -07:00
Rob Kennedy
cba5a888ac Allow socket address reuse; fixed #1264
The socket may remain in the TIME_WAIT state for some time after the
server shuts down, which prevents another instance of the server from
listening on the same port. This change allows the server to reuse the
address even when it's still waiting.
2014-06-28 16:18:43 -07:00
Anatoly Bubenkov
92a4229bb7 multiple authors implemented 2014-06-28 16:18:43 -07:00
Utku Demir
1f382c6790 Fix issue #1258
Correctly handle DEFAULT_DATE = None .
2014-06-28 16:18:42 -07:00
Justin Mayer
5bc3a7d0d8 Revert to newly-revived Typogrify project
Since the Typogrify project will be actively maintained going forward,
there is no need for the fork.
2014-06-28 16:18:42 -07:00
Colin Dunklau
597f1d95a6 Use absolute size for github mark 2014-06-28 16:18:42 -07:00
Colin Dunklau
88ffff2c15 32px Github logo and CSS shinker 2014-06-28 16:18:42 -07:00
Colin Dunklau
958c6c06bc Updated tests 2014-06-28 16:18:42 -07:00
Colin Dunklau
fae5648ce6 Updated github mark for notmyidea
The smallest mark GitHub provides in the bundle is 32x32. Since they
explicitly say don't resize the mark, I asked them to provide a 16x16
so we could use it. I received the 16x16 in this commit from GitHub
support.

However, they suggested we use the 32x32 and use CSS rules to adjust
the size:

"...we use the 32px for both and employ css background and background-
size rules to handle retina displays. I recommend that technique,
since retina users will see a mess of pixels for icons that small."

This sounds like reasonable advice. Should we consider migrating the
notmyidea social icons to 32x32, with appropriate CSS to adjust the
sizes?
2014-06-28 16:18:42 -07:00
Justin Mayer
c0ba93da9e Revert test-failing change from #1114 2014-06-28 16:18:42 -07:00
Mathieu Leplatre
5928603720 Fail and exit on restructuredtext syntax error 2014-06-28 16:18:42 -07:00
Ondrej Grover
7fabd712a1 Generator.get_files backwards compatibility for 1 path
This should prevent outdated plugins with generators from failing.
Also fixes #1382.
2014-06-27 20:18:17 +02:00
Ondrej Grover
40c9406ca4 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-27 14:54:18 +02:00
Justin Mayer
8fe05bb599 Merge pull request #1380 from avaris/py34_warnings
Fix for Python 3.4 deprecation warnings while running tests
2014-06-27 05:49:03 -07:00
Justin Mayer
a44a60ddd4 Merge pull request #1381 from avaris/fix_1198
Fix 1198 and 729: Fixes links with custom locale and related OS X test errors
2014-06-26 15:43:19 -07:00
Deniz Turgut
fc505091c2 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-26 01:10:52 -04:00
Deniz Turgut
ce8574aff4 Fix HTMLParser related deprecation warnings in Py3.4 2014-06-26 01:10:52 -04:00
Deniz Turgut
009543b7e4 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-26 01:01:42 -04:00
Ondrej Grover
3f6b130d6e 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-26 00:00:19 -04:00
Justin Mayer
2432a22400 Merge pull request #1322 from smartass101/get_files_multiple_paths
move {ARTICLE,PAGE}_DIR -> {ARTICLE,PAGE}_PATHS and correlate with {ARTICLE,PAGE}_EXCLUDES
2014-06-25 07:29:22 -07:00
Justin Mayer
dbf6d7cf8f Merge pull request #1376 from avaris/remove_asciidoc
Remove AsciiDocReader from core. Fixes #1355
2014-06-24 16:02:08 -07:00
Kyle Fuller
24106081b5 [coveralls] Exclude tests from coverage 2014-06-24 22:29:36 +01:00
Kyle Fuller
e3d3675493 Merge pull request #1370 from omasanori/six-version
Require six version 1.4.0 or later.
2014-06-23 16:52:07 +01:00
Deniz Turgut
bf9316bb7e Remove AsciiDocReader from core. Fixes #1355 2014-06-14 02:17:43 -04:00
OGINO Masanori
ca3aa1e75f Use six.moves.urllib.
Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
2014-06-10 17:30:17 +09:00
OGINO Masanori
def654434c 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-10 08:35:33 +09:00
Ondrej Grover
ef96705677 catch arbitrary exceptions during cache unpickling
It is hard to forsee what could be raised.
2014-06-08 11:32:10 +02:00
Justin Mayer
8673711d84 Merge pull request #1362 from avaris/neighbor_pages_docs
Doc update for *_{previous|next}_page variables
2014-06-07 15:40:09 -07:00
Deniz Turgut
43701cae7c Docs update for *_{previous|next}_page variables 2014-05-27 12:30:42 -04:00