Commit graph

1,842 commits

Author SHA1 Message Date
W. Trevor King
1102143c33 utils: Use pytz instead of datetime.timezone for timezones
datetime.timezone is new in Python 3.2 [1], so pytz allows us to keep
support for Python 2.7.

[1]: http://docs.python.org/dev/library/datetime.html#datetime.timezone
2013-06-11 22:54:01 -04:00
W. Trevor King
228fc82fc9 utils: Add some ISO 8601 forms to get_date()
Support the forms listed by the W3C [1].  I also removed the
'%Y-%d-%m' form, which can be confused with the '%Y-%m-%d' ISO form.
The new ISO forms can use 'Z' to designate UTC or '[+-]HHMM' to
specify offsets from UTC.  Other time zone designators are not
supported.

The '%z' directive has only been supported since Python 3.2 [2], so if
you're running Pelican on Python 2.7, you're stuck with 'Z' for UTC.
Conveniently, we get ValueErrors for both invalid directives and
data/format missmatches, so we don't need special handling for the 2.7
case inside get_date().

[1]: http://www.w3.org/TR/NOTE-datetime
[2]: http://bugs.python.org/issue6641
2013-06-11 22:53:21 -04:00
Justin Mayer
1fcf4a6550 Add documentation for ARCHIVES_SAVE_AS setting
While this setting has existed for some time, there does not seem to
have been any documentation for it until now.
2013-06-10 19:42:53 -07:00
Justin Mayer
e5f1755172 Merge pull request #924 from rptb1/add-missing-lxml-to-tox
Added lxml to the list of dependencies for the tox tests.
2013-06-09 09:37:39 -07:00
Richard Brooksby
edcc027d89 Added lxml to the list of dependencies for the tox tests.
My system python installs are completely clean except for virtualenv, so tox needs a complete set of non-default modules.
2013-06-08 23:40:16 +01:00
Alexis Métaireau
cc15629966 Don't include all the .py files in the root folder 2013-06-07 00:50:51 +02:00
Justin Mayer
15606f8dea Merge pull request #905 from Rogdham/pelican-quickstart_encoding
Encoding issue in pelican-quickstart. Fixes #904
2013-06-03 18:12:55 -07:00
Alexis Metaireau
e91b53be87 Merge pull request #922 from alefteris/docs-install-deps
Docs: Add six, markupsafe to install dependencies
2013-06-03 09:58:41 -07:00
Thanos Lefteris
ba3e14dd1d Docs: Add six, markupsafe to install dependencies 2013-06-03 18:23:07 +03:00
Justin Mayer
07b8c13db3 Merge pull request #921 from wking/default-settings
Standardize `DEFAULT_CONFIG` handling
2013-06-02 18:47:33 -07:00
Simon Conseil
3f91165f09 Ensure that markup is a tuple.
`self.markup` is a list when using the `-m|--markup` cli option, but testing the
extension with `endswith` works only with tuples.
2013-06-02 22:49:16 +02:00
W. Trevor King
8ff34e6c5d Replace settings.get(key) with settings[key] for default settings
If a setting exists in DEFAULT_CONFIG, assume it will be there
(instead of checking and/or providing a local default).  The earlier
code was split between the two idioms, which was confusing.
2013-06-02 14:24:27 -04:00
W. Trevor King
c8e7d95b34 tests.support: Use kwargs overrides in get_settings()
This avoids harcoding test-specific overrides, and makes it easy to
setup a settings dictionary based on DEFAULT_CONFIG for testing.
Because you can trust Pelican to use settings based on DEFAULT_CONFIG,
you are free to go about using:

  settings[my_key]

instead of:

  settings.get(my_key, some_fallback)

or:

  if my_key in settings:
      ...

if you know that `my_key` is in DEFAULT_CONFIG.
2013-06-02 14:24:27 -04:00
W. Trevor King
8511915294 settings: Cleanup configure_settings() (standardization & types)
This pulls out some general patterns to make it easier to apply
existing processing to new settings.
2013-06-02 13:32:10 -04:00
W. Trevor King
1d4d86c876 settings: Rework the LESS_GENERATOR removal warning for easy extension
Setting migration is something that will happen for multiple settings,
and the more we can standardize the reporting procedure, the easier it
will be to add new warnings.
2013-06-02 13:32:10 -04:00
W. Trevor King
e9dc1dd478 settings: Make DEFAULT_CONFIG public
This dictionary is accessed by plugins (like `summary`) which add new
settings, so it should be public (i.e. no prefixed underscore).

The changed name length would have led to a re-indenting of the
default contents anyway, so I shifted them all to four spaces.
2013-06-02 13:32:10 -04:00
W. Trevor King
c6de4430a0 tests/test_readers.py: Remove redundant 'expected' check in AdReaderTest
AdReaderTest.test_article_with_asc_extension() has had duplicate
checks on the expected metadata since it was created by 49f481e3 (Add
asciidoc reader support, 2013-10-28).  This commit removes the
duplicate entry.
2013-06-02 09:58:27 -07:00
Justin Mayer
a81c50ff55 Merge pull request #907 from saimn/py3k
Drop python 3.2 support and move to python 3.3
2013-06-02 09:34:31 -07:00
Simon Conseil
7057d3742b Drop python 3.2 support and move to python 3.3.
Jinja 2.7 (released 2013-05-20) supports only Python3 >=3.3 so it is time to
drop Python 3.2 and move to 3.3
2013-06-02 16:23:36 +02:00
Simon Conseil
427a5ca3c3 Include feeds and mkd files in the dist package.
This files are needed to run the tests.
2013-06-02 16:22:32 +02:00
Simon Conseil
fd018d7ceb Update tests output with feedgenerator 1.6
feedgenerator 1.6 includes a change to write feed attributes in a consistent
order between py2.7 and py3.3.
2013-06-02 16:21:10 +02:00
Simon Conseil
529d0d99c5 Update version requirement with feedgenerator 1.6
feedgenerator 1.6 changes the order of attributes in feeds, so we must use this
version to have consistent functionnal tests.
2013-06-02 16:21:10 +02:00
Simon Conseil
2bf91e54cd Tox: use git urls for py3 versions of smartypants and typogrify
+ This make it easier to use tox with py3: no need to checkout manually
  typogrify and smartypants repos and use tox's distshare.
