Re: [Zope3-Users] how to know which port zope is runnning on?

2006-11-30 Thread Chris Withers

Shailesh Kumar wrote:

I have 2 different zope applications running (on different machines) and
they would be talking to each other, one is a master application and there
may be multiple instances of the other one (on different machines). I need
the port number information for registing one with another 
programmatically.

don't want to fix port numbers for them.


Well, I'd be looking to dig into the config info provided by zope.conf.

In Zope 2, this is done with:

from App.config import getConfiguration
config = getConfiguration()
config.whatever.etc

...Zope 3 likely has something similar.


couldn't figure out how it can be accessible). Probably I can get it by
parsing zope.conf again in my code.


Don't do that, it would be silly ;-)

Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] how to know which port zope is runnning on?

2006-11-29 Thread Chris Withers

Shailesh Kumar wrote:

Thanx for the hint. I still don't know how to programmatically access the
event log. will try to figure it out.


Why do you need to know programmatically?

Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] how to know which port zope is runnning on?

2006-11-29 Thread Shailesh Kumar

I have 2 different zope applications running (on different machines) and
they would be talking to each other, one is a master application and there
may be multiple instances of the other one (on different machines). I need
the port number information for registing one with another programmatically.
don't want to fix port numbers for them.

Looking at the zope code I found that from
zope.app.server.servertype.IServerType utilities, default port number is
seen which gets overriden during the create() function call, but the
overriden port number (obtained from zope.conf) is not available as such (I
couldn't figure out how it can be accessible). Probably I can get it by
parsing zope.conf again in my code.

With regards,
-shailesh

On 11/29/06, Chris Withers [EMAIL PROTECTED] wrote:


Shailesh Kumar wrote:
 Thanx for the hint. I still don't know how to programmatically access
the
 event log. will try to figure it out.

Why do you need to know programmatically?

Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk


___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] how to know which port zope is runnning on?

2006-11-28 Thread Shailesh Kumar

Hi,

Is it possible for the application code to figure out the port number on
which zope is running? What is the suitable api for that?

With regards,
-shailesh
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] how to know which port zope is runnning on?

2006-11-28 Thread Tom Gross

Hi Shailesh,

   try request.get('SERVER_PORT').

Cheers
-Tom

Shailesh Kumar wrote:

Hi,
 
Is it possible for the application code to figure out the port number 
on which zope is running? What is the suitable api for that?
 
With regards,

-shailesh
 



___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users
  


___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] how to know which port zope is runnning on?

2006-11-28 Thread Chris Withers

Shailesh Kumar wrote:

Thanx Tom,  but I was looking for the general case, not in the context of a
request. Like say during application startup I want to know the port 
number.

Is it possible?


This is surely in the event log, why don't you look there?

Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] how to know which port zope is runnning on?

2006-11-28 Thread Shailesh Kumar

Thanx for the hint. I still don't know how to programmatically access the
event log. will try to figure it out.

With regards,
-shailesh



On 11/28/06, Chris Withers [EMAIL PROTECTED] wrote:


Shailesh Kumar wrote:
 Thanx Tom,  but I was looking for the general case, not in the context
of a
 request. Like say during application startup I want to know the port
 number.
 Is it possible?

This is surely in the event log, why don't you look there?

Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users