|
List Info
Thread: Attribute anyTrue
|
|
| Attribute anyTrue |
  United States |
2007-05-29 04:29:17 |
Dear all,
I've a big application running under CP3. I'm trying to
split it in a
little files for a best maintenance.
I had exctract some related functions from the main program
(under a
class named HttpProtected) and I'd put its in a new file
(named
filemanager) inside a new class (named FileManager).
So from a main file I do:
import cherrypy
from cherrytemplate import cherrytemplate, renderTemplate
import filemanager
.
.
root = Login()
root.HttpProtected = HttpProtected()
root.FileManager = filemanager.FileManager()
.
The filemanager.py starts with the following lines:
import cherrypy
from cherrytemplate import cherrytemplate, renderTemplate
class FileManager:
cherrypy.expose
def filemanager(self, path=None, copy=None, paste=None,
remove=None, start=None, download=None, tar=None,
upload_file=None,
execute=None, removefile=None, confirm=None, newdir=None,
newfile=None, **kw):
.
.
The application seems to works fine, but after a while that
I use
FileManger/filemanager I have the following error:
[29/May/2007:11:12:56] HTTP Traceback (most recent call
last):
File
"/usr/lib/python2.4/site-packages/cherrypy/_cprequest.p
y", line
551, in respond
cherrypy.response.body = self.handler()
File
"/usr/lib/python2.4/site-packages/cherrypy/_cpdispatch.
py",
line 24, in __call__
return self.callable(*self.args, **self.kwargs)
File
"/home/morelli/PYTHON/INTERNAL_PROGRAMS/VirtualCalc/
filemanager.py", line 298, in filemanager
return renderTemplate(file = FilemanagerPage)
File
"/usr/lib/python2.4/site-packages/cherrytemplate/
cherrytemplate.py", line 407, in renderTemplate
result = ''.join(list(result))
File "<string>", line 225, in
_renderTemplate
AttributeError: FileManager instance has no attribute
'anyTrue'
Where is the error?
Can I split a CP3 application in little files or all
classes/methods
has to be in the main program?
THanks
Enrico
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-users googlegroups.com
To unsubscribe from this group, send email to
cherrypy-users-unsubscribe googlegroups.com
For more options, visit this group at h
ttp://groups.google.com/group/cherrypy-users?hl=en
-~----------~----~----~----~------~----~------~--~---
|
|
| Re: Attribute anyTrue |
  France |
2007-05-29 04:37:27 |
morellik a écrit :
> Dear all,
>
> I've a big application running under CP3. I'm trying to
split it in a
> little files for a best maintenance.
>
> I had exctract some related functions from the main
program (under a
> class named HttpProtected) and I'd put its in a new
file (named
> filemanager) inside a new class (named FileManager).
>
> So from a main file I do:
>
> import cherrypy
> from cherrytemplate import cherrytemplate,
renderTemplate
> import filemanager
> .
> .
> root = Login()
> root.HttpProtected = HttpProtected()
> root.FileManager = filemanager.FileManager()
> .
>
>
> The filemanager.py starts with the following lines:
>
> import cherrypy
> from cherrytemplate import cherrytemplate,
renderTemplate
> class FileManager:
> cherrypy.expose
> def filemanager(self, path=None, copy=None,
paste=None,
> remove=None, start=None, download=None, tar=None,
upload_file=None,
> execute=None, removefile=None, confirm=None,
newdir=None,
> newfile=None, **kw):
> .
> .
> The application seems to works fine, but after a while
that I use
> FileManger/filemanager I have the following error:
>
> [29/May/2007:11:12:56] HTTP Traceback (most recent call
last):
> File
"/usr/lib/python2.4/site-packages/cherrypy/_cprequest.p
y", line
> 551, in respond
> cherrypy.response.body = self.handler()
> File
"/usr/lib/python2.4/site-packages/cherrypy/_cpdispatch.
py",
> line 24, in __call__
> return self.callable(*self.args, **self.kwargs)
> File
"/home/morelli/PYTHON/INTERNAL_PROGRAMS/VirtualCalc/
> filemanager.py", line 298, in filemanager
> return renderTemplate(file = FilemanagerPage)
> File
"/usr/lib/python2.4/site-packages/cherrytemplate/
> cherrytemplate.py", line 407, in renderTemplate
> result = ''.join(list(result))
> File "<string>", line 225, in
_renderTemplate
> AttributeError: FileManager instance has no attribute
'anyTrue'
>
> Where is the error?
>
The error seems to come from CherryTemplate but I'm not sure
what it
looks for. It also seems you are using a fairly old version
of
CherryTemplate. Did you get it from its latest svn trunk?
> Can I split a CP3 application in little files or all
classes/methods
> has to be in the main program?
>
No you can safely split your application. CP has always been
about
writing "you web application as any other
application".
- Sylvain
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-users googlegroups.com
To unsubscribe from this group, send email to
cherrypy-users-unsubscribe googlegroups.com
For more options, visit this group at h
ttp://groups.google.com/group/cherrypy-users?hl=en
-~----------~----~----~----~------~----~------~--~---
|
|
| Re: Attribute anyTrue |
  United States |
