Re: Latest CVS on windows

Wari Wahab <[email protected]>
Newsgroups gmane.comp.web.pyblosxom.user
Message-ID <[email protected]>
Chris Moffitt wrote:
> Upon further investigation, it looks like it can't find file_path in
> either of the data or conf variables as defined below -
> data = req.getData()
> conf = req.getConfiguration()

Oh well, some variables (file_path, for example) are part of the entry 
dict, which is generated on a story.. So, change of plans :)

> Is there another place where we need to look for this particular variable
> (file_path)?

Yup, anyway, here's the updated plugin :) It covers entry, conf and 
data. It's now a cb_prepare() and a cb_story() plugin now. Hope you guys 
learned something from this.
------------------------------
from Pyblosxom import tools

entry = {}

def conv(data):
     data = str(data) # Just in case it's not a string
     return data.replace('\\', '/')

def dospath2uri(var):
     global entry
     registry = tools.get_registry()
     req = registry["request"]
     data = req.getData()
     conf = req.getConfiguration()

     if entry.has_key(var):
         return conv(entry[var])
     elif data.has_key(var):
         return conv(data[var])
     elif conf.has_key(var):
         return conv(conf[var])
     else:
         return ''

def cb_prepare(args):
     request = args["request"]
     data = request.getData()
     data["dospath2uri"] = dospath2uri

def cb_story(args):
     global entry
     entry = args['entry']
---------------------

-- 
Regards: Wari Wahab
RoughingIT - http://roughingit.subtlehints.net
PyBlosxom  - http://roughingit.subtlehints.net/pyblosxom



-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.