Can you please email me the patch? Why change the the import email? Massimo
On Dec 30, 4:39 am, "ont.rif" <ont....@gmail.com> wrote: > I have found a few more problems. Below content of a patch which can > fix them. > Patched code sucessfully runs on CentOS 5.4 (web2py 1.74.4). > I drop out fixes for sql.py > > diff -ru --exclude '*.pyc' --exclude sql.py ./2.5/main.py ./2.4/ > main.py > --- ./2.5/main.py 2009-12-16 12:42:47.000000000 +0700 > +++ ./2.4/main.py 2009-12-30 16:19:47.000000000 +0700 > @@ -29,7 +29,7 @@ > import random > #import sneaky > import rewrite > -import functools > +#import functools > import string > from restricted import RestrictedError > from http import HTTP, redirect > @@ -212,7 +212,8 @@ > """ > response.status = str(status).split(' ',1)[0] > response.headers = dict(headers) > - return functools.partial(response.write, escape=False) > + return lambda *args, **kargs: response.write( escape=False, > *args, **kargs ) > + #return functools.partial(response.write, escape=False) > > def middleware_aux(request, response, *middleware_apps): > Только в ./2.5: python24.patch > Только в ./2.5: .sql.py.swp > diff -ru --exclude '*.pyc' --exclude sql.py ./2.5/tools.py ./2.4/ > tools.py > --- ./2.5/tools.py 2009-12-23 02:48:17.000000000 +0700 > +++ ./2.4/tools.py 2009-12-30 16:46:48.000000000 +0700 > @@ -17,7 +17,7 @@ > import base64 > import cPickle > import datetime > -import email > +from email import * > import sys > import os > import re > @@ -53,7 +53,7 @@ > Works with SMTP and Google App Engine. > """ > > - class Attachment(email.MIMEBase.MIMEBase): > + class Attachment(MIMEBase.MIMEBase): > """ > Email attachment > > @@ -121,12 +121,12 @@ > filename = filename.encode(encoding) > if content_type == None: > content_type = contenttype(filename) > - email.MIMEBase.MIMEBase.__init__(self, *content_type.split > ('/', 1)) > + MIMEBase.MIMEBase.__init__(self, *content_type.split('/', > 1)) > self.set_payload(payload) > self['Content-Disposition'] = 'attachment; filename="%s"' > % filename > if content_id != None: > self['Content-Id'] = '<%s>' % content_id.encode > (encoding) > - email.Encoders.encode_base64(self) > + Encoders.encode_base64(self) > > def __init__(self, server=None, sender=None, login=None, > tls=True): > """ > @@ -251,7 +251,7 @@ > to = list(to) > if len(to) == 0: > raise Exception('Target receiver address not specified') > - payload = email.MIMEMultipart.MIMEMultipart('related') > + payload = MIMEMultipart.MIMEMultipart('related') > payload['To'] = ', '.join(to).decode(encoding).encode > ('utf-8') > if reply_to != None: > payload['Reply-To'] = reply_to.decode(encoding).encode > ('utf-8') > @@ -274,19 +274,19 @@ > text = message > html = None > if text != None or html != None: > - attachment = email.MIMEMultipart.MIMEMultipart > ('alternative') > + attachment = MIMEMultipart.MIMEMultipart('alternative') > if text != None: > if isinstance(text, str): > text = text.decode(encoding).encode('utf-8') > else: > text = text.read().decode(encoding).encode > ('utf-8') > - attachment.attach(email.MIMEText.MIMEText(text)) > + attachment.attach(MIMEText.MIMEText(text)) > if html != None: > if isinstance(html, str): > html = html.decode(encoding).encode('utf-8') > else: > html = html.read().decode(encoding).encode > ('utf-8') > - attachment.attach(email.MIMEText.MIMEText(html, > 'html')) > + attachment.attach(MIMEText.MIMEText(html, 'html')) > payload.attach(attachment) > if attachments == None: > pass > > On 30 дек, 04:26, mdipierro <mdipie...@cs.depaul.edu> wrote: > > > Ouch! You are right. That code slipped in. I have just removed them in > > trunk (hg only, I am having problem posting on launchpad) and will > > repost 1.74.5 later this week. > > > Massimo > > > On Dec 29, 2:59 pm, Richard <richar...@gmail.com> wrote: > > > > I think there are a few examples in sql.py, such as lines 2928 and > > > 2939 > > > > On Dec 30, 1:53 am, mdipierro <mdipie...@cs.depaul.edu> wrote: > > > > > web2py libraries does not use (a if Condition else b) but example apps > > > > and plugins may. > > > > > It works with2.4but you need some extra modules. There is an > > > > AlterEgo entry about this. > > > > > On Dec 29, 7:48 am, Richard <richar...@gmail.com> wrote: > > > > > > did you manage to get web2py running with2.4? I noticed web2py uses > > > > > (a if Condition else b), which was syntax introduced in 2.5. > > > > > Richard > > > > > > On Nov 22, 11:12 am, pepe_eloy <pepe.e...@gmail.com> wrote: > > > > > > > Returning to the theme about installhashlibin python2.4,, excuse my > > > > > > ignorance, but is it possible to install these packages in a shared > > > > > > environment? (assuming I do not have root access) > > > > > > > Regards > > > > > > > Jose Eloy Torres > > -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.