[Moin-user] Re: Linking to attachments with spaces

Don Poitras sasdtp at sas.com
Tue May 11 10:49:09 EDT 2004


Well,
   I've now learned enough Python to at least take a stab at doing
this. I can now have file names with embeded blanks. I would still
like to get the AttachFile action to display the files with the
needed syntax (quotes just around the file name). Here's my diff.
I basically just changed the regexp to allow anything beginning
and ending with quotes to be found and then stripped them off later.
I have no doubt that purists will chide me for something here, but
remember, this is the first python code (other than 'hello.py') that
I've ever written. :)

[/usr/local/lib/python2.3/MoinMoin/parser]diff wiki.py wiki.py.orig
48c48
<     url_rule =
r'%(url_guard)s(%(url)s)\:((\".*\")|(([^\s\<%(punct)s]|([%(punct)s][^\s\<%(punct
)s]))+))'
% {
---
 >     url_rule =
r'%(url_guard)s(%(url)s)\:([^\s\<%(punct)s]|([%(punct)s][^\s\<%(punct)s]))+'
% {
220,224d219
<         if fname[0] == '\"' and fname[-1] == '\"':
<             newname = fname[1:-1]
<             fname = newname
<             newname = url[1:-1]
<             url = newname



> 
> ** <http://sourceforge.net/mailarchive/message.php?msg_id=6927126>I 
> guess I'll just add another ping to request that this gets added in to 
> the base product. I asked about this last year and found:
> 
>  >From: Leslie A. Barnes <leslie at am...>
>  >MoinMoin mods
>  >2003-04-18 08:47
>  >
>  > We've made a couple of minor changes to MoinMoin locally.
>  >
>  > 1) allow attachments to be quoted.
>  >
>  > eg. attach:"my file name.xls"
>  >
>  > which some people had asked for. It's a straightforward change
>  > to url_rule regexp and attachment() in parser/wiki.py
>  >
> 
> I wrote to Leslie and he said that the changes he made have been sent 
> in, but no one seems to know where the code went. If anyone has the 
> code, I'd really appreciate a copy. Although it may be a 
> "straightforward change", I just haven't gotten to the point where my 
> Python skills are such that I can figure out how to do it. Yes, I know 
> there is a work around. Yes, I accept that it can muck other things up. 
> My users are not that computer-literate and if they get stymied in using 
> attachments or have to jump through hoops, they'll just give up. I seem 
> to remember someone posting a way to get moin to create slide show pages 
> and that is mainly what people at my site want to do. Thumbnails are 
> also needed, though, so just slide show isn't enough (these are just 
> family snapshots, not Powerpoint presentations.) Thanks for any help.
> -- 
> Don Poitras
-- 
Don Poitras




More information about the Moin-user mailing list