[Zope-dev] Zopeservice and sitecustomize

2004-03-31 Thread Christian Theune
At the beginning of the Month there was a 4 post discussion about this
topic. I recently had the same problem as Sake.

 os.environ['PYTHONPATH'] = SOFTWARE_HOME  inserted
line

This line was questioned to be added to zopeservice.py.

I tried it and it made my pain go away. I'm using Windows 2003 server
for this.

Cheers,
Christian

-- 
Christian Theune, gocept gmbh  co. kg
http://www.gocept.com - [EMAIL PROTECTED]
fon: 03496 3099112 fax: 03496 3099118 mobile: 0179 7808366


signature.asc
Description: This is a digitally signed message part
___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Threads, Locks, Volatility, and Angst

2004-03-31 Thread Ian Beatty
Greetings.

I'm looking for a little wisdom -- specifically, about thread locks and
Zope.

I'm developing a Python-based product. One of the classes needs to hand out
unique IDs to clients as they connect for the first time. I generate these
by keeping an index integer in the instance that starts at zero,
incrementing it by one for every new client, and using the new value for the
unique ID. In order to prevent race conditions when two clients connect
almost simultaneously, I have another instance variable in my class that
holds a threading.lock(). I call acquire() on that lock just before the
increment-and-report code, and release() just after. So far so good.

That seemed to work just fine yesterday when I coded it. Then I shut down
Zope overnight and started it up again today. Now, I cannot create a new
instance of the class without getting the Zope error UnpickleableError:
Cannot pickle type 'thread.lock' objects. (I'd swear it was working
yesterday, though.)

I thought Okay, no problem. I'll just make the lock variable volatile,
since I don't really care whether it persists when Zope shuts down. So I
renamed the lock to begin with '_v_'. That solves my UnpickleableError
problem nicely. Unfortunately, it introduces a different problem: the code
that calls acquire() on the lock now throws AttributeError: 'NoneType'
object has no attribute 'acquire'. I'm sure I initialize that variable to a
threading.Lock() in the object's __init__ method. So now I'm worried that
Zope is doing all kinds of pickling-unpickling activity behind the scenes,
and anything I have that's volatile can disappear without warning.

Are there any thread-wise Zopistas out there who can steer me right?

Thanks,

..Ian

-- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- --
Dr. Ian Beatty   [EMAIL PROTECTED]
Physics Education Research Group  voice: 413.545.9483
Department of Physics   fax: 413.545.4884
Univ. of Massachusetts  AIM: (available upon request)
Amherst, MA 01003-4525 USA   http://umperg.physics.umass.edu/
-- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- --



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


[Zope-dev] ZScheduler

2004-03-31 Thread Alan Milligan
Hi,

Following on from work started at the Zope3 Sprint in Melbourne, I've 
got a release candidate for a Zope scheduler.  This is available from 
http://www.last-bastion.net/ZScheduler, where although the documentation 
is a little light, I've taken efforts to write online helps, although 
it's all reasonably intuitive.

This is an attempt at delivering a definitive solution to this issue, 
and I'm keen to get community feedback as to what additionally is required.

Since I personally am much more familiar with Z2 than Z3, there's only a 
Z2 release candidate at this stage - once the prescribed functionality 
is agreed I will produce a Z3 port (well - if I can't find any 
volunteer(s) ;) ...).

If anybody associated with the recently released ZopeScheduler product 
(or any other competing product) is listening to this list, could they 
please make an effort to coordinate with me about the longer-term 
incantation of both as it's a little pointless not having a single 
answer to this utility.

Cheers, Alan



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


[Zope-dev] Re: Threads, Locks, Volatility, and Angst

2004-03-31 Thread Tres Seaver
Ian Beatty wrote:
On 2004-03-31 5:42 PM, [EMAIL PROTECTED] is reputed to have said:


Do you use this unique ID only as some kind of session ID?


Yes, exactly.


If you only
need these IDs during a session (don't have to store them in ZODB), you
can create a thread safe class for managing them and then use an instant
of this class as a module global variable in your product.
AFAIR, this is the way how exUserFolder implements it's usercache. You
can get a clue by examining these files...


I'll check them out. Thanks.
The root folder of your Zope probably already has an object called 
'browser_id_manager' whose job it is to generate such IDs cheaply;  I 
would recommend using it, instead.

Tres.
--
===
Tres Seaver[EMAIL PROTECTED]
Zope Corporation  Zope Dealers   http://www.zope.com
___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: [Zope3-dev] ZScheduler

2004-03-31 Thread Nikolay Kim
Hi Alan, 

i'm author of ZopeScheduler product, lets coordinate our work




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