Mercurial > piecrust2
annotate piecrust/plugins/builtin.py @ 264:74bea91c9630
bake: Don't store internal config values in the bake record.
We sometimes store actual objects in the page config (like for instance page
linkers) and we don't want that to be pickled.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Tue, 24 Feb 2015 23:18:23 -0800 |
parents | f130365568ff |
children | d70a4adb61dd |
rev | line source |
---|---|
60
6e60e0fef2be
Add `import` command, Jekyll importer.
Ludovic Chabant <ludovic@chabant.com>
parents:
34
diff
changeset
|
1 from piecrust.commands.base import HelpCommand |
163
6d23473fab41
sources: Add `chef sources` command to list page sources.
Ludovic Chabant <ludovic@chabant.com>
parents:
157
diff
changeset
|
2 from piecrust.commands.builtin.baking import ( |
6d23473fab41
sources: Add `chef sources` command to list page sources.
Ludovic Chabant <ludovic@chabant.com>
parents:
157
diff
changeset
|
3 BakeCommand, ShowRecordCommand) |
6d23473fab41
sources: Add `chef sources` command to list page sources.
Ludovic Chabant <ludovic@chabant.com>
parents:
157
diff
changeset
|
4 from piecrust.commands.builtin.info import ( |
6d23473fab41
sources: Add `chef sources` command to list page sources.
Ludovic Chabant <ludovic@chabant.com>
parents:
157
diff
changeset
|
5 RootCommand, ShowConfigCommand, |
6d23473fab41
sources: Add `chef sources` command to list page sources.
Ludovic Chabant <ludovic@chabant.com>
parents:
157
diff
changeset
|
6 FindCommand, ShowSourcesCommand, ShowRoutesCommand, ShowPathsCommand) |
6d23473fab41
sources: Add `chef sources` command to list page sources.
Ludovic Chabant <ludovic@chabant.com>
parents:
157
diff
changeset
|
7 from piecrust.commands.builtin.scaffolding import ( |
6d23473fab41
sources: Add `chef sources` command to list page sources.
Ludovic Chabant <ludovic@chabant.com>
parents:
157
diff
changeset
|
8 PrepareCommand, |
100
69d5eecfa449
Better `prepare` command, with templates and help topics.
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
9 DefaultPrepareTemplatesCommandExtension, |
187
d5b7c2a4ec9d
prepare: Add user-defined scaffolding templates.
Ludovic Chabant <ludovic@chabant.com>
parents:
185
diff
changeset
|
10 UserDefinedPrepareTemplatesCommandExtension, |
100
69d5eecfa449
Better `prepare` command, with templates and help topics.
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
11 DefaultPrepareTemplatesHelpTopic) |
3
f485ba500df3
Gigantic change to basically make PieCrust 2 vaguely functional.
Ludovic Chabant <ludovic@chabant.com>
parents:
1
diff
changeset
|
12 from piecrust.commands.builtin.serving import (ServeCommand) |
163
6d23473fab41
sources: Add `chef sources` command to list page sources.
Ludovic Chabant <ludovic@chabant.com>
parents:
157
diff
changeset
|
13 from piecrust.commands.builtin.util import ( |
6d23473fab41
sources: Add `chef sources` command to list page sources.
Ludovic Chabant <ludovic@chabant.com>
parents:
157
diff
changeset
|
14 InitCommand, PurgeCommand, ImportCommand) |
3
f485ba500df3
Gigantic change to basically make PieCrust 2 vaguely functional.
Ludovic Chabant <ludovic@chabant.com>
parents:
1
diff
changeset
|
15 from piecrust.data.provider import (IteratorDataProvider, BlogDataProvider) |
f485ba500df3
Gigantic change to basically make PieCrust 2 vaguely functional.
Ludovic Chabant <ludovic@chabant.com>
parents:
1
diff
changeset
|
16 from piecrust.formatting.markdownformatter import MarkdownFormatter |
124
f49fcf9448df
Add Textile formatter.
Ludovic Chabant <ludovic@chabant.com>
parents:
117
diff
changeset
|
17 from piecrust.formatting.textileformatter import TextileFormatter |
76
fdb08d986384
Add SmartyPants formatting.
Ludovic Chabant <ludovic@chabant.com>
parents:
62
diff
changeset
|
18 from piecrust.formatting.smartypantsformatter import SmartyPantsFormatter |
60
6e60e0fef2be
Add `import` command, Jekyll importer.
Ludovic Chabant <ludovic@chabant.com>
parents:
34
diff
changeset
|
19 from piecrust.importing.jekyll import JekyllImporter |
62
52e4d9a1f917
Simple importer for PieCrust 1 websites.
Ludovic Chabant <ludovic@chabant.com>
parents:
60
diff
changeset
|
20 from piecrust.importing.piecrust import PieCrust1Importer |
1
aaa8fb7c8918
Re-arranged modules to reduce dependencies to builtin stuff.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
21 from piecrust.plugins.base import PieCrustPlugin |
3
f485ba500df3
Gigantic change to basically make PieCrust 2 vaguely functional.
Ludovic Chabant <ludovic@chabant.com>
parents:
1
diff
changeset
|
22 from piecrust.processing.base import CopyFileProcessor |
196
154b8df04829
processing: Add Compass and Sass processors.
Ludovic Chabant <ludovic@chabant.com>
parents:
187
diff
changeset
|
23 from piecrust.processing.compass import CompassProcessor |
206
cba781477bd0
processing: Add `concat`, `uglifyjs` and `cleancss` processors.
Ludovic Chabant <ludovic@chabant.com>
parents:
197
diff
changeset
|
24 from piecrust.processing.compressors import ( |
cba781477bd0
processing: Add `concat`, `uglifyjs` and `cleancss` processors.
Ludovic Chabant <ludovic@chabant.com>
parents:
197
diff
changeset
|
25 CleanCssProcessor, UglifyJSProcessor) |
3
f485ba500df3
Gigantic change to basically make PieCrust 2 vaguely functional.
Ludovic Chabant <ludovic@chabant.com>
parents:
1
diff
changeset
|
26 from piecrust.processing.less import LessProcessor |
117
6827dcc9d3fb
Changes to the asset processing pipeline:
Ludovic Chabant <ludovic@chabant.com>
parents:
100
diff
changeset
|
27 from piecrust.processing.requirejs import RequireJSProcessor |
196
154b8df04829
processing: Add Compass and Sass processors.
Ludovic Chabant <ludovic@chabant.com>
parents:
187
diff
changeset
|
28 from piecrust.processing.sass import SassProcessor |
34
bdb103c57168
Add `sitemap` processor.
Ludovic Chabant <ludovic@chabant.com>
parents:
3
diff
changeset
|
29 from piecrust.processing.sitemap import SitemapProcessor |
206
cba781477bd0
processing: Add `concat`, `uglifyjs` and `cleancss` processors.
Ludovic Chabant <ludovic@chabant.com>
parents:
197
diff
changeset
|
30 from piecrust.processing.util import ConcatProcessor |
242
f130365568ff
internal: Code reorganization to put less stuff in `sources.base`.
Ludovic Chabant <ludovic@chabant.com>
parents:
239
diff
changeset
|
31 from piecrust.sources.default import DefaultPageSource |
163
6d23473fab41
sources: Add `chef sources` command to list page sources.
Ludovic Chabant <ludovic@chabant.com>
parents:
157
diff
changeset
|
32 from piecrust.sources.posts import ( |
6d23473fab41
sources: Add `chef sources` command to list page sources.
Ludovic Chabant <ludovic@chabant.com>
parents:
157
diff
changeset
|
33 FlatPostsSource, ShallowPostsSource, HierarchyPostsSource) |
239
f43f19975671
sources: Refactor `autoconfig` source, add `OrderedPageSource`.
Ludovic Chabant <ludovic@chabant.com>
parents:
206
diff
changeset
|
34 from piecrust.sources.autoconfig import ( |
f43f19975671
sources: Refactor `autoconfig` source, add `OrderedPageSource`.
Ludovic Chabant <ludovic@chabant.com>
parents:
206
diff
changeset
|
35 AutoConfigSource, OrderedPageSource) |
157
55910ab4bfea
First draft of the `prose` page source.
Ludovic Chabant <ludovic@chabant.com>
parents:
148
diff
changeset
|
36 from piecrust.sources.prose import ProseSource |
3
f485ba500df3
Gigantic change to basically make PieCrust 2 vaguely functional.
Ludovic Chabant <ludovic@chabant.com>
parents:
1
diff
changeset
|
37 from piecrust.templating.jinjaengine import JinjaTemplateEngine |
185
139179dc7abd
render: Add support for a Mustache template engine.
Ludovic Chabant <ludovic@chabant.com>
parents:
163
diff
changeset
|
38 from piecrust.templating.pystacheengine import PystacheTemplateEngine |
1
aaa8fb7c8918
Re-arranged modules to reduce dependencies to builtin stuff.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
39 |
aaa8fb7c8918
Re-arranged modules to reduce dependencies to builtin stuff.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
40 |
aaa8fb7c8918
Re-arranged modules to reduce dependencies to builtin stuff.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
41 class BuiltInPlugin(PieCrustPlugin): |
aaa8fb7c8918
Re-arranged modules to reduce dependencies to builtin stuff.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
42 def __init__(self): |
aaa8fb7c8918
Re-arranged modules to reduce dependencies to builtin stuff.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
43 super(BuiltInPlugin, self).__init__() |
aaa8fb7c8918
Re-arranged modules to reduce dependencies to builtin stuff.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
44 self.name = '__builtin__' |
aaa8fb7c8918
Re-arranged modules to reduce dependencies to builtin stuff.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
45 |
aaa8fb7c8918
Re-arranged modules to reduce dependencies to builtin stuff.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
46 def getCommands(self): |
aaa8fb7c8918
Re-arranged modules to reduce dependencies to builtin stuff.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
47 return [ |
aaa8fb7c8918
Re-arranged modules to reduce dependencies to builtin stuff.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
48 InitCommand(), |
60
6e60e0fef2be
Add `import` command, Jekyll importer.
Ludovic Chabant <ludovic@chabant.com>
parents:
34
diff
changeset
|
49 ImportCommand(), |
6e60e0fef2be
Add `import` command, Jekyll importer.
Ludovic Chabant <ludovic@chabant.com>
parents:
34
diff
changeset
|
50 HelpCommand(), |
3
f485ba500df3
Gigantic change to basically make PieCrust 2 vaguely functional.
Ludovic Chabant <ludovic@chabant.com>
parents:
1
diff
changeset
|
51 RootCommand(), |
f485ba500df3
Gigantic change to basically make PieCrust 2 vaguely functional.
Ludovic Chabant <ludovic@chabant.com>
parents:
1
diff
changeset
|
52 PurgeCommand(), |
f485ba500df3
Gigantic change to basically make PieCrust 2 vaguely functional.
Ludovic Chabant <ludovic@chabant.com>
parents:
1
diff
changeset
|
53 ShowConfigCommand(), |
f485ba500df3
Gigantic change to basically make PieCrust 2 vaguely functional.
Ludovic Chabant <ludovic@chabant.com>
parents:
1
diff
changeset
|
54 FindCommand(), |
f485ba500df3
Gigantic change to basically make PieCrust 2 vaguely functional.
Ludovic Chabant <ludovic@chabant.com>
parents:
1
diff
changeset
|
55 PrepareCommand(), |
163
6d23473fab41
sources: Add `chef sources` command to list page sources.
Ludovic Chabant <ludovic@chabant.com>
parents:
157
diff
changeset
|
56 ShowSourcesCommand(), |
3
f485ba500df3
Gigantic change to basically make PieCrust 2 vaguely functional.
Ludovic Chabant <ludovic@chabant.com>
parents:
1
diff
changeset
|
57 ShowRoutesCommand(), |
f485ba500df3
Gigantic change to basically make PieCrust 2 vaguely functional.
Ludovic Chabant <ludovic@chabant.com>
parents:
1
diff
changeset
|
58 ShowPathsCommand(), |
f485ba500df3
Gigantic change to basically make PieCrust 2 vaguely functional.
Ludovic Chabant <ludovic@chabant.com>
parents:
1
diff
changeset
|
59 BakeCommand(), |
f485ba500df3
Gigantic change to basically make PieCrust 2 vaguely functional.
Ludovic Chabant <ludovic@chabant.com>
parents:
1
diff
changeset
|
60 ShowRecordCommand(), |
197
57eec8a67095
builtin: Remove `plugins` command, it's not ready yet.
Ludovic Chabant <ludovic@chabant.com>
parents:
196
diff
changeset
|
61 ServeCommand()] |
3
f485ba500df3
Gigantic change to basically make PieCrust 2 vaguely functional.
Ludovic Chabant <ludovic@chabant.com>
parents:
1
diff
changeset
|
62 |
f485ba500df3
Gigantic change to basically make PieCrust 2 vaguely functional.
Ludovic Chabant <ludovic@chabant.com>
parents:
1
diff
changeset
|
63 def getCommandExtensions(self): |
100
69d5eecfa449
Better `prepare` command, with templates and help topics.
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
64 return [ |
69d5eecfa449
Better `prepare` command, with templates and help topics.
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
65 DefaultPrepareTemplatesCommandExtension(), |
187
d5b7c2a4ec9d
prepare: Add user-defined scaffolding templates.
Ludovic Chabant <ludovic@chabant.com>
parents:
185
diff
changeset
|
66 UserDefinedPrepareTemplatesCommandExtension(), |
100
69d5eecfa449
Better `prepare` command, with templates and help topics.
Ludovic Chabant <ludovic@chabant.com>
parents:
76
diff
changeset
|
67 DefaultPrepareTemplatesHelpTopic()] |
1
aaa8fb7c8918
Re-arranged modules to reduce dependencies to builtin stuff.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
68 |
3
f485ba500df3
Gigantic change to basically make PieCrust 2 vaguely functional.
Ludovic Chabant <ludovic@chabant.com>
parents:
1
diff
changeset
|
69 def getSources(self): |
f485ba500df3
Gigantic change to basically make PieCrust 2 vaguely functional.
Ludovic Chabant <ludovic@chabant.com>
parents:
1
diff
changeset
|
70 return [ |
f485ba500df3
Gigantic change to basically make PieCrust 2 vaguely functional.
Ludovic Chabant <ludovic@chabant.com>
parents:
1
diff
changeset
|
71 DefaultPageSource, |
f485ba500df3
Gigantic change to basically make PieCrust 2 vaguely functional.
Ludovic Chabant <ludovic@chabant.com>
parents:
1
diff
changeset
|
72 FlatPostsSource, |
f485ba500df3
Gigantic change to basically make PieCrust 2 vaguely functional.
Ludovic Chabant <ludovic@chabant.com>
parents:
1
diff
changeset
|
73 ShallowPostsSource, |
148
432cd534ce08
Add `autoconfig` page source.
Ludovic Chabant <ludovic@chabant.com>
parents:
124
diff
changeset
|
74 HierarchyPostsSource, |
157
55910ab4bfea
First draft of the `prose` page source.
Ludovic Chabant <ludovic@chabant.com>
parents:
148
diff
changeset
|
75 AutoConfigSource, |
239
f43f19975671
sources: Refactor `autoconfig` source, add `OrderedPageSource`.
Ludovic Chabant <ludovic@chabant.com>
parents:
206
diff
changeset
|
76 OrderedPageSource, |
157
55910ab4bfea
First draft of the `prose` page source.
Ludovic Chabant <ludovic@chabant.com>
parents:
148
diff
changeset
|
77 ProseSource] |
3
f485ba500df3
Gigantic change to basically make PieCrust 2 vaguely functional.
Ludovic Chabant <ludovic@chabant.com>
parents:
1
diff
changeset
|
78 |
f485ba500df3
Gigantic change to basically make PieCrust 2 vaguely functional.
Ludovic Chabant <ludovic@chabant.com>
parents:
1
diff
changeset
|
79 def getDataProviders(self): |
f485ba500df3
Gigantic change to basically make PieCrust 2 vaguely functional.
Ludovic Chabant <ludovic@chabant.com>
parents:
1
diff
changeset
|
80 return [ |
f485ba500df3
Gigantic change to basically make PieCrust 2 vaguely functional.
Ludovic Chabant <ludovic@chabant.com>
parents:
1
diff
changeset
|
81 IteratorDataProvider, |
f485ba500df3
Gigantic change to basically make PieCrust 2 vaguely functional.
Ludovic Chabant <ludovic@chabant.com>
parents:
1
diff
changeset
|
82 BlogDataProvider] |
f485ba500df3
Gigantic change to basically make PieCrust 2 vaguely functional.
Ludovic Chabant <ludovic@chabant.com>
parents:
1
diff
changeset
|
83 |
f485ba500df3
Gigantic change to basically make PieCrust 2 vaguely functional.
Ludovic Chabant <ludovic@chabant.com>
parents:
1
diff
changeset
|
84 def getTemplateEngines(self): |
f485ba500df3
Gigantic change to basically make PieCrust 2 vaguely functional.
Ludovic Chabant <ludovic@chabant.com>
parents:
1
diff
changeset
|
85 return [ |
185
139179dc7abd
render: Add support for a Mustache template engine.
Ludovic Chabant <ludovic@chabant.com>
parents:
163
diff
changeset
|
86 JinjaTemplateEngine(), |
139179dc7abd
render: Add support for a Mustache template engine.
Ludovic Chabant <ludovic@chabant.com>
parents:
163
diff
changeset
|
87 PystacheTemplateEngine()] |
3
f485ba500df3
Gigantic change to basically make PieCrust 2 vaguely functional.
Ludovic Chabant <ludovic@chabant.com>
parents:
1
diff
changeset
|
88 |
f485ba500df3
Gigantic change to basically make PieCrust 2 vaguely functional.
Ludovic Chabant <ludovic@chabant.com>
parents:
1
diff
changeset
|
89 def getFormatters(self): |
f485ba500df3
Gigantic change to basically make PieCrust 2 vaguely functional.
Ludovic Chabant <ludovic@chabant.com>
parents:
1
diff
changeset
|
90 return [ |
76
fdb08d986384
Add SmartyPants formatting.
Ludovic Chabant <ludovic@chabant.com>
parents:
62
diff
changeset
|
91 MarkdownFormatter(), |
124
f49fcf9448df
Add Textile formatter.
Ludovic Chabant <ludovic@chabant.com>
parents:
117
diff
changeset
|
92 SmartyPantsFormatter(), |
f49fcf9448df
Add Textile formatter.
Ludovic Chabant <ludovic@chabant.com>
parents:
117
diff
changeset
|
93 TextileFormatter()] |
3
f485ba500df3
Gigantic change to basically make PieCrust 2 vaguely functional.
Ludovic Chabant <ludovic@chabant.com>
parents:
1
diff
changeset
|
94 |
f485ba500df3
Gigantic change to basically make PieCrust 2 vaguely functional.
Ludovic Chabant <ludovic@chabant.com>
parents:
1
diff
changeset
|
95 def getProcessors(self): |
f485ba500df3
Gigantic change to basically make PieCrust 2 vaguely functional.
Ludovic Chabant <ludovic@chabant.com>
parents:
1
diff
changeset
|
96 return [ |
f485ba500df3
Gigantic change to basically make PieCrust 2 vaguely functional.
Ludovic Chabant <ludovic@chabant.com>
parents:
1
diff
changeset
|
97 CopyFileProcessor(), |
206
cba781477bd0
processing: Add `concat`, `uglifyjs` and `cleancss` processors.
Ludovic Chabant <ludovic@chabant.com>
parents:
197
diff
changeset
|
98 ConcatProcessor(), |
196
154b8df04829
processing: Add Compass and Sass processors.
Ludovic Chabant <ludovic@chabant.com>
parents:
187
diff
changeset
|
99 CompassProcessor(), |
34
bdb103c57168
Add `sitemap` processor.
Ludovic Chabant <ludovic@chabant.com>
parents:
3
diff
changeset
|
100 LessProcessor(), |
196
154b8df04829
processing: Add Compass and Sass processors.
Ludovic Chabant <ludovic@chabant.com>
parents:
187
diff
changeset
|
101 SassProcessor(), |
117
6827dcc9d3fb
Changes to the asset processing pipeline:
Ludovic Chabant <ludovic@chabant.com>
parents:
100
diff
changeset
|
102 RequireJSProcessor(), |
206
cba781477bd0
processing: Add `concat`, `uglifyjs` and `cleancss` processors.
Ludovic Chabant <ludovic@chabant.com>
parents:
197
diff
changeset
|
103 SitemapProcessor(), |
cba781477bd0
processing: Add `concat`, `uglifyjs` and `cleancss` processors.
Ludovic Chabant <ludovic@chabant.com>
parents:
197
diff
changeset
|
104 CleanCssProcessor(), |
cba781477bd0
processing: Add `concat`, `uglifyjs` and `cleancss` processors.
Ludovic Chabant <ludovic@chabant.com>
parents:
197
diff
changeset
|
105 UglifyJSProcessor()] |
3
f485ba500df3
Gigantic change to basically make PieCrust 2 vaguely functional.
Ludovic Chabant <ludovic@chabant.com>
parents:
1
diff
changeset
|
106 |
60
6e60e0fef2be
Add `import` command, Jekyll importer.
Ludovic Chabant <ludovic@chabant.com>
parents:
34
diff
changeset
|
107 def getImporters(self): |
6e60e0fef2be
Add `import` command, Jekyll importer.
Ludovic Chabant <ludovic@chabant.com>
parents:
34
diff
changeset
|
108 return [ |
62
52e4d9a1f917
Simple importer for PieCrust 1 websites.
Ludovic Chabant <ludovic@chabant.com>
parents:
60
diff
changeset
|
109 JekyllImporter(), |
52e4d9a1f917
Simple importer for PieCrust 1 websites.
Ludovic Chabant <ludovic@chabant.com>
parents:
60
diff
changeset
|
110 PieCrust1Importer()] |
60
6e60e0fef2be
Add `import` command, Jekyll importer.
Ludovic Chabant <ludovic@chabant.com>
parents:
34
diff
changeset
|
111 |