X-Git-Url: https://svn.cri.ensmp.fr/git/photoprint.git/blobdiff_plain/bddfc31eaf67003a04f79f7cf168b8d840920fd6..46df770d58b2dbf154a3da4d62d82ae30d39bc86:/price.py diff --git a/price.py b/price.py index f04e063..83a23bf 100755 --- a/price.py +++ b/price.py @@ -1,25 +1,35 @@ # -*- coding: utf-8 -*- -############################################################ -# Copyright © 2009 Benoît PIN # -# Cliché - http://luxia.fr # -# # -# This program is free software; you can redistribute it # -# and/or modify it under the terms of the Creative Commons # -# "Attribution-Noncommercial 2.0 Generic" # -# http://creativecommons.org/licenses/by-nc/2.0/ # -############################################################ +####################################################################################### +# Copyright © 2009 Benoît Pin # +# Plinn - http://plinn.org # +# # +# # +# This program is free software; you can redistribute it and/or # +# modify it under the terms of the GNU General Public License # +# as published by the Free Software Foundation; either version 2 # +# of the License, or (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program; if not, write to the Free Software # +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # +####################################################################################### """ Pricing types -$Id: price.py 834 2009-03-28 15:11:54Z pin $ -$URL: http://svn.luxia.fr/svn/labo/projects/zope/photoprint/trunk/price.py $ + + """ from Globals import Persistent from AccessControl import ModuleSecurityInfo from utils import Message as _ from utils import translate -from Products.globalrequest import getRequest +from zope.globalrequest import getRequest msecurity = ModuleSecurityInfo('Products.photoprint.price') msecurity.declarePublic('Price') @@ -70,7 +80,7 @@ class Price(object, Persistent) : n = str(round(n, 2)) i, d = n.split('.') ds = _(u'${i}.${d}', mapping={'i':i, 'd':d}, default=n) - return translate(ds, getRequest()).encode('utf-8') + return translate(ds).encode('utf-8') def getValues(self) : values = {'value':self._price,