2007-05-29 05:57:56 |
On May 29, 11:37 am, Sylvain Hellegouarch <s... defuze.org> wrote:
> morellik a écrit :
>
> > Where is the error?
>
> The error seems to come from CherryTemplate but I'm not
sure what it
> looks for. It also seems you are using a fairly old
version of
> CherryTemplate. Did you get it from its latest svn
trunk?
I download it from sourceforge and is the 1.0.0 version
released at
2004.
So I tryied to use the svn version, but I have the same
problem with a
traceback displaying also the
template code with a lot of yield instructions.
> Can I split a CP3 application in little files or all
classes/methods
> > has to be in the main program?
>
> No you can safely split your application. CP has always
been about
> writing "you web application as any other
application".
>
> - Sylvain
Ok, I'm happy to know this. But I don't understand how can I
solve the
problem.
Is correct to import cherrypy and cherrypytemplate in both
files? I
wrong something because the functions inside
the main class works fine, the problem began when I extract
these
functions to create a new class in a new file.
PS: I bought "CherryPy Essentials", a very good
book.
Congratulations!!!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-users googlegroups.com
To unsubscribe from this group, send email to
cherrypy-users-unsubscribe googlegroups.com
For more options, visit this group at h
ttp://groups.google.com/group/cherrypy-users?hl=en
-~----------~----~----~----~------~----~------~--~---
|
|
| Re: Attribute anyTrue |
  France |
2007-05-29 06:01:46 |
morellik a écrit :
>
> On May 29, 11:37 am, Sylvain Hellegouarch <s... defuze.org> wrote:
>
>> morellik a écrit :
>>
>>
>>> Where is the error?
>>>
>> The error seems to come from CherryTemplate but I'm
not sure what it
>> looks for. It also seems you are using a fairly old
version of
>> CherryTemplate. Did you get it from its latest svn
trunk?
>>
>
> I download it from sourceforge and is the 1.0.0 version
released at
> 2004.
> So I tryied to use the svn version, but I have the same
problem with a
> traceback displaying also the
> template code with a lot of yield instructions.
>
Indeed the newest version of CherryTemplate displays a
complete
traceback of the template at the moment it was rendered when
an error
occurs. This usually helps to debug.
>
>> Can I split a CP3 application in little files or
all classes/methods
>>
>>> has to be in the main program?
>>>
>> No you can safely split your application. CP has
always been about
>> writing "you web application as any other
application".
>>
>> - Sylvain
>>
>
> Ok, I'm happy to know this. But I don't understand how
can I solve the
> problem.
> Is correct to import cherrypy and cherrypytemplate in
both files? I
> wrong something because the functions inside
> the main class works fine, the problem began when I
extract these
> functions to create a new class in a new file.
>
Well at first sight I'd say now of course but obviously
something goes
wrong so there must be some kind of conflict somewhere. It's
hard to
tell what without seeing more of the code.
> PS: I bought "CherryPy Essentials", a very
good book.
> Congratulations!!!
>
Thank you
- Sylvain
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-users googlegroups.com
To unsubscribe from this group, send email to
cherrypy-users-unsubscribe googlegroups.com
For more options, visit this group at h
ttp://groups.google.com/group/cherrypy-users?hl=en
-~----------~----~----~----~------~----~------~--~---
|
|
| Re: Attribute anyTrue |
  United States |
2007-05-29 06:22:48 |
On May 29, 1:01 pm, Sylvain Hellegouarch <s... defuze.org> wrote:
> morellik a écrit :
> > I download it from sourceforge and is the 1.0.0
version released at
> > 2004.
> > So I tryied to use the svn version, but I have the
same problem with a
> > traceback displaying also the
> > template code with a lot of yield instructions.
>
> Indeed the newest version of CherryTemplate displays a
complete
> traceback of the template at the moment it was rendered
when an error
> occurs. This usually helps to debug.
>
>
> Well at first sight I'd say now of course but obviously
something goes
> wrong so there must be some kind of conflict somewhere.
It's hard to
> tell what without seeing more of the code.
>
What can I post to enable you to help me (the
cherrytemplate
traceback, ....)? I can put everything on some site so you
can see
the full code.
But only if you have time.
Enrico
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-users googlegroups.com
To unsubscribe from this group, send email to
cherrypy-users-unsubscribe googlegroups.com
For more options, visit this group at h
ttp://groups.google.com/group/cherrypy-users?hl=en
-~----------~----~----~----~------~----~------~--~---
|
|
| Re: Attribute anyTrue |
  France |
