[Zope-dev] How to develope a ZObject to connect to an socket server?

2002-08-22 Thread Juan Carlos CORUÑA

Hi all!

I'm trying to develope a zope object that connects to a external socket
server in order to comunícate with it and receive some events (Maybe I
need a thread to process events).

The problem is how to establish the connection at the start of zope and
to disconnect at the end. After some test assigning the socket server
object to _v_ variables in the zope object, it missed the connection
after a while. It seems that it can't maintain the reference stored in
the _v_ variable.

I thing that the behaviour is something like database connections and
I'm looking into some database connection objects to find out the
mechanism used.

If anybody has interesting information or knows where to achieve docs
about this, please could you advise me? 

Juan Carlos Coruña

[EMAIL PROTECTED]



___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



[Zope] type in python methods

2001-01-11 Thread Juan Carlos Coruña

How can I compare the type of 2 variables in a python method?

The instruction "if type(var1) == type(var2): " doesn't work.



___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




RE: [Zope] type in python methods

2001-01-11 Thread Juan Carlos Coruña

Yes, it works. Thanks.



-Mensaje original-
De: Evan Simpson [mailto:[EMAIL PROTECTED]]
Enviado el: jueves, 11 de enero de 2001 15:49
Para: Juan Carlos Corua; [EMAIL PROTECTED]
Asunto: Re: [Zope] type in python methods


From: Juan Carlos Corua [EMAIL PROTECTED]
 How can I compare the type of 2 variables in a python method?

 The instruction "if type(var1) == type(var2): " doesn't work.

_.same_type(var1, var2) should do it. (Without the "_." in Scripts).

Cheers,

Evan @ digicool  4-am


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




RE: [Zope] type in python methods

2001-01-11 Thread Juan Carlos Coruña



-Mensaje original-
De: Luciano Ramalho [mailto:[EMAIL PROTECTED]]
Enviado el: jueves, 11 de enero de 2001 15:21
Para: Juan Carlos Coruña
CC: [EMAIL PROTECTED]
Asunto: Re: [Zope] type in python methods


 The instruction if type(var1) == type(var2):  doesn't work.

It does work:

-
Python 1.5.2 (#0, Jul 30 1999, 09:52:18) [MSC 32 bit (Intel)] on win32
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
 x = 'spam'
 y = 'eggs'
 z = 99
 type(x) == type(y)
1
 type(x) == type(z)
0

-



How isn't it working for you? What is the context? What kinds of
variables are you trying to compare?

Are you aware that type() only knows about primitive types (for example,
all class instances are of type 'instance')?

Regards,

Luciano Ramalho

Juan Carlos Coruña wrote:

 How can I compare the type of 2 variables in a python method?

 The instruction if type(var1) == type(var2):  doesn't work.

 ___
 Zope maillist  -  [EMAIL PROTECTED]
 http://lists.zope.org/mailman/listinfo/zope
 **   No cross posts or HTML encoding!  **
 (Related lists -
  http://lists.zope.org/mailman/listinfo/zope-announce
  http://lists.zope.org/mailman/listinfo/zope-dev )

You are testing type in the python interpreter, but try to test the same
in the product PythonMethod Ver. 0.1.7.


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] How to set a REQUEST variable inside a PythonMethod?

2001-01-09 Thread Juan Carlos Coruña

Hello all!

I have another question related with PythonMethod. This time I tried:

REQUEST.update({'NoRows': 4})

and I tried:

REQUEST['NoRows'] = 4

and I tried:

REQUEST.set('NoRows', 4)

but without success.
(I passed the REQUEST object in the parameter list.)

Anybody has set a REQUEST variable from inside a PythonMethod?


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] Intercept exceptions in Python Methods

2001-01-08 Thread Juan Carlos Coruña

I try to intercept exceptions in a Python Method without success.

The following code works well:

try:
a = int('a')
except:
return 'exception.'

but the next doesn't work:

try:
a = int('a')
except ValueError:
return 'exception'

How can I intercept a concrete exception?


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] How to split a string in a python method?

2001-01-05 Thread Juan Carlos Coruña

Is there any way to split a string in a PythonMethod without passing the
object _.string as an argument?

I have tried to "import string" but Zope generates an ImportError:

ImportError: __import__ not found

I'm using PythonMethod 0.1.7


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] Problem with ZClient

2000-07-11 Thread Juan Carlos Coruña
Title: Problem with ZClient




