Commit graph

2,348 commits

Author SHA1 Message Date
Justin Mayer
8f58c0582c Merge pull request #1314 from smartass101/write-selected-only-PR
Enable writing of selected output paths only. Refs #224.
2014-04-18 11:21:43 -07:00
Ondrej Grover
676981c621 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-04-18 07:15:26 +02:00
Justin Mayer
8b2e28a6ef Merge pull request #1316 from saimn/tox
Add python 3.4 to tox config.
2014-04-17 15:34:05 -07:00
Simon Conseil
6972261261 Add python 3.4 to tox config. 2014-04-17 22:57:26 +02:00
Ondrej Grover
6703950abe enable writing of only selected output paths
- add WRITE_SELECTED setting
- add --write-selected commandline option
2014-04-17 19:36:18 +02:00
Antoine Brenner
fd7cb9e213 Test to reproduce an issue that occurs with python3.3 under macos10 only
This test passes fine under linux
2014-04-15 22:01:20 +02:00
Justin Mayer
34ef5ab098 Merge pull request #1309 from al-tonio/date_format_japanese_fix_python2
Fix for locale related issues while running the tests.
2014-04-15 11:17:31 -04:00
Justin Mayer
dd70f1b24e Fix settings table in docs 2014-04-15 11:13:10 -04:00
Antoine Brenner
7277c95fb5 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-04-15 16:45:45 +02:00
Antoine Brenner
e97e9b5ae5 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-04-15 16:44:15 +02:00
Lonewolf
4cae9ea88f Added new sphinxtheme as requirement for docs Modified docs conf to support the theme update 2014-04-15 10:37:25 -04:00
Federico Ceratto
5b4381c19c Add s3cmd MIME type detection 2014-04-15 10:31:07 -04:00
Ondrej Grover
fd77926700 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-04-15 08:57:38 -04:00
Justin Mayer
de9ef74479 Merge pull request #1308 from al-tonio/download_attachments_japanese_error_msg_fix
Fix error in download_attachments() triggered by python2 unit test
2014-04-14 17:17:48 -04:00
Antoine Brenner
aabb7f9345 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-04-14 22:39:10 +02:00
Justin Mayer
7e06912bca Minor text changes to log message limitation 2014-04-14 16:18:07 -04:00
Justin Mayer
66a16b560f Merge pull request #1307 from al-tonio/datetestfix
Fix unittest issue related to python2/python3 differences
2014-04-14 15:52:31 -04:00
Justin Mayer
b11b8a93cd Merge pull request #1030 from Rogdham/filter_log
Limit and filter logs
2014-04-14 14:56:35 -04:00
Antoine Brenner
03976b650d 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-04-14 20:43:19 +02:00
Justin Mayer
c6ff88d0fc Minor correction to settings documentation 2014-04-07 14:29:21 -07:00
Justin Mayer
80842cbc0e Fix deprecated logger warning for Python 3
logger.warn() has been deprecated in Python 3 in favor of logger.warning()
2014-04-02 12:38:49 -07:00
Rogdham
d9b0091357 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-04-01 20:44:09 +02:00
Justin Mayer
cfd18b20fc Merge pull request #1266 from hrbonz/date_timezone
Change date metadata parsing to dateutil.parser
2014-03-31 16:36:23 -07:00
Justin Mayer
7eb30596f6 Merge pull request #1298 from th3aftermath/feature-inhibit-save_as
Change the inhibition value of *_SAVE_AS to ''
2014-03-31 15:53:27 -07:00
Helmut Grohne
3f304a2e92 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-03-31 19:38:49 +02:00
Justin Mayer
4c581cdcf2 Merge pull request #1294 from th3aftermath/FixSettingsDocs
Fix indentation error in the settings doc
2014-03-30 18:50:46 -07:00
Justin Mayer
8ec958fb35 Merge pull request #1293 from jeanlauliac/typogrify-summary
Apply Typogrify to article summary
2014-03-30 12:08:05 -07:00
Justin Mayer
382c09c187 Fix docs last_stable version and copyright date 2014-03-30 11:59:32 -07:00
Justin Mayer
16b288222d Merge pull request #1268 from bandb42/multiple_authors_fix
Split multiple authors on ',' instead of every character
2014-03-30 11:40:23 -07:00
th3aftermath
01ad449f29 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-03-30 14:35:22 -04:00
Justin Mayer
a8ead21e95 Merge pull request #1224 from leplatrem/patch-1
Exit code should not be successful on reStructuredText errors
2014-03-30 11:03:58 -07:00
Justin Mayer
216d3548af Merge pull request #1191 from th3aftermath/FixIssue1165
Remove spurious .html suffix. Fix bug #1165
2014-03-30 10:40:28 -07:00
Jean Lauliac
91d576eb45 Apply typogrify on article summary as well 2014-03-24 14:59:03 -04:00
th3aftermath
990ddb5a5e 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-03-08 20:33:23 -05:00
Justin Mayer
d9bbdf7f07 Merge pull request #1248 from th3aftermath/AddSlugifyAttribute
Add the setting SLUGIFY_SOURCE. Refs: #197
2014-03-08 15:43:06 +01:00
th3aftermath
56b0061393 Add the setting SLUGIFY_ATTRIBUTE 2014-03-04 21:16:23 -05:00
Justin Mayer
011cd50e2e Minor improvements to Settings docs 2014-03-01 18:25:07 +01:00
Justin Mayer
e38be6b2ea Merge pull request #1267 from mlang/escape-for-html
Run tag names through escape filter to avoid invalid HTML
2014-02-28 18:24:52 +01:00
Justin Mayer
d23c68361a Merge pull request #1201 from hrbonz/draft_lang
Add language support for drafts
2014-02-23 15:13:55 +01:00
Stefan hr Berder
652eb3686f add lang support for drafts (#826 & #1107)
Fix #826
Fix #1107
2014-02-23 14:03:09 +01:00
Stefan hr Berder
7f2bc2a23b change date metadata parsing to dateutil.parser 2014-02-23 11:21:44 +01:00
Ben Bridts
05d357e98e Split multiple authors on ',' 2014-02-18 17:56:57 +01:00
Mario Lang
a7ca52dee0 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-02-18 15:01:31 +01:00
Justin Mayer
58e817cb0f Merge pull request #859 from cdunklau/new_github_logo
Update GitHub icon for notmyidea theme
2014-02-17 09:40:46 -08:00
Justin Mayer
de3475aa64 Merge pull request #1265 from mlang/valid-html
Fix notmyidea theme's HTML tags
2014-02-15 10:28:27 -08:00
Mario Lang
e500e64ebd 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-02-15 13:24:22 +01:00
Mario Lang
cff9d0aa58 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-02-15 13:21:06 +01:00
Mario Lang
459a13bf79 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-02-15 13:02:03 +01:00
Justin Mayer
c00d808bf8 Add squashing to CONTRIBUTING docs. Fix URLs. 2014-02-14 14:37:54 -08:00
Rob Kennedy
1b6f081619 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-02-14 14:20:38 -08:00