Zope external methods and Python: Access to object with a dot in the name 
Author Message
 Zope external methods and Python: Access to object with a dot in the name

Hello,

        I using the great zope and the externals methods which is the python
integration corresponding. From theses methods, you can access the
zope objects through the self that is passed to that methods. You can
also access the sub-directories of these objects using the dot.

My method is called in the main folder and it contains an image
folder:

main
|
|
|
|-images
    |
    |-hello.jpg
    |-other.jpg

So, if I try to access the hello.jpg image, to get the height, I will
type something like:
size = self.images.hello.jpg.height

And here is my problem: There is no folder named hello in the folder
images. Python tries to extend the name in the object hierarchy of
course.

Is it possible to do that? I think so cause zope is using the same
internal representation for the objects no ?

In python, can we have a class name containing a . ??

There should be a way. If you have any ideas !!!

Guillaume



Mon, 21 Jun 2004 21:15:20 GMT  
 Zope external methods and Python: Access to object with a dot in the name

Quote:

> |-images
>     |
>     |-hello.jpg
>     |-other.jpg

> So, if I try to access the hello.jpg image, to get the height, I will
> type something like:
> size = self.images.hello.jpg.height

   size = getattr(self, "hello.jpg").height

Oleg.
--

           Programmers don't die, they just GOSUB without RETURN.



Mon, 21 Jun 2004 21:31:38 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Testing self-written imported Modules in a Zope python external method

2. Zope query: importing packages from External Methods

3. zope external method question...

4. Parameters for Zope External Method

5. Zope 2: External objects?

6. methods and vars in zope objects

7. Embedded python: dotted (sub) module name

8. Zope - Python Method (internal)

9. Nasty Zope & Python Imaging Library name collision

10. dot-dot-dot

11. Q: accessing method name from within a c-function

12. Object methods with same name

 

 
Powered by phpBB® Forum Software