You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(5) |
Dec
(5) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(53) |
Feb
(81) |
Mar
(47) |
Apr
(29) |
May
(32) |
Jun
(24) |
Jul
(41) |
Aug
(86) |
Sep
(40) |
Oct
(28) |
Nov
(11) |
Dec
(23) |
| 2004 |
Jan
(32) |
Feb
(54) |
Mar
(30) |
Apr
(28) |
May
(113) |
Jun
(17) |
Jul
(5) |
Aug
(111) |
Sep
(103) |
Oct
(18) |
Nov
(5) |
Dec
(38) |
| 2005 |
Jan
(31) |
Feb
(26) |
Mar
(69) |
Apr
(36) |
May
(45) |
Jun
(35) |
Jul
(11) |
Aug
(25) |
Sep
(9) |
Oct
(27) |
Nov
(4) |
Dec
(11) |
| 2006 |
Jan
(33) |
Feb
(11) |
Mar
(7) |
Apr
(10) |
May
(11) |
Jun
(2) |
Jul
(9) |
Aug
(7) |
Sep
(22) |
Oct
(40) |
Nov
(34) |
Dec
(5) |
| 2007 |
Jan
(21) |
Feb
(23) |
Mar
(28) |
Apr
(1) |
May
(15) |
Jun
(45) |
Jul
(71) |
Aug
(45) |
Sep
(52) |
Oct
(31) |
Nov
(20) |
Dec
(6) |
| 2008 |
Jan
(17) |
Feb
(25) |
Mar
(7) |
Apr
(5) |
May
(9) |
Jun
(3) |
Jul
(2) |
Aug
(4) |
Sep
|
Oct
|
Nov
|
Dec
|
| 2009 |
Jan
|
Feb
|
Mar
(2) |
Apr
(3) |
May
(1) |
Jun
(1) |
Jul
(15) |
Aug
(9) |
Sep
(10) |
Oct
(1) |
Nov
|
Dec
|
| 2010 |
Jan
(42) |
Feb
(28) |
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
(3) |
Aug
(7) |
Sep
(19) |
Oct
(14) |
Nov
(27) |
Dec
(14) |
| 2011 |
Jan
(8) |
Feb
(9) |
Mar
(9) |
Apr
|
May
|
Jun
(2) |
Jul
|
Aug
(18) |
Sep
|
Oct
|
Nov
|
Dec
(6) |
| 2012 |
Jan
(5) |
Feb
(2) |
Mar
(2) |
Apr
|
May
|
Jun
(13) |
Jul
|
Aug
|
Sep
|
Oct
(3) |
Nov
|
Dec
(4) |
| 2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
(9) |
Aug
|
Sep
|
Oct
(3) |
Nov
|
Dec
|
| 2016 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Frédéric H. <fg....@gm...> - 2010-07-25 14:18:04
|
Hello, (my apologies I've subscribed for the digest form of the list and then could not retrieve the thread and then could not answer to it in the right place) Pip works in a very similar way of easy_install, by listing and caching links from Pypi indexes and honours options like '--find-links', '--index-url' and so on. It seems that pip could not retrieve archives from sourceforge links. I made a test with PyFFI package of which Pypi index offers only sourceforge download links. It failed also (see http://pastebin.com/iagLGjje). On the contrary, easy_install can install (pyblosxom) from sourceforge links. easy_install pyblosxom works ! In regards to the download page of bluesock.org, AFAICS pip honours a default level of recursion (maybe 2 ??) and then don't reach the download page. Anyway, IMHO the best way to get rid of these "limitations" (?) is to add a link to http://pyblosxom.bluesock.org/download/ from pyblosxom 's pypi index. (see the result of 'pip install -f http://pyblosxom.bluesock.org/download/ -U --log log.txt pyblosxom' at http://pastebin.com/NXmJV0Tv). Frédéric |
|
From: will kahn-g. <wi...@bl...> - 2010-07-24 15:37:37
|
I haven't updated PyPI in a while--certainly not since I moved the project to bluesock.org. I'll add this to my list of things to do. In regards to the "downloads" link, I don't know how that works in pip, so I don't know why it's not working or what it should be doing. If someone could look into what the problem is and how to fix it on our end, that'd be really helpful. /will On 07/24/2010 09:30 AM, Frédéric Hébert wrote: > Hello, > > i've just tried to install Pyblosxom within a fresh intall of a > virtualenv. I did a "pip install pyblosxom" inside it but it seems that > pip couldn't find any suitable link. > > Below versions of soft I used : > > * virtualenv 1.4.9 > * mkvirtualenv 2.2.1 > * pip 0.7.2 > * OS : Ubuntu 10.04 LTS > > See http://pastebin.com/EWxWGm6D for a complete pip.log > > In particular I don't understand why pip reports > http://pyblosxom.bluesock.org as an unsuitable page and therefore not > follow the "downloads" link on it. > > Could the http://pypi.python.org/simple/pyblosxom/ page lists direct > links to the tar.gz archives on bluesock.org ? > > Frédéric |
|
From: Frédéric H. <fg....@gm...> - 2010-07-24 13:37:50
|
Hello, i've just tried to install Pyblosxom within a fresh intall of a virtualenv. I did a "pip install pyblosxom" inside it but it seems that pip couldn't find any suitable link. Below versions of soft I used : * virtualenv 1.4.9 * mkvirtualenv 2.2.1 * pip 0.7.2 * OS : Ubuntu 10.04 LTS See http://pastebin.com/EWxWGm6D for a complete pip.log In particular I don't understand why pip reports http://pyblosxom.bluesock.org as an unsuitable page and therefore not follow the "downloads" link on it. Could the http://pypi.python.org/simple/pyblosxom/ page lists direct links to the tar.gz archives on bluesock.org ? Frédéric |
|
From: Zoom.Quiet <zoo...@gm...> - 2010-04-20 05:13:48
|
i'm Chinese Pythoner, usage PyBlosxom from 2006; http://blog.zoomquiet.org/pyblosxom/ now,i had to Static Rendering publish my blog; so will's great plugin:wbgpager.py can not working; so i notice: - people can not easy jump to someone entry by Category - if that Category include more then py["num_entries"] limited there is some plugin or patch can export Static Category index.hrml such like as: http://snarfed.org/space/archive i just want export entries list,such as: http://blog.zoomquiet.org/pyblosxom/techic/ http://blog.zoomquiet.org/pyblosxom/techic/PyBlosxom/ these Category index, unnecessary export all content; just title with link is enough -- http://zoomquiet.org 人生苦短? Pythonic! |
|
From: chombee <ch...@la...> - 2010-02-23 23:33:10
|
I rewrote my tumblelog plugin: http://github.com/seanh/PyBlosxom-tumblelog I wasn't happy with the YAML-based approach for several reasons. It now registers several entry parser functions (one for each type of entry). The parser functions define custom file formats for each type of entry and do custom processing (so far passing bodies, captions and the like through markdown if it's available, but other types of processing for specific entry types are possible). The file formats are simple and try to emulate pyblosxom's default format. The idea was to make the file format as close as possible to how you'd write if you're were just noting something down to yourself in a text file, or emailing it to someone, it should be natural and with as little as possible to remember, avoid having to look up an example of the file format when you want to write an entry. For example, the file format of a link entry is like this: The link title http://www.example.com The rest of the file constitutes a multi-line caption for the entry. When this is rendered with the link template you get something like: <div class="entry link"> <a href="http://example.com" alt="The link title" title="The link title> The link title </a> <p>The rest of the file constitutes a multi-line caption for the entry.</p> <div class="date">Tue 23 Feb 2010</div> </div> As with the previous version, each entry type is rendered using its own template instead of the default story template. I'm much happier with this approach. When you look at your entries dir you can see what type of entry each file is from the filename extension: link, .quote, .picture, .text etc. instead of them all being .yaml. Entries should be easier to write in these custom file formats than in YAML, which was an order of magnitude more awkward than standard pyblosxom entries. And with a separate parse function in tumblelog.py for each entry type, flexible per-type processing is possible. |
|
From: will kahn-g. <wi...@bl...> - 2010-02-06 16:54:53
|
On 02/06/2010 07:46 AM, Chris G wrote: > > Summary > > The bit "system-say Cheetah or htmltmpl-implement" needs some > spaces around the dashes, I was wondering what htmltmpl-implement > was for a while before I twigged. I was using -- in the source and Sphinx (or docutils--not sure what's converting this particular character) was converting it to a – which I think is an en-dash. I went through all the docs and switched the -- to --- and that produces a proper em-dash. Updated on the web-site now. > Flavours and Templates > Trivial typo "flavour files iny our datadir". The dash just a > little later could do with spaces. Fixed. /will |
|
From: Chris G <cl...@is...> - 2010-02-06 12:58:54
|
On Fri, Feb 05, 2010 at 10:06:36PM -0500, will kahn-greene wrote: > On 01/30/2010 08:46 AM, Chris G wrote: > > On Fri, Jan 29, 2010 at 12:46:28PM -0500, will kahn-greene wrote: > >> > >> I'm pretty sure the documentation walks through the structure of a > >> flavour and what templates are required. Beyond that, it's just writing > >> the templates. > >> > > Yes, I hear what you're saying. However from the *users* point of > > view changing what a browser sees (i.e. different HTML templates) is > > not the same sort of animal as changing the output format (i.e. HTML > > or RSS or text or whatever). > > > > I think (maybe I'm wrong) that most people will be interested in > > changing what they see in their browser, i.e. they want to output > > 'different HTML' and the documentation doesn't really address this > > requirement directly. > > [snip] > > I re-read the docs and your comments and reworked the chapter. See if > it's better and addresses some/most/all of your issues. > > http://pyblosxom.sourceforge.net/1.5/flavours_and_templates.html > Looks good in general, a couple of minor comments:- Summary The bit "system-say Cheetah or htmltmpl-implement" needs some spaces around the dashes, I was wondering what htmltmpl-implement was for a while before I twigged. Flavours and Templates Trivial typo "flavour files iny our datadir". The dash just a little later could do with spaces. Storing Flavours .... Maybe the first example could be 'joe' with the second one being 'fred'. Storing Flavours in the datadir Brilliant, it makes everything much clearer knowing that this is the old and rather rubbish way of doing it. All in all (for me at least) it's a big improvement. -- Chris Green |
|
From: will kahn-g. <wi...@bl...> - 2010-02-06 03:06:47
|
On 01/30/2010 08:46 AM, Chris G wrote: > On Fri, Jan 29, 2010 at 12:46:28PM -0500, will kahn-greene wrote: >> >> I'm pretty sure the documentation walks through the structure of a >> flavour and what templates are required. Beyond that, it's just writing >> the templates. >> > Yes, I hear what you're saying. However from the *users* point of > view changing what a browser sees (i.e. different HTML templates) is > not the same sort of animal as changing the output format (i.e. HTML > or RSS or text or whatever). > > I think (maybe I'm wrong) that most people will be interested in > changing what they see in their browser, i.e. they want to output > 'different HTML' and the documentation doesn't really address this > requirement directly. > [snip] I re-read the docs and your comments and reworked the chapter. See if it's better and addresses some/most/all of your issues. http://pyblosxom.sourceforge.net/1.5/flavours_and_templates.html /will |
|
From: Chris G <cl...@is...> - 2010-02-04 16:10:21
|
On Thu, Feb 04, 2010 at 11:04:08AM -0500, will kahn-greene wrote: > Don't use his. Use the one in the plugins/tags/ directory in svn and > the tarball which takes advantage of the commandline callback. > Ah, excellent, thank you. :-) -- Chris Green |
|
From: will kahn-g. <wi...@bl...> - 2010-02-04 16:04:20
|
Don't use his. Use the one in the plugins/tags/ directory in svn and the tarball which takes advantage of the commandline callback. /will On 02/04/2010 10:50 AM, Chris G wrote: > Both the tags plugins, that's 'tagger' and 'Tags' point to a broken > link:- > http://joe.terrarum.net/projects.html > > Does anyone have a copy of it or an alternative place to find it? > |
|
From: Chris G <cl...@is...> - 2010-02-04 15:50:55
|
Both the tags plugins, that's 'tagger' and 'Tags' point to a broken
link:-
http://joe.terrarum.net/projects.html
Does anyone have a copy of it or an alternative place to find it?
--
Chris Green
|
|
From: Chris G <cl...@is...> - 2010-02-03 10:12:33
|
On Tue, Feb 02, 2010 at 10:20:10AM +0000, chombee wrote:
> On Mon, Feb 01, 2010 at 06:14:50PM -0500, will kahn-greene wrote:
> >
> > Say I only wanted to do this if PyBlosxom is rendering a category index
> > and not a specific entry. I'd do something like this:
> >
> > def cb_prepare(args):
> > # only thing in the args dict is the request object
> > request = args["request"]
> >
> > # the entry list is in the data section
> > data = request.get_data()
> >
> > entrylist = data["entry_list"]
> >
> > if data["bl_type"] = "dir" and len(entrylist) > 0:
> > first_entry = entrylist[0]
> > first_entry["template_name"] = "story_big_size"
> >
>
> So it looks like to change the template for every entry that is about to
> be rendered you'd have to iterate over entries, something like:
>
> def cb_prepare(args):
> request = args['request']
> data = request.get_data()
> if data['bl_type'] == 'dir':
> entrylist = data['entry_list']
> for entry in entrylist:
> entry['template_name'] = 'story-index'
>
> (Assuming the entries come as dictionaries like that, but you get the
> idea.)
>
This is where I'm going.
I guess/suspect too that one can only change the story template this
way, having looked at the renderer code there's a strange variable
'override' which seems to apply the template_name only when it's
handling a story template.
Here's my actual code:-
def cb_prepare(args):
logger = tools.get_logger()
logger.info("In cb_prepare()")
request = args['request']
data = request.get_data()
entrylist = data['entry_list']
if len(entrylist) > 0:
logger.info("entrylist is > 0")
if data['bl_type'] == "dir":
logger.info("It's a 'dir' so set the template_name to 'story-index'")
for e in entrylist:
e["template_name"] = "story_index"
.... and, after fixing the name of my template so that it matched the
value I was putting into the entry above, it works! Hurrah!
Thanks for all the help everyone, I now have the basis of what I want.
--
Chris Green
|
|
From: will kahn-g. <wi...@bl...> - 2010-02-02 14:42:33
|
On 02/02/2010 05:20 AM, chombee wrote: > > So it looks like to change the template for every entry that is about to > be rendered you'd have to iterate over entries, something like: > > def cb_prepare(args): > request = args['request'] > data = request.get_data() > if data['bl_type'] == 'dir': > entrylist = data['entry_list'] > for entry in entrylist: > entry['template_name'] = 'story-index' > > (Assuming the entries come as dictionaries like that, but you get the > idea.) Entries are not necessarily dicts, but they are dict-like! See Pyblosxom.entries.base and Pyblosxom.entries.fileentry. /will |
|
From: chombee <ch...@la...> - 2010-02-02 10:20:26
|
On Mon, Feb 01, 2010 at 06:14:50PM -0500, will kahn-greene wrote:
>
> Say I only wanted to do this if PyBlosxom is rendering a category index
> and not a specific entry. I'd do something like this:
>
> def cb_prepare(args):
> # only thing in the args dict is the request object
> request = args["request"]
>
> # the entry list is in the data section
> data = request.get_data()
>
> entrylist = data["entry_list"]
>
> if data["bl_type"] = "dir" and len(entrylist) > 0:
> first_entry = entrylist[0]
> first_entry["template_name"] = "story_big_size"
>
So it looks like to change the template for every entry that is about to
be rendered you'd have to iterate over entries, something like:
def cb_prepare(args):
request = args['request']
data = request.get_data()
if data['bl_type'] == 'dir':
entrylist = data['entry_list']
for entry in entrylist:
entry['template_name'] = 'story-index'
(Assuming the entries come as dictionaries like that, but you get the
idea.)
|
|
From: will kahn-g. <wi...@bl...> - 2010-02-01 23:14:59
|
On 02/01/2010 05:47 PM, Chris G wrote:
> How can one change the template for just one thing though at that
> stage? I want to change just the story template when certain
> conditions are met.
The prepare callback gets the entire entry list. So when the certain
conditions that you want met are met, you make the change to the
template_name variable in the entry in the entry list.
For example, if I want the first entry that is going to be shown to use
a template story_big_size that I wrote that's just like my story
template, but the font size is bigger so that the entry is more
prominent at the top of the page, I'd do something like this:
def cb_prepare(args):
# only thing in the args dict is the request object
request = args["request"]
# the entry list is in the data section
data = request.get_data()
entrylist = data["entry_list"]
if len(entrylist) > 0:
first_entry = entrylist[0]
first_entry["template_name"] = "story_big_size"
Say I only wanted to do this if PyBlosxom is rendering a category index
and not a specific entry. I'd do something like this:
def cb_prepare(args):
# only thing in the args dict is the request object
request = args["request"]
# the entry list is in the data section
data = request.get_data()
entrylist = data["entry_list"]
if data["bl_type"] = "dir" and len(entrylist) > 0:
first_entry = entrylist[0]
first_entry["template_name"] = "story_big_size"
Does that make sense? This kicks off after PyBlosxom has figured out
what it's rendering, but before it actually gets rendered.
/will
|
|
From: Chris G <cl...@is...> - 2010-02-01 22:47:52
|
On Mon, Feb 01, 2010 at 04:56:01PM -0500, will kahn-greene wrote: > On 02/01/2010 04:50 PM, chombee wrote: > > On Mon, Feb 01, 2010 at 02:17:08PM -0500, will kahn-greene wrote: > >> The "template" in the args dict in cb_head, cb_date_head, cb_story, > >> cb_story_end and cb_foot callbacks is an actual template--it's not the > >> name of a template. These callbacks are renderer callbacks. > > > > Then it sounds like we're using the wrong callback. What we want to do > > is change the template file that gets used, i.e. we want to change > > template_name. We need a callback that will allow us to change > > template_name, but only if the request is for a directory view not a > > file view, so the callback needs to be able to tell what kind of view > > was requested also. Our problem is just that we're still learning our > > way around the callbacks and the life cycle of a pyblosxom request. > > You're probably looking for the prepare callback which allows you to > change things just before rendering. > How can one change the template for just one thing though at that stage? I want to change just the story template when certain conditions are met. > The lifecycle section of teh dev_architecture page should cover this, > but it seems to do so in a difficult to read fashion. That should > probably get reworked. > I think it does, but cb_prepare sounded too early. -- Chris Green |
|
From: Chris G <cl...@is...> - 2010-02-01 22:45:11
|
On Mon, Feb 01, 2010 at 02:17:08PM -0500, will kahn-greene wrote: > On 02/01/2010 02:04 PM, Chris G wrote: > > It's supposed to return args (the incoming argument list) as that's > > where the story content that gets displayed (the $body) comes from. > > > > That's how I'm changing from 'ordinary format' to 'index format' at > > the moment, be setting the 'body' in the returned args to nothing. > > > > Looking at the code I'm pretty sure the key is 'template_name', it > > refers to that quite a lot in the rendered. However, as I said, I > > think the renderer looks for the alternative 'template_name' *before* > > cb_story() is called. > > > > Just tried 'template' instead of 'template_name', no difference. > > I can't tell if the crux of the confusion in this thread is that there > are two different template keys used or not. > > The "template" in the args dict in cb_head, cb_date_head, cb_story, > cb_story_end and cb_foot callbacks is an actual template--it's not the > name of a template. These callbacks are renderer callbacks. > > Prior to those callbacks getting called, you can override the template > that gets used to render an entry with the "template_name" variable in > the entry dict. This is the name of the template to use to render the > entry. By default, it's "story". Changing "template_name" in the entry > dict will have NO effect if you're doing it in one of the renderer > callbacks because they're beyond template_name things and are working on > the actual template. > Yes, I think I'd sort of got this far. However I don't understand where one *can* change template_name so that it takes effect. -- Chris Green |
|
From: will kahn-g. <wi...@bl...> - 2010-02-01 21:56:08
|
On 02/01/2010 04:50 PM, chombee wrote: > On Mon, Feb 01, 2010 at 02:17:08PM -0500, will kahn-greene wrote: >> The "template" in the args dict in cb_head, cb_date_head, cb_story, >> cb_story_end and cb_foot callbacks is an actual template--it's not the >> name of a template. These callbacks are renderer callbacks. > > Then it sounds like we're using the wrong callback. What we want to do > is change the template file that gets used, i.e. we want to change > template_name. We need a callback that will allow us to change > template_name, but only if the request is for a directory view not a > file view, so the callback needs to be able to tell what kind of view > was requested also. Our problem is just that we're still learning our > way around the callbacks and the life cycle of a pyblosxom request. You're probably looking for the prepare callback which allows you to change things just before rendering. The lifecycle section of teh dev_architecture page should cover this, but it seems to do so in a difficult to read fashion. That should probably get reworked. /will |
|
From: chombee <ch...@la...> - 2010-02-01 21:50:48
|
On Mon, Feb 01, 2010 at 02:17:08PM -0500, will kahn-greene wrote: > The "template" in the args dict in cb_head, cb_date_head, cb_story, > cb_story_end and cb_foot callbacks is an actual template--it's not the > name of a template. These callbacks are renderer callbacks. Then it sounds like we're using the wrong callback. What we want to do is change the template file that gets used, i.e. we want to change template_name. We need a callback that will allow us to change template_name, but only if the request is for a directory view not a file view, so the callback needs to be able to tell what kind of view was requested also. Our problem is just that we're still learning our way around the callbacks and the life cycle of a pyblosxom request. |
|
From: will kahn-g. <wi...@bl...> - 2010-02-01 21:10:30
|
On 02/01/2010 06:24 AM, Chris G wrote: >> > Should it be added to the documentation? (cb_truncatelist that is) > Or is it too likely to cause problems? Done! >> I almost added a sort callback for 1.5. I'm pretty sure blosxom has >> one. If any of you think it'd be useful to have, I can add it in a >> jiffy for 1.5. >> > Well I do I suppose. :-) sortlist (and documentation) added. I pushed a new version of the documentation to the web-site. http://pyblosxom.sourceforge.net/1.5/dev_architecture.html#cb-sortlist http://pyblosxom.sourceforge.net/1.5/dev_architecture.html#cb-truncatelist /will |
|
From: will kahn-g. <wi...@bl...> - 2010-02-01 19:17:17
|
On 02/01/2010 02:04 PM, Chris G wrote: > It's supposed to return args (the incoming argument list) as that's > where the story content that gets displayed (the $body) comes from. > > That's how I'm changing from 'ordinary format' to 'index format' at > the moment, be setting the 'body' in the returned args to nothing. > > Looking at the code I'm pretty sure the key is 'template_name', it > refers to that quite a lot in the rendered. However, as I said, I > think the renderer looks for the alternative 'template_name' *before* > cb_story() is called. > > Just tried 'template' instead of 'template_name', no difference. I can't tell if the crux of the confusion in this thread is that there are two different template keys used or not. The "template" in the args dict in cb_head, cb_date_head, cb_story, cb_story_end and cb_foot callbacks is an actual template--it's not the name of a template. These callbacks are renderer callbacks. Prior to those callbacks getting called, you can override the template that gets used to render an entry with the "template_name" variable in the entry dict. This is the name of the template to use to render the entry. By default, it's "story". Changing "template_name" in the entry dict will have NO effect if you're doing it in one of the renderer callbacks because they're beyond template_name things and are working on the actual template. Hope that helps! /will |
|
From: Chris G <cl...@is...> - 2010-02-01 19:04:39
|
On Mon, Feb 01, 2010 at 05:36:03PM +0000, chombee wrote:
> On Mon, Feb 01, 2010 at 04:19:10PM +0000, Chris G wrote:
> > On Sun, Jan 31, 2010 at 06:54:46PM +0000, chombee wrote:
> > Well I've tried tha above and, so far, I can't get it to work. I'm
> > detecting the 'file' and 'dir' for single/multiple entries OK.
> > So my plugin looks like this:-
> >
> > def cb_story(args):
> >
> > logger = tools.get_logger()
> >
> > e = args['entry']
> >
> > if (e['bl_type'] == 'dir'):
> > logger.info("It's a 'dir' so set the template_name to 'story-index'")
> > e['template_name'] = 'story-index'
> >
> > return args
>
> Sorry, I think the key is 'template' not 'template_name'. In another
> callback it was definitely 'template_name', but the docs for cb_story
> say:
>
> "The template used is typically the story template, but we allow entries
> to override this if they have a template property. If they have the
> template property, then we’ll use the template of that name instead."
>
> Funny, I notice that the docs also say: "Functions that implement this
> callback must return the input args dict whether or not they adjust
> anything in it." But the cb_story in the readmore plugin doesn't return
> anything.
>
It's supposed to return args (the incoming argument list) as that's
where the story content that gets displayed (the $body) comes from.
That's how I'm changing from 'ordinary format' to 'index format' at
the moment, be setting the 'body' in the returned args to nothing.
Looking at the code I'm pretty sure the key is 'template_name', it
refers to that quite a lot in the rendered. However, as I said, I
think the renderer looks for the alternative 'template_name' *before*
cb_story() is called.
Just tried 'template' instead of 'template_name', no difference.
--
Chris Green
|
|
From: chombee <ch...@la...> - 2010-02-01 17:39:58
|
On Mon, Feb 01, 2010 at 04:19:10PM +0000, Chris G wrote:
> On Sun, Jan 31, 2010 at 06:54:46PM +0000, chombee wrote:
> Well I've tried tha above and, so far, I can't get it to work. I'm
> detecting the 'file' and 'dir' for single/multiple entries OK.
> So my plugin looks like this:-
>
> def cb_story(args):
>
> logger = tools.get_logger()
>
> e = args['entry']
>
> if (e['bl_type'] == 'dir'):
> logger.info("It's a 'dir' so set the template_name to 'story-index'")
> e['template_name'] = 'story-index'
>
> return args
Sorry, I think the key is 'template' not 'template_name'. In another
callback it was definitely 'template_name', but the docs for cb_story
say:
"The template used is typically the story template, but we allow entries
to override this if they have a template property. If they have the
template property, then we’ll use the template of that name instead."
Funny, I notice that the docs also say: "Functions that implement this
callback must return the input args dict whether or not they adjust
anything in it." But the cb_story in the readmore plugin doesn't return
anything.
|
|
From: Chris G <cl...@is...> - 2010-02-01 16:33:30
|
On Mon, Feb 01, 2010 at 04:19:10PM +0000, Chris G wrote:
> On Sun, Jan 31, 2010 at 06:54:46PM +0000, chombee wrote:
> > On Sun, Jan 31, 2010 at 06:23:14PM +0000, chombee wrote:
> > > Having said all this, cb_entryparser doesn't really seem like the right
> > > callback for what you want to do. You don't really want to change how
> > > the entry is parsed from file, just how the entry is rendered. Maybe a
> > > cb_postformat plugin that adds a 'template_name' key to the entry_data
> > > dict.
> >
> > No, wait! I think you want the cb_story callback, the same one that the
> > readmore plugin uses. Like the readmore plugin does, you can get the
> > entry dict with:
> >
> > entry = args['entry']
> >
> > then use 'bl_type' to see if we're dealing with an index or a permalink
> > page:
> >
> > if entry['bl_type'] == 'file':
> > # This is a 'file' page, showing a single entry.
> > pass
> > else:
> > # This is an index page (front page or year, month, day, or
> > # category etc. page) showing multiple entries.
> > entry['template_name'] = 'story-index'
> >
> > As a matter of fact, a 'use different story templates for file
> > pages and index pages' plugin would be much simpler and more flexible
> > than the readmore plugin. If you wanted to provide a preview or summary
> > text for each entry like the readmore plugin does, you could just use a
> > metadata field for that.
> >
> Well I've tried tha above and, so far, I can't get it to work. I'm
> detecting the 'file' and 'dir' for single/multiple entries OK.
> So my plugin looks like this:-
>
> def cb_story(args):
>
> logger = tools.get_logger()
>
> e = args['entry']
>
> if (e['bl_type'] == 'dir'):
> logger.info("It's a 'dir' so set the template_name to 'story-index'")
> e['template_name'] = 'story-index'
>
> return args
>
>
> I'm seeing the logger information in my log file but my template
> (story-index.html) isn't being used instead of the default story.html.
>
> I'll try adding some debug in the renderer to see if I can understand
> what's going on.
The code in the renderer that looks for the template_name is run
*before* the cb_story plugin, so the template doesn't get changed.
--
Chris Green
|
|
From: Chris G <cl...@is...> - 2010-02-01 16:19:21
|
On Sun, Jan 31, 2010 at 06:54:46PM +0000, chombee wrote:
> On Sun, Jan 31, 2010 at 06:23:14PM +0000, chombee wrote:
> > Having said all this, cb_entryparser doesn't really seem like the right
> > callback for what you want to do. You don't really want to change how
> > the entry is parsed from file, just how the entry is rendered. Maybe a
> > cb_postformat plugin that adds a 'template_name' key to the entry_data
> > dict.
>
> No, wait! I think you want the cb_story callback, the same one that the
> readmore plugin uses. Like the readmore plugin does, you can get the
> entry dict with:
>
> entry = args['entry']
>
> then use 'bl_type' to see if we're dealing with an index or a permalink
> page:
>
> if entry['bl_type'] == 'file':
> # This is a 'file' page, showing a single entry.
> pass
> else:
> # This is an index page (front page or year, month, day, or
> # category etc. page) showing multiple entries.
> entry['template_name'] = 'story-index'
>
> As a matter of fact, a 'use different story templates for file
> pages and index pages' plugin would be much simpler and more flexible
> than the readmore plugin. If you wanted to provide a preview or summary
> text for each entry like the readmore plugin does, you could just use a
> metadata field for that.
>
Well I've tried tha above and, so far, I can't get it to work. I'm
detecting the 'file' and 'dir' for single/multiple entries OK.
So my plugin looks like this:-
def cb_story(args):
logger = tools.get_logger()
e = args['entry']
if (e['bl_type'] == 'dir'):
logger.info("It's a 'dir' so set the template_name to 'story-index'")
e['template_name'] = 'story-index'
return args
I'm seeing the logger information in my log file but my template
(story-index.html) isn't being used instead of the default story.html.
I'll try adding some debug in the renderer to see if I can understand
what's going on.
--
Chris Green
|