+ Remove feedgenerator as it is already a dependy for pelican.
2013-06-02 16:17:35 +02:00
Chris Brannon
f8cf685c30 Use the builtin "open" on Python 3. 2013-05-27 14:49:57 +10:00
Rogdham
0ecae1f50d Encoding issue in pelican-quickstart. Fixes #904 2013-05-26 11:38:55 +01:00
Alexis Métaireau
675d6c81cd Include the md / rst files in the dist 2013-05-19 22:28:53 +10:00
Justin Mayer
e999918cd1 Merge pull request #891 from mrshu/patch-1
Updated pelican.server not started error message.
2013-05-18 15:38:09 -07:00
mr.Shu
2856f49b3a Updated pelican.server not started error message. 2013-05-18 08:20:50 +02:00
Justin Mayer
33653f2864 Merge pull request #890 from dominiqueplante/pep8-content
adhere to pep8
2013-05-16 06:03:36 -07:00
Dominique Plante
7024fe1192 adhere to pep8 2013-05-15 22:18:35 -07:00
Kyle Fuller
ee752d9b66 Merge pull request #888 from dominiqueplante/pep8-setup
adhere to PEP8 coding standards
2013-05-15 03:47:27 -07:00
Dominique Plante
19de7539f4 adhere to PEP8 coding standards 2013-05-14 23:41:18 -07:00
Justin Mayer
8c47ab21ec Merge pull request #881 from ben2367/patch-1
Update importer documentation
2013-05-14 11:36:14 -07:00
Justin Mayer
71150430a9 Merge pull request #885 from avaris/markdown-summary-footnote
Markdown summary should not include content footnote
2013-05-13 15:36:39 -07:00
Alexis Metaireau
86d4aac918 Merge pull request #864 from saimn/docutils_options
Add `DOCUTILS_SETTINGS` to allow to customize the docutils Publisher.
2013-05-13 00:21:12 -07:00
Alexis Metaireau
55382dd184 Merge pull request #858 from jmurty/feature/import_wp_pages
Import wordpress pages to pages/ subdir with --dir-page option
2013-05-13 00:18:01 -07:00
Alexis Metaireau
dcc17bbfa4 Merge pull request #848 from Rogdham/no_overwrite
Check URL overwrite. Fixes #446.
2013-05-13 00:17:26 -07:00
Alexis Métaireau
ead50cca62 some cleanup 2013-05-13 13:53:52 +10:00
Alexis Metaireau
bcfd574664 Merge pull request #804 from dowlingw/master
#803 - Include default configuration file if present
2013-05-12 20:50:31 -07:00
Deniz Turgut
75f214103e Markdown summary should not include content footnote
Markdown instance carries state for subsequent uses. Content
and summary parsing is done with the same instance. Since
footnotes are processed with an extension and stored as state,
content footnote is duplicated for summary.

This PR adds a ``.reset()`` call before summary parsing to clear
the state. It also adds a test case with footnotes.
2013-05-10 03:50:33 -04:00
ben2367
fa1550ceaa Update importer documentation
Dependencies were not the good one, wordpress importer needs BeautifulSoup4 and lxml
2013-05-09 04:07:17 +02:00
Joe Shaw
5fa3504ad0 use string find() instead of index(). Fixes #880.
We're expecting a non-match to return -1, which is what find() does,
but index() instead throws a ValueError.
2013-05-08 09:41:55 -04:00
Justin Mayer
e9ca508e8e Add more detail to Pygments FAQ entry. Fixes #821 2013-05-06 07:28:25 -07:00
Justin Mayer
43f4d0df7a Add reST example to arbitrary metadata FAQ entry 2013-05-06 06:51:54 -07:00
Justin Mayer
2482baf837 Merge pull request #874 from avaris/non-ascii-error
Handle critical exception logging correctly in localized systems
2013-05-04 08:35:01 -07:00
Deniz Turgut
084818b399 Handle critical exception logging correctly in localized systems
Python generates certain exception messages (like IOError) in system
language, if locale is set. This ensures that the message is properly
converted to unicode in Python 2.
2013-05-04 04:55:42 -04:00
Justin Mayer
50505dfd71 Merge pull request #845 from Rogdham/case-insensitive_caterogy_tag
Make tags and cats case insensitive. Fixes #704.
2013-05-03 10:27:46 -07:00
Rogdham
91337940d3 Make tags and cats case insensitive. Fixes #704.
More precisely, group tags or categories without considering the case.
This fixes the bug where two categories with just the case as difference were
considered as distinct, but generate the same file: one overwriting the other.

Thanks to @Avaris for helping with the tests.
2013-05-03 17:37:45 +01:00
Justin Mayer
34f05d4ba6 Add warning to docs re: DELETE_OUTPUT_DIRECTORY 2013-05-02 17:18:19 -07:00
Justin Mayer
7706530aa8 Merge pull request #867 from avaris/summary-max-length
Fixes #708 SUMMARY_MAX_LENGTH=0 should return empty string
2013-05-01 16:54:49 -07:00