I'm testing ZClient to access a ZSQL method on a NT box from a Linux
box since Linux can't access any odbc (propietary) database. As ressult
i become a bci.ServerError.
This is the output:
[root@ecom ZPublisher]# ./Client.py -u username:password
http://ntserver.bio.umd.es:8080/xmlrpc/replicar/Cliente/get_Navision
N_=26451
Traceback (innermost last):
  File ./Client.py, line 639, in ?
main()
  File ./Client.py, line 632, in main
headers, body = apply(f,(),kw)
  File ./Client.py, line 225, in __call__
self.handleError(query, ec, em, headers, response)
  File ./Client.py, line 240, in handleError
raise t, RemoteException(t,v,f,l,self.url,query,ec,em,response)
bci.ServerError:
http://ntserver.bio.umd.es/xmlrpc/replicar/Cliente/get_Navision/manage_testForm
(File: C:\ARCHIV~1\XMLSER~1\lib\python\Shared\DC\ZRDB\DA.py Line: 367)
302 Moved Temporarily for
http://ntserver.bio.umd.es:8080/xmlrpc/replicar/Cliente/get_Navision
Anyone is using a similar method or knows about it?
Is there an alternative method to access a ZSQL on another server?




[Zope] Who has compiled _mysql.pyd?

2000-06-23 Thread Juan Carlos Coruña
Title: Who has compiled _mysql.pyd?




I use to develop on linux, but in this moment I need to setup a Zope
server on NT with ZmySQLDA 1.2.0.
On linux I don't have problems to compile _mysqlmodule.so, but on NT
I don't have a compiler nor experience.
Anyone has already compiled _mysql.pyd for NT?
Can I have a copy of _mysql.pyd?






[Zope-dev] Zope 2.2.0b1 not authorized

2000-06-21 Thread Juan Carlos Coruña
Title: Zope 2.2.0b1 not authorized




I have a ZSQL method embedded into another ZSQL method and when I
execute it I become the following error:
Error, Unauthorized: You are not authorized to access SQL.
If I execute the embedded ZSQL method alone I become no errors.
The two methods have the same ownership. 

After searching in the mailing list I have seen a few people with
the same problem but none of them have resolved it.
Anyone knows the solution?




[Zope-dev] Re: [Zope] Please test this Zope 2.2 beta 1 ZSQLMethods fix...

2000-06-21 Thread Juan Carlos Coruña
Title: Re: [Zope] Please test this Zope 2.2 beta 1 ZSQLMethods fix...






 Mensaje original 

El 21/06/00, 17:25:39, Brian Lloyd [EMAIL PROTECTED] escribi sobre
el tema [Zope] Please test this Zope 2.2 beta 1 ZSQLMethods fix...:


 Hi all,

 Several folks have reported problems in beta 1 with SQLMethods
 having authentication problems when trying to call other SQL
 Methods. I'd like a few intrepid volunteers to try something
 for me to see if it fixes the problem. I'd like to make a 2.2
 beta 2 release tomorrow but I want to make sure this issue is
 resolved first.

 Make a backup of the file:

 lib/python/Shared/DC/ZRDB/DA.py

 in your current (beta 1) installation and replace it with the
 DA.py attached to this email, restart and let me know if the
 problem goes away.

 Thanks!

 Brian Lloyd[EMAIL PROTECTED]
 Software Engineer  540.371.6909
 Digital Creations  http://www.digicool.com

It seems to work properly. But all the old ZSQL methods are converted
to folders and you must create the ZSQL methods another time. The
folders that appear aren't accesible and displays the error Resource
not found.





[Zope] Q: xml-rpc and zsql

2000-06-19 Thread Juan Carlos Coruña
Title: Q: xml-rpc and zsql




Have anyone experience using zsql methods with xml-rpc?
How do you pass arguments to a zsql mthod with xml-rpc?






[Zope] Problems using zope as a xml-rpc server

2000-06-16 Thread Juan Carlos Coruña
Title: Problems using zope as a xml-rpc server




Hello Zopistas,


I'm trying to implement a xml-rpc server with zope.
If I try to retrieve a default index_html from python
with xmlrpclib there is no problem, but if I try to retrieve a dtml
method with a zsql method inside it responds: xmlrpclib.ProtocolError:
ProtocolError for ntserver:8080/RPC2: 401 Unauthorized.


I test the BasicAuthTransport class from the XML-RPC How To,
but it crashes with error: NameError: encodestring.


After this I changed encodestring with base64.encodestring, the same
result (Unauthorized).


Any ideas?
Thanks in advance.