Re: Filename clashes in datadir

will kahn-greene <[email protected]> Wed, 17 Nov 2010 10:07:48 -0500
Newsgroups gmane.comp.web.pyblosxom.devel
Message-ID <[email protected]>
One of the things I was looking at doing for PyBlosxom 2.0 (this is
before I abandoned the 2.0 rewrite and switched gears to a less
ambitious [and silly] 1.5) was reworking the transformations lifecycle
for entries.  As part of that, I had created a parse callback which was
to take the place of the entryparser.  So instead of entries being
parsed by an entryparser based on file extension, they'd be parsed by a
parser plugin based on metadata in the entry.  Then all entries would
have .txt extensions.

I don't remember who pointed out that this was a rotten idea.  The gist
of the rottenness is because editors use the file extension to pick the
right syntax highlighting mode.

Anyhow, so all that got scrapped when I ditched the 2.0 initiative.

I think having two entries with the same base name and different
extensions illustrates one of the problems with using the file system
the way that PyBlosxom does.  I don't think I want to fix this in code.
 I'd rather fix it in the documentation.

Can someone write up text for a note to get added to the Writing Entries
chapter?


On 11/17/2010 06:39 AM, seanh wrote:
> On Wed, Nov 17, 2010 at 09:09:43AM +0100, Dieter Plaetinck wrote:
>> On Wed, 17 Nov 2010 01:11:10 +0000
>> seanh <[email protected]> wrote:
>>
>>> Hey, I just noticed something about pyblosxom. What if I have the
>>> following two files in my datadir:
>>>
>>> 	foo.txt
>>> 	foo.markdown
>>>
>>> The first is handled by the built-in entry parser, the second by the
>>> markdown entry parser plugin. Both entries will appear in pyblosxom's
>>> index pages. But both have the same permalink URL:
>>>
>>> 	${base_url}/foo
>>>
>>> So when someone visits that URL in a browser, which entry should
>>> pyblosxom render? It seems to pick one or the other but I'm not how it
>>> makes the decision.
>>>
>>> I guess blosxom must have this problem also?
>>>
>>> The problem is caused by using different filename extensions in
>>> datadir to select the entry parser. If instead you required all
>>> entries to have the same filename extension (maybe .txt, or .entry)
>>> then by the properties of the filesystem it would be impossible for
>>> the user to create two entries with the same permalink URL. Entry
>>> parser plugins could be specified in the optional metadata section
>>> inside the entry files instead.
>>
>> IMHO this is a user problem, not a pyblosxom problem.
>> Users shouldn't use the same basenames with different extensions, if
>> that causes unwanted behavior.
> 
> I have to come to the same conclusion. My suggested solution above
> wouldn't work, you can't specify the entry parser inside the entry file
> contents because the entry parser obviously needs to be selected before
> parsing the file.
> 
> ------------------------------------------------------------------------------
> Beautiful is writing same markup. Internet Explorer 9 supports
> standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
> Spend less time writing and  rewriting code and more time creating great
> experiences on the web. Be a part of the beta today
> http://p.sf.net/sfu/msIE9-sfdev2dev
> _______________________________________________
> Pyblosxom-devel mailing list
> Pyblosxom-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> https://lists.sourceforge.net/lists/listinfo/pyblosxom-devel
> 

------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev