Commit graph

1,826 commits

Author SHA1 Message Date
Justin Mayer
2188f4de68 Merge pull request #898 from saimn/fix-markup-cli
Ensure that markup is a tuple.
2013-06-19 06:51:59 -07:00
Alexis Metaireau
4f444ee6a8 Merge pull request #934 from wking/generator-init-kwargs
Use keyword arguments to initialize Generators
2013-06-19 00:57:50 -07:00
W. Trevor King
12dd35ef36 generators: Remove wonky argument handling from Generator.__init__ 2013-06-16 13:31:16 -04:00
W. Trevor King
6e527e7416 test_generators: Use keyword arguments to initialize Generators 2013-06-16 13:30:59 -04:00
W. Trevor King
0d1866b393 Pelican.run: Use keyword arguments when initializing generators
This makes it easier to add new arguments to Generator subclasses.
2013-06-16 12:15:26 -04:00
Justin Mayer
8f295f7a03 PyPI now has CDN; Travis shouldn't use mirrors
Now that PyPI utilizes a CDN, the "--use-mirrors" setting slows down the
install process and has essentially been deprecated.
2013-06-16 08:53:45 -07:00
Justin Mayer
a650dd9d64 Merge pull request #933 from wking/no-static-for-pictures
samples: Remove EXTRA_PATH_METADATA entries for pictures
2013-06-16 08:38:23 -07:00
W. Trevor King
0dee76f259 samples: Remove EXTRA_PATH_METADATA entries for pictures
I'd added them earlier to test that a configuration edit could
preserve the original output locations.  However, it is likely that
you have quite a number of static files, and we shouldn't recommend
listing explicit paths for all of them.  With this configuration
change, the pictures will be copied into the output directory using
their original relative path (e.g. `pictures/Fat_Cat.jpg` without the
`static`).  Any |filename|-style links will be updated automatically.

If you *want* the pictures to end up in a `static` directory, it's
easier to just organize your source that way.
2013-06-15 20:52:16 -04:00
Justin Mayer
dfb29b5388 Update changelog 2013-06-15 12:24:48 -07:00
Justin Mayer
5d9b3d7777 Merge pull request #795 from wking/read-file
Generate context objects in read_file()
2013-06-15 11:54:32 -07:00
Justin Mayer
6fcb6d3766 Merge pull request #928 from wking/iso-8601
utils: Add some ISO 8601 forms to get_date()
2013-06-14 08:27:37 -07:00
W. Trevor King
180cf9165f settings: Fix deprecation warning in configure_settings()
The broken code came from my 1d4d86c (settings: Rework the
LESS_GENERATOR removal warning for easy extension, 2013-03-24), where
I put formatting placeholders ({}) into the warning message, but
forgot to fill them in :/.
2013-06-13 21:18:57 -04:00
W. Trevor King
9b42b2a130 generators: get_files() should use paths relative to Generator.path
All paths should be relative to Generator.path unless we're actively
accessing the filesystem.  This makes the argument less ambiguous, so
we have less likelyhood of joining paths multiple times.
2013-06-12 17:37:22 -04:00
W. Trevor King
ce0a9b697e Document path metadata extraction 2013-06-12 17:37:22 -04:00
W. Trevor King
8797f0ebef docs/plugins.rst: Document signal name changes 2013-06-12 17:37:21 -04:00
W. Trevor King
38c22e83b6 readers: Ensure the reader class is enabled before instantiating
Otherwise the MarkdownReader fails with:

  'bool' object is not callable

if Markdown is not installed.

Reported-by: Deniz Turgut <dturgut@gmail.com>
2013-06-12 17:37:21 -04:00
W. Trevor King
4058cfdea4 settings: Add a warning for folks using FILES_TO_COPY. 2013-06-12 17:37:21 -04:00
W. Trevor King
29f0aa39d2 content: Don't update static content 2013-06-12 17:37:21 -04:00
W. Trevor King
fdde17281d contents: Page fallbacks for context and localsiteurl 2013-06-12 17:37:21 -04:00
W. Trevor King
f63325aa9a test_generators: Replace CUR_DIR with CONTENT_DIR for subdir cat. detection
In situations where I've cleared ARTICLE_DIR, I've done so to ensure
that there are no directories that will override the DEFAULT_CATEGORY
due to USE_FOLDER_AS_CATEGORY.
2013-06-12 17:36:01 -04:00
W. Trevor King
06121eda76 test_readers: Update to new readers.read_file 2013-06-12 15:02:31 -04:00
W. Trevor King
7de7bd0e37 Update sample configurations from FILES_TO_COPY to EXTRA_PATH_METADATA 2013-06-12 15:02:31 -04:00
W. Trevor King
d43dc1b9d6 Add the EXTRA_PATH_METADATA setting
Useful for altering static output paths when you don't want to encode
extra metadata in the static file's source path.
2013-06-12 15:02:31 -04:00
W. Trevor King
1ca0e06a27 Remove the FILES_TO_COPY setting
We no longer instantiate the Static object in the StaticGenerator, so
we can't set the save_as argument anymore.  If you want to adjust the
output path, use the upcoming EXTRA_PATH_METADATA setting.
2013-06-12 15:02:31 -04:00
W. Trevor King
1bc5b100ec generators: Convert StaticGenerator to use the new read_file 2013-06-12 15:02:31 -04:00
W. Trevor King
7be16dd524 generators: Update PagesGenerator to use new read_file
Also standardize signal names.  If `article_generator_*` is singular,
`page_generator_*` should be as well.  Fix it from the older
`pages_generator_*`.
2013-06-12 15:02:31 -04:00
W. Trevor King
a9c530281e Move Article metadata extraction from generators to readers
There's no reason why this information should be Article-specific.

This commit breaks the other generators for the moment.  I'll fix them
shortly.
2013-06-12 15:02:30 -04:00
W. Trevor King
f2d6f77462 signals: Fix *_generate_* signals -> *_generator_*
For example, article_generate_preread is now article_generator_preread
for consistency with the other preread and context signals.
2013-06-12 15:02:30 -04:00
W. Trevor King
386cd1f3f0 signals: Add missing signals
Note that the `pages_*` names are plural , while the `article_*` names
are singular.  I'll fix this once I update the PagesGenerator.
2013-06-12 15:02:30 -04:00
W. Trevor King
effe7e5e12 signals: Sort signals into categories 2013-06-12 15:02:30 -04:00
W. Trevor King
e38e170656 readers: Log signal sending for read_file() 2013-06-12 15:02:30 -04:00
W. Trevor King
4e118eff01 readers: Add debugging logging to read_file 2013-06-12 15:02:30 -04:00
W. Trevor King
ecf5682930 readers: Instrument read_file to return Content objects
The assorted generators all use read_file() to read in the file
contents and metadata.  Previously, they sometimes parse additional
metadata, fire off signals, and initialize a pelican.contents.Content
subclass on their own.  We can reduce duplicated code and increase
consistency by shifting all that stuff into read_file() itself, and
this commit is a step in that direction.
2013-06-12 15:02:29 -04:00
Justin Mayer
ed82f62a5a Merge pull request #930 from wking/specific-assertions
tests: Avoid hidden logic with better .assert*() method choices
2013-06-12 12:01:41 -07:00
W. Trevor King
5a61600bc9 tests: Avoid hidden logic with better .assert*() method choices
We'll get better failure messages if we use an assertion method that
understands the comparison we're trying to make.  If you make the
comparison by hand and assertTrue(), you don't get much constructive
feedback ;).
2013-06-12 14:52:23 -04:00
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