Re: [Zope] Help needed to simplify some code

2006-03-09 Thread Chris Withers

Paul Winkler wrote:


  

  ^^^
Leave out the "python:" there.  


Whoops, yep, sorry about that...

Chris

--
Simplistix - Content Management, Zope & Python Consulting
   - http://www.simplistix.co.uk

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Help needed to simplify some code

2006-03-08 Thread Paul Winkler
On Wed, Mar 08, 2006 at 09:35:55AM +, Chris Withers wrote:
> John Poltorak wrote:
> >
> >Several months ago someone provided me with me with some sample code which 
> >did exactly what I wanted, but looking at it again it looks a little 
> >unwieldy and could do with tidying up. It consists of:-
(snip)

What Chris said, except:

> ...then you can do:
> 
> 
>   
> http://www.slinkp.com
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Help needed to simplify some code

2006-03-08 Thread Chris Withers

John Poltorak wrote:


Several months ago someone provided me with me with some sample code which 
did exactly what I wanted, but looking at it again it looks a little 
unwieldy and could do with tidying up. It consists of:-




   
  
   



Okay, if you can get parse_file to return a list of dictionaries like:
[
  {
   'folder':'whatever',
   'label':'whatever',
  }
]
...then you can do:



  

  


cheers,

Chris

--
Simplistix - Content Management, Zope & Python Consulting
   - http://www.simplistix.co.uk

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] Help needed to simplify some code

2006-03-07 Thread John Poltorak


Several months ago someone provided me with me with some sample code which 
did exactly what I wanted, but looking at it again it looks a little 
unwieldy and could do with tidying up. It consists of:-



   
  
   



which involves parsing a file containing two fields separated by ','

eg.

001,abc
002,jkl
003,xyz


The second field is just a string which appears in a selection menu, and 
the first is the name of a folder which contains an object called 
'content' which get displayed  on selecting the correponding link.


I know this is not a particularly elegant way of doing it, but after 
looking at some TAL examples just can't figure out the right way to do it. 
Some help in simplifying it would be appreciated.


-- 
John


___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )