In data lunedì 16 novembre 2009 13:06:43, Giovanni Toffoli ha scritto:
> Più in dettaglio, questo è un esempio funzionante, dove proposals/files è il 
> folder in cui salvare i file.
> A proposito, chi mi dice come compattare la funzione normalizeString in 
> Python, senza usare regular expressions o le API di Plone?
 
> def normalizeString(text, context=None):
>     text = text.replace(' ', '_')
>     text = text.replace('-', '_')
>     text = text.replace("'", '_')
>     text = text.replace('"', '_')
>     text = text.replace(':', '_')
>     return text

return  text.replace(' ', '_').replace('-', '_').replace("'", '_').replace('"', 
'_').replace(':', '_')

Fabry
 

-- 
Fabrizio Reale

Redomino S.r.l.
Largo Valgioie 14, 
10146 Torino Italy
Tel: +39 0117499875
http://redomino.com

_______________________________________________
Plone-IT mailing list
Plone-IT@lists.plone.org
http://lists.plone.org/mailman/listinfo/plone-it
http://www.nabble.com/Plone---Italy-f21728.html

Rispondere a