2007-05-29 06:31:05 |
> What can I post to enable you to help me (the
cherrytemplate
> traceback, ....)? I can put everything on some site so
you can see
> the full code.
> But only if you have time.
>
>
Try http://rafb.net/paste
- Sylvain
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-users googlegroups.com
To unsubscribe from this group, send email to
cherrypy-users-unsubscribe googlegroups.com
For more options, visit this group at h
ttp://groups.google.com/group/cherrypy-users?hl=en
-~----------~----~----~----~------~----~------~--~---
|
|
| Re: Attribute anyTrue |
  United States |
2007-05-29 07:20:48 |
On May 29, 1:31 pm, Sylvain Hellegouarch <s... defuze.org> wrote:
> > What can I post to enable you to help me (the
cherrytemplate
> > traceback, ....)? I can put everything on some
site so you can see
> > the full code.
> > But only if you have time.
>
> Tryhttp://rafb.net/paste
>
> - Sylvain
Ok. I submitted the cherrypytemplate traceback on:
http://rafb.net/p/ZiV
wAS98.html
If you want to see the program code, I'll put it on the web
server of
my laboratory.
Thanks
Enrico
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-users googlegroups.com
To unsubscribe from this group, send email to
cherrypy-users-unsubscribe googlegroups.com
For more options, visit this group at h
ttp://groups.google.com/group/cherrypy-users?hl=en
-~----------~----~----~----~------~----~------~--~---
|
|
| Re: Attribute anyTrue |
  France |
2007-05-29 07:30:38 |
morellik a écrit :
>
> On May 29, 1:31 pm, Sylvain Hellegouarch <s... defuze.org> wrote:
>
>>> What can I post to enable you to help me (the
cherrytemplate
>>> traceback, ....)? I can put everything on some
site so you can see
>>> the full code.
>>> But only if you have time.
>>>
>> Tryhttp://rafb.net/paste
>>
>> - Sylvain
>>
>
> Ok. I submitted the cherrypytemplate traceback on:
> http://rafb.net/p/ZiV
wAS98.html
>
> If you want to see the program code, I'll put it on the
web server of
> my laboratory.
>
I assume the anyTrue() method is one of yours right? I don't
think it's
part of CherryTemplate.
- Sylvain
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-users googlegroups.com
To unsubscribe from this group, send email to
cherrypy-users-unsubscribe googlegroups.com
For more options, visit this group at h
ttp://groups.google.com/group/cherrypy-users?hl=en
-~----------~----~----~----~------~----~------~--~---
|
|
| Re: Attribute anyTrue |
  United States |
2007-05-29 08:46:02 |
On May 29, 2:30 pm, Sylvain Hellegouarch <s... defuze.org> wrote:
> morellik a écrit :
>
>
>
>
>
> > On May 29, 1:31 pm, Sylvain Hellegouarch
<s... defuze.org> wrote:
>
> >>> What can I post to enable you to help me
(the cherrytemplate
> >>> traceback, ....)? I can put everything on
some site so you can see
> >>> the full code.
> >>> But only if you have time.
>
> >> Tryhttp://rafb.net/paste
>
> >> - Sylvain
>
> > Ok. I submitted the cherrypytemplate traceback
on:
> >http://rafb.net/p/ZiV
wAS98.html
>
> > If you want to see the program code, I'll put it
on the web server of
> > my laboratory.
>
> I assume the anyTrue() method is one of yours right? I
don't think it's
> part of CherryTemplate.
>
Arrghhhhh!!!!
Yes you are ready, the anyTrue is a mine method that I don't
put in
FileManager class. :-(((((
The method is two lines and in the thousand of lines of the
application I forgot to have it.
Thanks a lot for your help, without you I could spend an
year to find
the problem.
Enrico
Enrico
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-users googlegroups.com
To unsubscribe from this group, send email to
cherrypy-users-unsubscribe googlegroups.com
For more options, visit this group at h
ttp://groups.google.com/group/cherrypy-users?hl=en
-~----------~----~----~----~------~----~------~--~---
|
|
[1-9]
|
|