Re: [pyblosxom-devel] mtimes do not appear to hide future entries on pyblosxom-1.5rc3
will kahn-greene <[email protected]> Sun, 28 Aug 2011 14:17:05 -0400
| Newsgroups | gmane.comp.web.pyblosxom.devel |
|---|---|
| Message-ID | <[email protected]> |
Currently you have to do the mtime-based filtering with a plugin which
you've done. If the plugin works, then that's probably fine. I can't
think of anything offhand that would cause problems with the way you've
implemented it.
Two things jump out at me, though. First is that it looks like you're
mixing tabs and spaces for indentation--that's bad Python programming.
Second is that you're using filter and in this case it's better to use a
list comprehension:
data["entry_list"] = [e for e in data["entry_list"]
if e["timetuple"] <= now]
/will
On 08/28/2011 12:48 PM, Mark David Dumlao wrote:
> Hi,
> After re-reading the docs and the mailing list, it appears to me that
> my understanding regarding future mtimes was wrong.
>
> However, I do think it's a big convenience to write articles dated in
> the future, so I looked into writing a callback for filtering mtime.
>
> Is this an okay way to handle future mtimes?
>
> <snip>
> import datetime
> from datetime import datetime
>
> def cb_prepare(args):
> request = args["request"]
> data = request.get_data()
> now = datetime.now().timetuple()
> data["entry_list"] = filter(lambda e: not e['timetuple']> now,
> data["entry_list"])
> </snip>
>
> On Sun, Aug 28, 2011 at 11:15 PM, Mark David Dumlao<[email protected]> wrote:
>> Hi!
>> I'm new to pyblosxom and I would like some clarification as to how mtimes work.
>>
>> As best as I understand, entries with an mtime later than today should
>> not be displayed, whereas mtimes older than today should be displayed
>> by the blog in decreasing order of date.
>>
>> Is this a correct understanding? If not, how can I help to make this
>> happen, and in the meantime, what is the best way for me to write
>> entries well in advance of their publish date?
>> --
>> This email is: [x] actionable [ ] fyi [x] social
>> Response needed: [x] yes [ ] up to you [ ] no
>> Time-sensitive: [ ] immediate [x] soon [ ] none
>>
>
>
>
------------------------------------------------------------------------------
EMC VNX: the world's simplest storage, starting under $10K
The only unified storage solution that offers unified management
Up to 160% more powerful than alternatives and 25% more efficient.
Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev