[Zope-dev] wsgi/paste pipelines in Zope 2 or 3?

2006-09-28 Thread Brad Clements
I've been doing a lot of work with Paste in the past year, cutting down on my 
deployments of Zope.

Now I'm taking a new look at Zope 3 and Zope 2, and wondering if it's possible 
to 
use paste pipeline/filter in either version of Zope.  I've looked at

http://cheeseshop.python.org/pypi/zope.paste

and

http://awkly.org/archive/zopepaste-wsgi-applications-in-zope-3-using-pastedeploy/

But what I need is not just a wsgi application hosted in Zope, but rather, a 
wsgi 
filter that can intercept the call chain during traversal.

Has anyone else encountered this need or have thoughts about it?

Thanks

(ps, I have something like xslfilter, but using wsgi and libxml2 and also an 
XSL 
version of TAL/METAL that I'd like to use in Zope)




-- 
Brad Clements,[EMAIL PROTECTED](315)268-1000
http://www.murkworks.com  
AOL-IM or SKYPE: BKClements


___
Zope-Dev maillist  -  Zope-Dev@zope.org
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 )


Re: [Zope-dev] Making a ZSQL.DA fully multi-threaded?

2004-07-26 Thread Brad Clements
On 25 Jul 2004 at 23:22, Dieter Maurer wrote:

 If a connection is dropped due to inactivity it  should not affect any
 transactions going to occur in the future as a reconnect is issued before
 submitted new transactions.
 
 However, connections can be lost for other reasons than inactivity...

I think this is why the thread has gone on so long. I'm ONLY talking about idle 
timeout drops, 
and nothing else. 

gvibDA and sapdbi make a distinction between idle timeout disconnects and others, 
since 
they know when the server has dropped them due to inactivity.


-- 
Brad Clements,[EMAIL PROTECTED]   (315)268-1000
http://www.murkworks.com  (315)268-9812 Fax
http://www.wecanstopspam.org/   AOL-IM: BKClements

___
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 )


Re: [Zope-dev] Making a ZSQL.DA fully multi-threaded?

2004-07-23 Thread Brad Clements
On 23 Jul 2004 at 10:58, Chris Withers wrote:

 Dieter Maurer wrote:
  
  All DA's I saw up to now, do a reconnect.
 
 ZOracleDA didn't...
 
  But this is *WRONG -- as part of a transaction may have been lost.
  After reconnecting, they should raise an exception
  derived from ConflictError and let the complete request retry.

Perhaps I don't understand, but how could their be a missing transaction?

Zope starts, connects to database

Zero or more transactions occur

Zope is idle for some period of time

Z new transaction arrives, some transactions occur in ZODB. A transaction is attempted 
on 
a database connection. The DA  gets a 'your connection has timed out' error from the 
db 
connection. It reconnects, it retries the transaction, no error occurs, so DA returns 
success.

This is the way gvibDA works. It reconnects and retries. 

Where are transactions lost in this scenario?  Remember, I'm talking about the DA 
catching 
connectioned timed out due to idle activity, and no other DB exceptions.




-- 
Brad Clements,[EMAIL PROTECTED]   (315)268-1000
http://www.murkworks.com  (315)268-9812 Fax
http://www.wecanstopspam.org/   AOL-IM: BKClements

___
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 )


Re: [Zope-dev] Making a ZSQL.DA fully multi-threaded?

2004-07-23 Thread Brad Clements
On 23 Jul 2004 at 20:08, Dieter Maurer wrote:

 The bad sequence can look as follows:
 
  * Zope starts a request (and thereby a transaction)
 
  * The request sends a modifying request to a relational database
 
  * The connection is lost; the former modification is discarded
as the database performs an automatic abort on connection close

The former modification cannot be lost because it was commited by the DA as part of 
the 
previous transaction.

At least, gvibDA performs a database commit as part of the overall transaction 
machinery.

So again, I don't see the loss..


-- 
Brad Clements,[EMAIL PROTECTED]   (315)268-1000
http://www.murkworks.com  (315)268-9812 Fax
http://www.wecanstopspam.org/   AOL-IM: BKClements

___
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 )


Re: [Zope-dev] Making a ZSQL.DA fully multi-threaded?

2004-07-21 Thread Brad Clements
On 21 Jul 2004 at 16:44, Chris Withers wrote:

 My point is that unless you implement a connection pool model independent
 of Zope's threading, you WILL run into problems if you have ANY kind of
 timeout where the DA isn't smnart enough to reconnect connections that have
 closed...

I understand. sapdbapi is *supposed* to reconnect on timeout.

 Tada: You made sure that one connection will get used and you won't get
 stale ones being timed out and then randomly selected for use at some later
 point ;-)

I disagree that this was the cause of the segfaults, since I had segfaults within 
minutes of 
starting zope with more than 1 thread, way less than the timeout time.

 Either that or restructure the DA like I did for ZOracleDA ;-)

I want to do that. Hope my client will pay for it ;-)


-- 
Brad Clements,[EMAIL PROTECTED]   (315)268-1000
http://www.murkworks.com  (315)268-9812 Fax
http://www.wecanstopspam.org/   AOL-IM: BKClements

___
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 )


Re: [Zope-dev] Making a ZSQL.DA fully multi-threaded?

2004-07-19 Thread Brad Clements
On 19 Jul 2004 at 7:44, Chris Withers wrote:


 Brad Clements wrote:
 What's the actual problem you're experiencing?
  
  I have set the SAPDB timeout to 32400 seconds.
 
 Unless you have an extremely heavily loaded Zope, that's too low, and may
 be causing you problems...

That is the maximum allowed value in dbmgui.

Anyway, after setting Zope to be single threaded, I have not had any segfaults. 
Perhaps I'm 
wrong on the 'exact' value. I set it to the maximum allowed, perhaps its 324000 
seconds. I 
know it's more than a day so the first number above must be a typo.


-- 
Brad Clements,[EMAIL PROTECTED]   (315)268-1000
http://www.murkworks.com  (315)268-9812 Fax
http://www.wecanstopspam.org/   AOL-IM: BKClements

___
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] UnpickleableError using SESSION in 2.7.2RC1

2004-07-19 Thread Brad Clements
Can sessions store instance objects created by an external method?

I'm running Python 2.3.4 (also happens with 2.3.2)

I also get this error with Zope 2.7.0

I'm trying to save a simple instance in a session. The instance is created in an 
external 
method. I can't figure out why I get this error at the end of the transaction:

Traceback (innermost last):
  Module ZPublisher.Publish, line 107, in publish
  Module Zope.App.startup, line 222, in commit
  Module ZODB.Transaction, line 236, in commit
  Module ZODB.Transaction, line 351, in _commit_objects
  Module ZODB.Connection, line 416, in commit
   - __traceback_info__: (('Products.Transience.TransientObject', 'TransientObject'), 
'\x00\x00\x00\x00\x00\x00\x00%', '')
UnpickleableError: Cannot pickle extension class Acquisition.ImplicitAcquirerWrapper 
at 
409d7800 objects

My external method looks like this::

def CreateInstanceItem(**kw):
Generate an instance item
return InstanceItem(**kw)

And the InstanceItem is::

class InstanceItem(object):
__allow_access_to_unprotected_subobjects__=1
def __init__(self,**kw):
Initialize
self.__dict__ = kw

print Created instance, self

def __repr__(self):
return repr(self.__dict__)

I get output like this from bin/runzope

Created instance {'dn': 'cn=brad,ou=sfiusa,ou=Public,dc=strader-ferris,dc=com', 
'isManager': 
1, 'preferences': None, 'firstname': 'Brad', 'orgname': 'Ross Video Ltd.', 'lastname': 
'Clements', 'userid': '[EMAIL PROTECTED]', 'emailaddress': '[EMAIL PROTECTED]', 
'user': 
[EMAIL PROTECTED], 'orgid': 'rv', 'isCustomer': 1, 'uid': 3.0}


And my python script that calls the CreateInstanceItem looks like this::

I = container.CreateInstanceItem(userid=userid,
orgid=orgid,
dn=dn,
firstname=firstname,
lastname=lastname,
user=user,  # zope user
uid=uid,# our internal uid
preferences=preferences and None,
emailaddress=emailaddress,
orgname=orgname,
isManager=isManager,
isCustomer=isCustomer)

SESSION['user_details'] = I

It seems like the 'I' object is wrapped somehow. From this script I tried 


SESSION['user_details'] = I.aq_base

But I got an attribute error, possibly that's a security thing hiding aq_base.

Is there any way to store an instance in a SESSION?

-- 
Brad Clements,[EMAIL PROTECTED]   (315)268-1000
http://www.murkworks.com  (315)268-9812 Fax
http://www.wecanstopspam.org/   AOL-IM: BKClements

___
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] APE and .svn folders, broke ZMI

2004-07-19 Thread Brad Clements
Hi,

I've run into a problem with Ape and I cannot determine if it's caused by a change in 
Python 
version, Zope version or Ape version.

I have this problem with Ape 0.71, 0.8,  and 0.81

And, Zope 2.7.1 and 2.7.2RC1 and Python 2.3.4 

Basically, I use subversion to control my file-system files, so each folder that Ape 
uses also 
has a .svn subfolder.

Sometime, probably when upgrading from Zope 2.7.0 to 2.7.1, the folders (which I think 
used 
to show up as .svn) are now showing up w/o a name.

So, clicking on the folder (which corresponds to the modification time of the .svn 
folder), 
would send me to this URL

http://server3.strader-ferris.com:7180/Strader/P/FS/Customer//manage_workspace

(note the double slash at the end)

I don't need to access .svn folders. But,  now I cannot use ZMI to create objects in 
any Ape 
hosted folder. I get an error.

Error Type: FSWriteError
Error Value: Not a legal object name: ''

Traceback (innermost last):
  Module ZPublisher.Publish, line 107, in publish
  Module Zope.App.startup, line 222, in commit
  Module ZODB.Transaction, line 236, in commit
  Module ZODB.Transaction, line 351, in _commit_objects
  Module apelib.zodb3.connection, line 294, in commit
  Module apelib.zodb3.storage, line 162, in store
  Module apelib.core.io, line 110, in store
  Module apelib.core.gateways, line 85, in store
  Module apelib.fs.structure, line 124, in store
  Module apelib.fs.connection, line 270, in write_directory
FSWriteError: Not a legal object name: 

The above traceback occured, for example, when trying to create a file object called 
'xyz'.


-- 
Brad Clements,[EMAIL PROTECTED]   (315)268-1000
http://www.murkworks.com  (315)268-9812 Fax
http://www.wecanstopspam.org/   AOL-IM: BKClements

___
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 )


Re: [Zope-dev] Making a ZSQL.DA fully multi-threaded?

2004-07-16 Thread Brad Clements
On 16 Jul 2004 at 8:57, Chris Withers wrote:

 This often means that many more database connections are opened than are
 actually necessary. And if you start timing out inactive database
 connectiosn on the database side, you're in for a world of pain and
 suffering.
 
 I branched ZOracleDA some time ago to move away from this model for that
 very reason...
 
 What's the actual problem you're experiencing?

I have set the SAPDB timeout to 32400 seconds. However when running with more than 1 
thread I still get mysterious segfaults in the sapdbapi component.

The SAP  folks say their adapter is multi-thread capable, but I've come to believe 
that only 
means that it's ok to open a connection in one thread and use it in another, but NOT 
to have 
2 threads make requests on the same connection at the same time.

Also, two threads can' t open a connection at the same time because their connection 
table 
management isn't thread safe.

What I need, I suppose, is a DB connection pool mechanism of some kind. I also have 
Python extensions that need a connection as well. Getting the actual database 
connection 
from a DA stinks (ie, it's not really possible). I'd like to see an API extension to 
ZopeDA's to 
allow Pythonscripts, Products and external methods get an actual db connection. But 
that I 
suppose is a problem to solve later.

I think I will take a look at ZOracleDA to see what you did. 


-- 
Brad Clements,[EMAIL PROTECTED]   (315)268-1000
http://www.murkworks.com  (315)268-9812 Fax
http://www.wecanstopspam.org/   AOL-IM: BKClements

___
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 )


Re: [Zope-dev] Making a ZSQL.DA fully multi-threaded?

2004-07-16 Thread Brad Clements
On 16 Jul 2004 at 11:38, Andy Dustman wrote:

  Also, two threads can' t open a connection at the same time because
  their connection table management isn't thread safe.
 
 That does suck, but it doesn't seem like an insurmountable problem for a
 DA. You just need a per-DA instance mutex which you acquire before opening
 a connection release afterwards.

Someone else said that every thread has it's own copy of ZODB, hence their own copies 
of 
each DA. So putting the mutex on the DA won't help this, will it?


-- 
Brad Clements,[EMAIL PROTECTED]   (315)268-1000
http://www.murkworks.com  (315)268-9812 Fax
http://www.wecanstopspam.org/   AOL-IM: BKClements

___
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] 2.7 series dropped PASV_FTP_PORTRANGE

2004-07-12 Thread Brad Clements
In the 2.6 series I submitted a patch to support specifying the range of tcp ports to 
use on 
the server for pasv ftp transfers.

I still need this functionality, but I see that the environment variable hack isn't 
in 
medusa/ftp_server.py

I thought perhaps something in zope.conf would specify this, but it seems not to be 
there.

In fact, I see no clean way to pass port range information from ZServer.FTPServer to 
medusa.ftp_server  (hence why we used an environment variable hack in the past)

For my use case, the pasv port range is always near the range used by the listening 
ftp 
daemon anyway, so a simple solution for me is to look at the control connection port 
and just 
find an open port that is nearby.

However the better solution, I suppose, is to allow the port range to be specified in 
zope.conf.

But what's the best way (architecturally) to cleanly get this information into 
medusa's 
ftp_server.py module?




-- 
Brad Clements,[EMAIL PROTECTED]   (315)268-1000
http://www.murkworks.com  (315)268-9812 Fax
http://www.wecanstopspam.org/   AOL-IM: BKClements

___
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] Making a ZSQL.DA fully multi-threaded?

2004-07-09 Thread Brad Clements
I am using ZsapdbDA with SAPDB (now MaxDB) and have run into problems when Zope 
has more than one thread.

The folks at SAP suggest that there should be one database connection per thread, 
rather 
than sharing one connection across threads.

I haven't yet looked at the Zsapdb source, but I think it has only one connection for 
all 
threads.

Is there a document somewhere that explains how to make variables thread private in 
Zope? I vaguely recall something about one cache per thread, or that variables are 
read-
only shared unless updated by a thread, and then they're copied.. This is probably 
quite 
wrong, but obviously I just don't understand how data and threading works in Zope.

So, I'm looking for a document that explains this clearly. How to have data that is 
not shared 
between threads (perhaps a kind of connection pool thingy).


Also, I have other projects where I really want to have just one object of it's kind 
no matter 
how many threads. For example, gvibDA uses Thunked_TM for this, but that doesn't 
really 
work with ZSQLDA because I've seen that multiple connect calls are made, even with the 
THUNKED_TM.

Is there a Zen Of document about this somewhere?

Thanks



-- 
Brad Clements,[EMAIL PROTECTED]   (315)268-1000
http://www.murkworks.com  (315)268-9812 Fax
http://www.wecanstopspam.org/   AOL-IM: BKClements

___
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 )


Re: Zope + Ape + Subversion (was: RE: [Zope-dev] Using a truely revis ion based storage for Zope ?)

2004-04-13 Thread Brad Clements
On 12 Apr 2004 at 18:03, [EMAIL PROTECTED] wrote:

 
 Anyways, I'm just rambling by now ... Comments, thoughts and constructive
 criticism welcome !

This sounds wonderful!

Regarding versions. Perhap you can have a control panel setting that selects the 
branch to publish by default. The ZMI could offer another mechanism that uses 
cookies to select the desired branch or version  That is, a branch name or PREV, 
HEAD etc.

But, I use jEdit and FTP for most of my Zope work, so would really like to have a way 
to 
access version/branches via FTP. Maybe that can be done by having pseudo 
subdirectories named after revisions or branches. So /myFolder/.Prev/index_html 
would do what you expect (note you can't save to old versions anyway ..)




-- 
Brad Clements,[EMAIL PROTECTED]   (315)268-1000
http://www.murkworks.com  (315)268-9812 Fax
http://www.wecanstopspam.org/   AOL-IM: BKClements


___
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 )


Re: [Zope-dev] DateTime stftime and TAI based timezone is broken or is it?

2003-12-03 Thread Brad Clements
On 2 Dec 2003 at 13:39, Jamie Heilman wrote:

   y = DateTime.DateTime(dx) y
  DateTime('2003/12/01')
   y.strftime(%a %b. %d)
  'Sun Nov. 30'
   y.strftime(%a %b %d %H:%M:%S)
  'Sun Nov 30 23:59:38'
 
 Lovely.  Its always bugged me that DateTime carried all its own zone
 information, but I guess even the datetime python modules punt in this
 regard.  What I'm currious to know is how this caused problems for
 you, or your clients.  I'd like to avoid those problems myself if I
 can help it.

My legacy site has a lot of dtml-var somedatetimeobject fmt=%a %b %d

this writes out the wrong day, because somedatetimeobject is just like you show above.

Also, I get different results instantiating a DateTime object with a string, vs. parts 
DateTime(y,m,d,h,m,s) vs. DateTime('-MM-DD HH:MM:SS')

Why can't Zope just dynamically load the tzfile data as appropriate from the system if 
it 
can? 


-- 
Brad Clements,[EMAIL PROTECTED]   (315)268-1000
http://www.murkworks.com  (315)268-9812 Fax
http://www.wecanstopspam.org/   AOL-IM: BKClements


___
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 )


Re: [Zope-dev] re: DateTime stftime and TAI based timezone is broken or is it?

2003-12-02 Thread Brad Clements
Perhaps there's a .c file kicking around somewhere that extracts data from tzfile. 

Anyone remember? I checked csv and can't find it.


On 2 Dec 2003 at 7:54, Chris McDonough wrote:

 Gurg.  If there is such a beast, I never saw it... you may just want to
 add it directly.
 
 On Mon, 2003-12-01 at 16:45, Brad Clements wrote:
  I think adding right/EST5EDT  tzfile info to DateTimeZone.py might solve my 
  problem.
  
  Can someone email me the .py script used to create the DateTimeZone.py file?
  
  
 


-- 
Brad Clements,[EMAIL PROTECTED]   (315)268-1000
http://www.murkworks.com  (315)268-9812 Fax
http://www.wecanstopspam.org/   AOL-IM: BKClements


___
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] DateTime stftime and TAI based timezone is broken or is it?

2003-12-01 Thread Brad Clements
Yesterday I switched my Linux machines to use clockspeed 0.62 and therefore had to 
switch to the right/EST5EDT timezone.

Today my client calls rather upset that lots of data has disappeared from his 
database, 
etc..

So while I have found and fixed a bunch of timezone conversion problems in my code, 
I'm stumped by DateTime.strftime().

I'm working with Zope 2.6.0 but the code is the same in 2.7.0b2

Basically, I get this situation:

 dx
'2003-12-01 00:00:00'
 y = DateTime.DateTime(dx)
 y
DateTime('2003/12/01')
 y.strftime(%a %b. %d)
'Sun Nov. 30'
 y.strftime(%a %b %d %H:%M:%S)
'Sun Nov 30 23:59:38'
 y.Time()
'00:00:00'

So, the DateTime object knows the correct year, month and day, it's mishandling of  
'diff' in strftime is a problem. I can't quite figure out what the regex does in the 
code 
below, but diff is 22 seconds off from the regular timezone offset. That's will be 
lost in 
the divide by 36. 

The timezone offset that _tzoffset calculates is wrong:

 DateTime._tzoffset(y._tz, y._t)
-18000

Because 

 y._tz
'US/Eastern'

(but it should be 'right/EST5EDT') 


What's the best way for me to fix this? I'll submit a patch if I can get a clue. 

Btw, the timezone right/EST5EDT isn't in DateTime's timezone listing. Shouldn't Zope 
get this data from Python?

I'll remark that Python doesn't know about the 'correct' offset either. 

 import time
 time.tzname
('EST', 'EDT')
 time.timezone
18000

Well now I'm stuck, I've set /etc/localtime and /usr/share/zoneinfo/posixrules 
correctly, 
and date returns the correct time.

However even forcing TZ with Python 2.3 doesn't work correctly.

sh-2.05b$ TZ=right/EST5EDT python2.3
Python 2.3.2 (#2, Nov  6 2003, 10:44:39) 
[GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2
Type help, copyright, credits or license for more information.
 import os
 os.environ['TZ']
'right/EST5EDT'
 import time
 time.timezone
18000
 time.tzname
('EST', 'EDT')
 time.tzset()
 time.tzname
('EST', 'EDT')
 time.timezone
18000

How does time.localtime() know the correct timezone offset, but time.timezone is not 
correct?

 time.localtime(); os.system('date')
(2003, 12, 1, 12, 55, 25, 0, 335, 0)
Mon Dec  1 12:55:25 EST 2003


-

DateTime.py

def strftime(self, format):
# Format the date/time using the *current timezone representation*.
diff = _tzoffset(self._tz, self._t)
format = re.sub('(^\|[^%])%z',
   '\\1%+05d' % (diff / 36),
   format)
return strftime(format, safegmtime(self.timeTime() + diff))

-- 
Brad Clements,[EMAIL PROTECTED]   (315)268-1000
http://www.murkworks.com  (315)268-9812 Fax
http://www.wecanstopspam.org/   AOL-IM: BKClements


___
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: DateTime stftime and TAI based timezone is broken or is it?

2003-12-01 Thread Brad Clements
I think adding right/EST5EDT  tzfile info to DateTimeZone.py might solve my problem.

Can someone email me the .py script used to create the DateTimeZone.py file?



-- 
Brad Clements,[EMAIL PROTECTED]   (315)268-1000
http://www.murkworks.com  (315)268-9812 Fax
http://www.wecanstopspam.org/   AOL-IM: BKClements


___
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 )


Re: [Zope-dev] Zope and interbase

2003-10-30 Thread Brad Clements
On 29 Oct 2003 at 17:41, Paulo Lobo wrote:

 Pessoal, é o seguinte:
 Guys, i have a problem...
 i'm working on a site with Zope and Interbase, and sometimes some strange things 
 start to
 happen...
 when a lot of requests are made, for example, if someone press F5 and keep it 
 pressed, zope
 locks and interbase too
 if we acess a page that doesn't uses Interbase, in the same server, zope doesn't 
 locks, even if we
 try to acess it with more than one user at a time
 i think that's something wrong with my Interbase connector. I'm using ZFirebird, 
 because we
 already had this problem with L Interbase Connector. If someone could show mea
 betterInterbase connector ou another form of solving this problem, i would be glad...

We have been using Interbase/Firebird with gvibDA for a couple of years and
experience the same problem. I think there's a bug in the firebird/interbase gds 
library
that fails under multi-threading conditions. The gvibDA is thunked, but gds still hangs
under heavy load.

So, we're migrating to SAP DB, which is also much faster than Firebird (at least for 
our
use case)



--
Brad Clements,[EMAIL PROTECTED]   (315)268-1000
http://www.murkworks.com  (315)268-9812 Fax
http://www.wecanstopspam.org/   AOL-IM: BKClements


___
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 )


Re: [Zope-dev] Versions: should they die?

2003-06-05 Thread Brad Clements
Sorry if is OT.

I'd like ZODB and Zope to support Revisions. That is, historical copies that do not 
get 
removed when ZODB is packed.

Does the Version mechanism contribute to this kind of functionality? I'd like to be 
able to tag revisions of wiki pages and other documents, and then be able to diff 
them later without having to create a special kind of product for each object type 
that 
I'd like to use revisions for.

Maybe this is kind of the reverse way of doing what versions are for. We have used 
versions a little to work on a live site. 


What would be interesting is using revisions (with tags), then telling Zope to serve 
only objects with this revision or older, or the current object if no revisions are 
on 
file for that object. And .. the serving up of a particular tag would be set on a 
Zserver 
instance.

So, I could continue to use ZMI as normal, but run another zserver on a different 
port (the one that feeds the world) with a particular revision. Or I could do this 
with 
ZEO.

Probably there's too much overhead in this idea. 








-- 
Brad Clements,[EMAIL PROTECTED]   (315)268-1000
http://www.murkworks.com  (315)268-9812 Fax
http://www.wecanstopspam.org/   AOL-IM: BKClements


___
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] ZEO 2.0 testConnection() takes 30 seconds (MountedStorage)

2002-11-08 Thread Brad Clements
I'm using mounted storage.. Whenever my Zope server restarts, it takes 30 seconds 
after the first web hit before it's really up and running because testConnection() is 
called by somebody.

1. Why does testConnection() take 30 seconds to run, or is it something else?

2. Why is testConnection() being called  at all, since there is only one server so 
there's 
nothing to fall back to?

Anyone have any ideas where to look for more clues? Maybe it's not testConnection..

2002-11-08T13:57:27 INFO(0) ZODB Opening database for mounting: 
{'host':'localhost','port':'4400','storage':'Common',}
--
2002-11-08T13:57:27 INFO(0) ZCS:4080 ClientStorage (pid=4111) created RW/normal for 
storage: 'Common'
--
2002-11-08T13:57:27 INFO(0) ZEC ClientCache: storage='Common', size=20971520; 
file[0]='/home/bkc/Zope/Manage/var/cCommon-Common-4400-0.zec'
--
2002-11-08T13:57:27 INFO(0) ZCS:4080 Testing connection ManagedConnection 
('127.0.0.1', 4400)
--
2002-11-08T13:57:57 INFO(0) ZCS:4080 Connected to storage
--
2002-11-08T13:57:57 INFO(0) ZEC read_index: cache file 0 has 122 records and 386963 
bytes
--
2002-11-08T13:57:57 INFO(0) ZODB Mounted database 
{'host':'localhost','port':'4400','storage':'Common',} at Managers/Common
Exception exceptions.AttributeError: Connection instance has no attribute 
'_Connection__connection' in method Connection.close of Connection instance at 
0x8bea73c ignored


Brad Clements,[EMAIL PROTECTED]   (315)268-1000
http://www.murkworks.com  (315)268-9812 Fax
AOL-IM: BKClements


___
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 )



Re: [Zope-dev] My 2.6.0 feature patch didn't make it!?

2002-10-30 Thread Brad Clements
On 30 Oct 2002 at 11:25, Chris Withers wrote:

 Brad Clements wrote:
  http://dev.zope.org/Wikis/DevSite/Projects/Zope2.6/ProposedFeatures
  
  But the passive port range patch didn't make it into 2.6
 
 Do you have CVS access?

No. I emailed both sets of patches to .. Brian (?) at the same time.



Brad Clements,[EMAIL PROTECTED]   (315)268-1000
http://www.murkworks.com  (315)268-9812 Fax
AOL-IM: BKClements


___
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-dev] My 2.6.0 feature patch didn't make it!?

2002-10-29 Thread Brad Clements
I submitted 2 features to 2.6,

gzip compression

ftp pasv port range spec

the first one made it, the 2nd one didn't.

Both are listed as comitted and vetted  on 

http://dev.zope.org/Wikis/DevSite/Projects/Zope2.6/ProposedFeatures

But the passive port range patch didn't make it into 2.6


 


Brad Clements,[EMAIL PROTECTED]   (315)268-1000
http://www.murkworks.com  (315)268-9812 Fax
AOL-IM: BKClements


___
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-dev] ZClass object - FTP Upload fails

2002-10-01 Thread Brad Clements

I have a Zclass whose bases are:

ZObject, ZDTMLDocument, _ZClass_for_Renderable

I am unable to FTP upload an existing instance. That is, HTML-Kit can open an 
instance and view the body source, but when I hit save I get an FTP error 426 could 
not create file.

The instance does not have an extension in it's id (i.e., the object id is 
overview), and I 
do not have a Zope mapping of file extensions to this ZClass type.

1. Does the FTP server see STOR as a new create process, in which case I need to 
add an file extension to the object id AND create a mapping so Zope knows what type 
of object to make?  (I think not, since I don't want to create a new object, just 
upload 
the body again)

2. How can I diagnose this error more? Where do I look?

3. Is there some obvious permission setting I haven't turned on for my ZClass? (I have 
FTP access mapped to Change DTML Methods in the corresponding Product Define 
permissions tab. Though I don't see Ftp access as a permission on this zclass under 
define permissions on the class, but it is shown as an inherited permisson.

4. Shouldn't I be inheriting a PUT method from the ZDTMLDocument class?



Brad Clements,[EMAIL PROTECTED]   (315)268-1000
http://www.murkworks.com  (315)268-9812 Fax
AOL-IM: BKClements


___
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 )



Re: [Zope-dev] Re: Passive ftp for zope.

2002-09-24 Thread Brad Clements

PASV ftp support has already been integrated into Zope 2.6

Brad Clements,[EMAIL PROTECTED]   (315)268-1000
http://www.murkworks.com  (315)268-9812 Fax
AOL-IM: BKClements


___
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 )



Re: [Zope-dev] Potential Improvements for xml-rpc debugging

2002-08-30 Thread Brad Clements

On 30 Aug 2002 at 10:10, Casey Duncan wrote:

 Now my question is whether this is a good thing in general. I like it
 especially when accessing Zope using Python's xmlrpclib, but do any of have
 reasons for keeping the html tags in the fault string?

No, drop the HTML!

I do a lot of xml-rpc with IE 5.5 clients, and getting a fault is a pita.

I keep modifying xmlrpc.py (each time I update Zope) to print the traceback on the 
server, but that's a pita.

Brad Clements,[EMAIL PROTECTED]   (315)268-1000
http://www.murkworks.com  (315)268-9812 Fax
AOL-IM: BKClements


___
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-dev] Can't followup to bug 525 - Collector problem, DIFF attached

2002-08-19 Thread Brad Clements

I'm trying to submit a patch to collector item 525

After I login, I select followup and enter text and path to the patch file.

When I hit submit, I'm prompted to login again.

If I do login again, I get a very ugly Zope error, most likely because the attached 
file 
isn't in the redirected request.

Here's the diff with Zope 2.5.1 to fix this problem by redirecting unauthorized 
exceptions to the real HTTPResponse object

*** orig-251/xmlrpc.py  Mon Aug 19 09:15:28 2002
--- xmlrpc.py   Mon Aug 19 09:23:05 2002
***
*** 22,27 
--- 22,29 
  import sys
  from HTTPResponse import HTTPResponse
  import xmlrpclib
+ 
+ from zExceptions import Unauthorized
  
  def parse_input(data):
  Parse input data and return a method path and argument tuple
***
*** 118,124 
  # traceback object.
  if type(info) is type(()) and len(info)==3: t,v,tb = info
  else: t,v,tb = sys.exc_info()
! 
  # Create an appropriate Fault object. Unfortunately, we throw away
  # most of the debugging information. More useful error reporting is
  # left as an exercise for the reader.
--- 120,130 
  # traceback object.
  if type(info) is type(()) and len(info)==3: t,v,tb = info
  else: t,v,tb = sys.exc_info()
! 
! if t == 'Unauthorized' or t == Unauthorized or (
! isinstance(t, types.ClassType) and issubclass(t, Unauthorized)):
! return self._real.exception(fatal=fatal,info=info)
! 
  # Create an appropriate Fault object. Unfortunately, we throw away
  # most of the debugging information. More useful error reporting is
  # left as an exercise for the reader.


Brad Clements,[EMAIL PROTECTED]   (315)268-1000
http://www.murkworks.com  (315)268-9812 Fax
AOL-IM: BKClements


___
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-dev] Patch for 525, oops

2002-08-19 Thread Brad Clements

add

import types

to the modified xmlrpc.py




Brad Clements,[EMAIL PROTECTED]   (315)268-1000
http://www.murkworks.com  (315)268-9812 Fax
AOL-IM: BKClements


___
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 )



Re: [Zope-dev] passive FTP to Zope with a specified port-range

2002-08-02 Thread Brad Clements

On 2 Aug 2002 at 11:53, Mr Tobias Schiebeck wrote:

 I'm trying to modify the zope ftp-access to specify a port range 
 within the server selects the ports for the passive ftp communication
 with the ftp-clients. This is in order to have the Zope server behind
 a firewall blocking more then the privileged ports only. 

This feature has already been added to Zope 2.6 as a patch.

I originally added it to Zope 2.5, so I think you can just copy the 2.6 ftp_server 
from 
CVS and drop it into your current Zope to get it to work.



Brad Clements,[EMAIL PROTECTED]   (315)268-1000
http://www.murkworks.com  (315)268-9812 Fax
AOL-IM: BKClements


___
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-dev] Singleton DA possible?

2002-07-17 Thread Brad Clements

The gvibDA interbase adapter really must have exactly one database connection 
shared among all threads.

Even though the DA is derived from THUNKED_TM, there are still multiple instances of 
the DA created, one for each thread (depending on server load).

What I really want is one DA that is controlled through a thread-lock for all 
threads.

I realize I may need to create a proxy object.. any suggestions on how best to design 
this?

--

Also, even running Zope with -t 1, I still sometimes get 2 DA objects. I can even see 
that the __del__ method on the earlier DA instance is being called. But that still 
messes 
it up.


Brad Clements,[EMAIL PROTECTED]   (315)268-1000
http://www.murkworks.com  (315)268-9812 Fax
AOL-IM: BKClements



___
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 )



Re: [Zope-dev] AFS authentication with Zope

2002-06-11 Thread Brad Clements

On 11 Jun 2002 at 15:30, Carlo Giomini wrote:

 Hi to all,
 I need to make Zope perform an AFS-based authentication: any
 suggestions/hints/knowledge/resources?
 Thanks,
 Carlo.

Which direction do you want to go?

1. You want Zope user folder to be an authentication source for AFS? (not possible),

2. or you want Zope to authenticate to an existing AFS domain? (possible)

I've done the later, used SWIG to wrap some AFS functions and created a userFolder 
object to authenticate to AFS.




Brad Clements,[EMAIL PROTECTED]   (315)268-1000
http://www.murkworks.com  (315)268-9812 Fax
AOL-IM: BKClements



___
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-dev] How to actually submit contributions for 2.6?

2002-03-29 Thread Brad Clements

I have two pending suggestions on the wiki. I'm ready to submit code/patches. What is 
the actual mechanism I should use?

Just put patches into bug tracker?

Brad Clements,[EMAIL PROTECTED]   (315)268-1000
http://www.murkworks.com  (315)268-9812 Fax
AOL-IM: BKClements


___
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 )



Re: [Zope-dev] Trapping Interbase Error Codes

2002-03-09 Thread Brad Clements

On 8 Mar 2002 at 20:58, Dieter Maurer wrote:

 Beverly Dolor writes:
   I'm currently doing a program on Zope 2.5 using gvibDa
   as my database.  I would like my program to trap
   Interbase error codes such as (isc_deadlock,
   isc_lock_conflict), the problem is I'm still at a lost
   on how to do this. 
 How are these errors shown to you?
 
 I do not know Interbase and the corresponding adapters.
 For Oracle (DCOracle2), Oracle errors are mapped onto a standard
 exception, but the exception detail contains the Oracle error number.
 Thus, looking at this number, I would be able to provide
 error specific information.

Checking specific error codes from within Zope is a PITA because of access control on 
the Exception object.

You'll need to modify gvibExceptions.py, add doc strings to def getSqlCode(self) 
and 
other methods.. And probably add

__roles__=None
__allow_access_to_unprotected_subobjects__=1

hack lines to Exception class defs.

OTH, if you use an external method to process the gvib request, or create an external 
method that can extract the sqlCode for you.. then you wouldn't need these mods.

def getSqlCode(exceptionObject):
Return the sqlcode
return exceptionObject.getSqlCode()


Then when you get an exception, pass the exception object to the external method to 
get the sqlcode.



Brad Clements,[EMAIL PROTECTED]   (315)268-1000
http://www.murkworks.com  (315)268-9812 Fax
AOL-IM: BKClements


___
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 )



Re: [Zope-dev] Adding gzip compression to HTTPResponse.py

2002-02-06 Thread Brad Clements

On 6 Feb 2002 at 10:02, seb bacon wrote:

 I don't have much useful to add - I just wanted to mention that I know
 there are people out there who have succesfully used mod_gzip with Zope;
 and that I *like* the name dogzip :-)

That's my dog, zip!



Brad Clements,[EMAIL PROTECTED]   (315)268-1000
http://www.murkworks.com  (315)268-9812 Fax
netmeeting: ils://ils.murkworks.com   AOL-IM: BKClements


___
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 )



Re: [Zope-dev] Adding gzip compression to HTTPResponse.py

2002-02-06 Thread Brad Clements

On 6 Feb 2002 at 10:40, Toby Dickenson wrote:

 
 I think you also need to check the accept-encoding header, to allow
 for clients that do not know how to gunzip. That also means you should set
 caching headers to prevent the compressed and uncompressed responses
 getting delivered to the wrong clients by a cache.

Right, but I couldn't figure out how to see the request headers from response.setBody

 
 Also, RESPONSE.setBody really should have access to REQUEST.headers.
 What's the clean way to do that? Just pass the request object to response
 object's init method?
 
 RESPONSE objects have a REQUEST attribute

Are you sure? I know that request objects have a response object. But looking at 
publish.py doesn't look like it goes the other way.


 At the time, this type of auto-compressing proxies looked like they
 were just coming of age (http://rproxy.samba.org looked good at the
 time too). Unfortunately nothing has changed since. Today I think only
 Apache can do this (and has done for ages). Support in squid has stalled
 (http://devel.squid-cache.org/projects.html#te). Although I still think
 this is the way of the future, I suspect the short-term advantage of
 content-encoding the way you implemented it may be an advanatge for longer
 than I originally thought.

I am using Apache with mod_rewrite. Sure, it'd be great to compression there, but 
Apache doesn't cache, you need squid for that, right?

For non-xmlrpc responses I'd want the stuff cached.

I agree, Transfer Encoding is the way to go, but based on remarks at:

http://www.iol.ie/~alank/python/httpcomp.html#encoding

I stuck with the simpler to understand content-encoding.

--

Shouldn't downstream caching proxies ungzip a response if they get a connection from 
a client that doesn't support gzip? Or will they only do this if its Transfer-Encoded?

Brad Clements,[EMAIL PROTECTED]   (315)268-1000
http://www.murkworks.com  (315)268-9812 Fax
netmeeting: ils://ils.murkworks.com   AOL-IM: BKClements


___
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-dev] Adding gzip compression to HTTPResponse.py

2002-02-05 Thread Brad Clements

I'm looking for architectural suggestions for adding gzip compression to 
HTTPResponse for text types.

First, I just wanted to compress xml-rpc output, since I'm returing lots of table data 
as 
XML text (not objects), then loading that text/xml into a DOM for XSLT processing.

I hacked the attached code into HTTPResponse, at the end of setBody. It works for 
xml-rpc responses and I suppose any text output, so long as the response object has a 
header named dogzip set.

I know dogzip is a stupid name, but this is just a testing thing.

Representative compressions:

compress oldlen  150366 new len 11926
compress oldlen  204382 new len 14170
compress oldlen  12746 new len 1364

As you can see, very useful compressions for xml-rpc output.

But for HTML output, what's really needed is I think a special kind of Cache Object. 
One that combines HTTP Caching with Ram caching to keep gzip compressed objects 
in memory.

Some HTML pages are really quite large, and gzip compression can make a noticable 
difference. Just the javascript code sizes themselves are .. really big.

For xml-rpc, obviously every response must be compressed if it's worth it, and I can 
see that having to set a response property on a per request basis is appropriate for 
xml-rpc.

But for text file objects, Page Templates and stuff.. How does setBody work with Ram 
Cache objects? I have some ideas...

Anyone think this is worthwhile?

Also, RESPONSE.setBody really should have access to REQUEST.headers. What's 
the clean way to do that? Just pass the request object to response object's init 
method?

Here's quick gzip compression hack-in, based on code posted by Neil Schemenauer

Thanks Neil.

Added about line 265 in HTTPResponse.py in Zope 2.5 B3

try:
dogzip = self.headers['dogzip']
del self.headers['dogzip']
if dogzip and split(content_type,'/')[0] == 'text':
body = self.body
startlen = len(body)
import zlib, struct
_gzip_header = (\037\213 # magic
\010 # compression method
\000 # flags
\000\000\000\000 # time
\002
\377)
co = zlib.compressobj(6,zlib.DEFLATED,-zlib.MAX_WBITS,
  zlib.DEF_MEM_LEVEL,0)
chunks = [_gzip_header, co.compress(body),
  co.flush(),struct.pack(ll,zlib.crc32(body),startlen)]
z = join(chunks,)
newlen = len(z)
print compress oldlen ,startlen,new len,newlen
if newlen  startlen:
self.body = z
self.setHeader('content-length', newlen)
self.setHeader('content-encoding','gzip')
except:
pass



Brad Clements,[EMAIL PROTECTED]   (315)268-1000
http://www.murkworks.com  (315)268-9812 Fax
netmeeting: ils://ils.murkworks.com   AOL-IM: BKClements


___
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-dev] Exception in XML-RPC handling doesn't rollback?

2002-01-30 Thread Brad Clements

I'm using a thunked_tm da (interbase, gvibDA) on Zope 2.5beta3 RH Linux 7.1

I'm handling an xml-rpc request in a PythonScript. If an exception is raised in the 
script 
after some operations have been performed on the DB, it seems that the xml-rpc 
exception handler does not rollback() pending transactions.

In non-xmlrpc processing this works correctly, that is zodb and database transactions 
are rolled back by the exception handling code.

I've looked at the xmlrpc code in ZPublisher, but can't quite figure out where the 
rollback handling should be in comparison to the regular http publisher.

Can anyone suggest where I start looking so I can verify the behaviour I'm seeing and 
submit a patch?



Brad Clements,[EMAIL PROTECTED]   (315)268-1000
http://www.murkworks.com  (315)268-9812 Fax
netmeeting: ils://ils.murkworks.com   AOL-IM: BKClements


___
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 )



Re: [Zope-dev] Fat client thoughts, was: RE: [Zope] Zope + XML-RPC + native GUI

2002-01-22 Thread Brad Clements

I'm working with IBM's Sash

http://sash.alphaworks.ibm.com/

Unfortunately the client is programmed in Javascript..

--

I'm also doing a lot of DHTML, XML/XSLT browser based stuff on IE. So-called one-
page web applications based on XML-RPC, works nice.



Brad Clements,[EMAIL PROTECTED]   (315)268-1000
http://www.murkworks.com  (315)268-9812 Fax
netmeeting: ils://ils.murkworks.com   AOL-IM: BKClements


___
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-dev] xmlrpc and PyXML, FYI

2001-12-27 Thread Brad Clements

Had some trouble getting strings to unpack because the xml-rpc client I'm using from 
IE 
5 wraps strings in CDATA.

Anyway, I installed PyXML 0.7 and changed Zope's xmlrpclib to use 

from _xmlplus.parsers import sgmlop

and that solved the CDATA problem, plus it's faster.

This is with Zope 2.5B3

Should Zope include PyXML components?


Brad Clements,[EMAIL PROTECTED]   (315)268-1000
http://www.murkworks.com  (315)268-9812 Fax
netmeeting: ils://ils.murkworks.com   AOL-IM: BKClements


___
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-dev] DA connection pooling thoughts

2001-12-12 Thread Brad Clements

Sorry if this is FAQ..

I've been reading the petrilli's DA how-to, and thinking about Thunked_TM.

For Interbase, I'm thinking of trying a DB connection pool that threads can checkout.

That is, each DB connection is serialized to be used by one thread only, but there can 
be multiple DB connections in a Zope process. We'd maintain a pool of connections 
from 1 to n.. and each thread making a DA request checks out a DB connection from 
the pool (if available) and uses it..

I'm trying to figure out of Zope already does this, that is, has one DB connection per 
thread if I took out Thunked_TM from the DB itself.

Or is it that there are multiple DA's, and the DA uses on internal DB for all the DA's 
?

If Zope will re-entrantly call a DA and it's corresponding DB without Thunked_TM in-
place, then having a connection pool (up to one for each thread) might be worthwhile.. 
I 
remember seeing something on the list about per-thread state information being 
available somewhere.. an oid jar or something?

Anyone have pointers?

Thanks


Brad Clements,[EMAIL PROTECTED]   (315)268-1000
http://www.murkworks.com  (315)268-9812 Fax
netmeeting: ils://ils.murkworks.com   AOL-IM: BKClements


___
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 )



Re: [Zope-dev] more than one user: zope 'hangs'

2001-12-11 Thread Brad Clements

On 11 Dec 2001 at 15:30, Stephan Herschel wrote:

 We have got a funny problem in Zope: if user A issues a long-running
 query user B also has to wait in the meantime - zope just waits for A's
 query to finish.

Bob's original design made gvibDA use ThunkedTM

So I believe it is serialized.

I think the reason for using Thunked was because under Windows, gds is not truly 
multi-threaded and dies.

I do not recall exactly what the story is.. You're welcome to try it without the 
Thunked 
Mixin.


Brad Clements,[EMAIL PROTECTED]   (315)268-1000
http://www.murkworks.com  (315)268-9812 Fax
netmeeting: ils://ils.murkworks.com   AOL-IM: BKClements


___
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-dev] reduce() doesn't work in Python Scripts

2001-12-06 Thread Brad Clements

In Zope 2.4.3 binary on Linux

import operator

reduce(operator.add,[0,1,2,3,4])

gives me Error Value: global name 'reduce' is not defined

Is this a faq?


Brad Clements,[EMAIL PROTECTED]   (315)268-1000
http://www.murkworks.com  (315)268-9812 Fax
netmeeting: ils://ils.murkworks.com   AOL-IM: BKClements


___
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 )



Re: [Zope-dev] reduce() doesn't work in Python Scripts

2001-12-06 Thread Brad Clements

On 6 Dec 2001 at 16:12, Romain Slootmaekers wrote:

  reduce(operator.add,[0,1,2,3,4])
  
 try _.reduce()

This is in a Python Script, I'm not using the DTML namespace.

Note that map() and filter() work without a problem, so why not reduce() ?

 this shkould be clear enough as a message.
 zope can't find the reduce function.

right, but it can find the other built-in functions okay.


Brad Clements,[EMAIL PROTECTED]   (315)268-1000
http://www.murkworks.com  (315)268-9812 Fax
netmeeting: ils://ils.murkworks.com   AOL-IM: BKClements


___
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 )



Re: [Zope-dev] reduce() doesn't work in Python Scripts

2001-12-06 Thread Brad Clements

On 6 Dec 2001 at 16:57, Romain Slootmaekers wrote:

 
 In retrospect, I should have posted only 1 message instead of 3 :)
 

And I should have submitted a patch to the collector instead of posting here. :-(

Just not sure what is the right way to do this, here's my first pass:


def guarded_reduce(f,seq,**kw):
skip_unauthorized = kw.get('skip_unauthorized')
v = getSecurityManager().validate
safelist = []
if kw.has_key('init'):
i = kw['init']
if v(accessed=kw,name='init',value=i):
safelist.append(i)
elif not skip_unauthorized:
raise Unauthorized, 'unauthorized access to init'
for el in seq:
if v(seq, seq, None, el):
safelist.append(el)
elif not skip_unauthorized:
raise Unauthorized, 'unauthorized access to element'

return reduce(f,safelist)

Brad Clements,[EMAIL PROTECTED]   (315)268-1000
http://www.murkworks.com  (315)268-9812 Fax
netmeeting: ils://ils.murkworks.com   AOL-IM: BKClements


___
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 )



Re: [Zope-dev] zope-web community (was (SHOUT) NOTIFICATION!!!!)

2001-11-30 Thread Brad Clements

On 30 Nov 2001 at 12:54, Andrew Kuchling wrote:

 On Fri, Nov 30, 2001 at 05:57:17PM +, seb bacon wrote:
 What we need, as Paul suggested about zope-web, is a set of community
 members who are able and willing to contribute 10 hours per week.  I think
 there are very few such people.  I would love to, but I simply
 
 I'd think the number of such people is zero, except for people who use Zope
 in their work and can justify time spent developing on Zope itself as being
 work-related.  

Raises hand.

I use Zope everyday for development for various customers. When I hit a snag in Zope, 
I have to convince the customer to pay me to fix the problem. Usually, I get asked 
can 
you work around that? What if we eliminated feature xyz?  or How long will that 
take?

This is never pleasant. (still thinking about collector item 47  :-(

I suppose I could do Zope stuff off-the-clock on personal time, but that's impossible 
with 
two small kids at home, plus doing college studies.. I'm supposed to be building an 
airplane too, but the darn kit has sat in the basement for a year, nothing done. 

 Re: bug tracking.  If Bugzilla is too much of a bear to deal with,
 there are simpler alternatives available, such as Roundup, Jitterbug,
 the SF bug tracker, and our unreleased SPLAT!.

SPLAT, sounds interesting, like to see how that stacks up to roundup..


Brad Clements,[EMAIL PROTECTED]   (315)268-1000
http://www.murkworks.com  (315)268-9812 Fax
netmeeting: ils://ils.murkworks.com   AOL-IM: BKClements


___
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-dev] User folders, access rights, security, collector item 47

2001-11-29 Thread Brad Clements

Sorry to post here.

I posted last week on the zope list about what appears to be a new/strange security 
related problem in 2.4.3

I thought it was a problem in LdapUserFolder, but jens spent more time debugging than 
I did and he feels it's somewhere in the Zope security machinery.

http://collector.zope.org/Zope/47

Is it security related when security doesn't do what you want (though nothing has been 
exposed, rather, what we want exposed isn't)?

I'd try to tackle this myself, but I really have no idea where to start. I know 
everyone is 
busy, but I was wondering if anyone else has been able to reproduce the condition so 
that we can say for certain if its a bug, or a mis-configuration.

Thanks,


Brad Clements,[EMAIL PROTECTED]   (315)268-1000
http://www.murkworks.com  (315)268-9812 Fax
netmeeting: ils://ils.murkworks.com   AOL-IM: BKClements


___
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 )



RE: [Zope-dev] SOAP again (or, xml-rpc client for MSIE)

2001-06-05 Thread Brad Clements

I have an IE 5.5 one-page web application that manages related database tables 
exposed as ADO recordsets from a Zope/Interbase/Linux server.

I would like to use either the webservices behavior in IE5 or find an XML-RPC client 
component for IE 5.5 so I can make RPC calls into Zope in a standard, controlled 
manner without hand-coding all my calls into HTTP object PUT methods.

I'd like to send structured types (or dicts), and get back a structured response, 
errors as 
exceptions (or not).. I want to avoid re-implementing this stuff.

SOAP, WSDL and UDDI are coming in a big way. I think Zope/Python can compete 
against MS .Net Services on the server side, but it does make sense to use .Net 
components on the client, such as the webService behavior for IE.



On 5 Jun 2001, at 9:41, Adrian Hungate wrote:

 What are you actually trying to achive?
 
 Adrian...
 
 
 Phil Harris wrote:
  
  Brad,
  
  There are a few COM/COM+ components around that do xml-rpc.
  
  I use them with MS Word to write Word files directly to Zope for instance.
  
  Some are better than others, but ymmv so I'll hesitate to recommend one.
  
  At least one of them is listed on xmlrpc.com.
  
  Having them you could script them via jscript, and basically open up the
  connection easily.
 


Brad Clements,[EMAIL PROTECTED]   (315)268-1000
http://www.murkworks.com  (315)268-9812 Fax
netmeeting: ils://ils.murkworks.com   AOL-IM: BKClements


___
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-dev] SOAP again (or, xml-rpc client for MSIE)

2001-05-30 Thread Brad Clements

Hate to bring this up again.

1999 Press release from DC

http://www.prnewswire.com/cgi-bin/stories.pl?ACCT=104STORY=/www/story/12-02-1999/0001087563


 An early 2000 Zope
 release will include support for two protocols heavily supported by Microsoft,
 the Simple Object Access Protocol (SOAP) and Web Distributed Authoring and
 Versioning (WebDAV) protocol

We have WebDav.. How's SOAP look?

I'm looking for a decent RPC mechanism for MSIE 5.5 to talk to Zope. MS has their 
webService behavior that supports SOAP. But without SDL or WSDL in Zope it's gonna 
take a lot of code to get working.

Otherwise, I could use an XML-RPC client for IE5.5, but I can't find one!



Brad Clements,[EMAIL PROTECTED]   (315)268-1000
http://www.murkworks.com  (315)268-9812 Fax
netmeeting: ils://ils.murkworks.com   AOL-IM: BKClements


___
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-dev] TAL/ZPT expand-macros on when FTP get?

2001-05-18 Thread Brad Clements

One thing I'd like to see in METAL/TAL is to have it always expand macros when an 
FTP get is performed.

I'm using HTML-KIT now to do almost all of my Zope work, and it's wonderful (too bad 
its only FTP based, not WebDav). Anyway, if the macros where always expanded I'd be 
thrilled.

Just a wish for the next release



Brad Clements,[EMAIL PROTECTED]   (315)268-1000
http://www.murkworks.com  (315)268-9812 Fax
netmeeting: ils://ils.murkworks.com   AOL-IM: BKClements

___
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 )



Re: [Zope-dev] Professional Sites Using Zope??

2001-05-16 Thread Brad Clements

On 16 May 2001, at 12:15, Jawad wrote:

 I am also interested to know Is there any professionally developed sites in
 Zope/Python. Please let me know the URL.

What does professionally developed mean?

http://www.adirondackcraft.com - Zope and Interbase

I have another site I can't tell you the URL for, its for an importer-exporter 
handling 600 
packages per day (shipping, tracking, customs, etc) His customers (100 or so) and 
their 
staff (200 or so) login to track packages every day.

It's based on Zope 2.2 (argh) and Interbase on Linux.

No problems.


Brad Clements,[EMAIL PROTECTED]   (315)268-1000
http://www.murkworks.com  (315)268-9812 Fax
netmeeting: ils://ils.murkworks.com   AOL-IM: BKClements

___
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 )



Re: [Zope-dev] Professional Sites Using Zope??

2001-05-16 Thread Brad Clements

On 16 May 2001, at 15:21, Jason Cunliffe wrote:

 
 Can't tell as in don't know or not permitted?

Pointless to tell because its password protected. There's nothing to see here, move 
along folks.

Btw, this site is also serving up a one-page-web-app for IE 5.5 that heavily uses ADO 
and XML to generate a shipping interface. It's a work in progress but I'm really 
beginning to like XML and XSLT.

 ..lots of other 'professional' Zope sites to consider, for example at a
 random what do you call these two

yes, but what the heck does professional mean?


Brad Clements,[EMAIL PROTECTED]   (315)268-1000
http://www.murkworks.com  (315)268-9812 Fax
netmeeting: ils://ils.murkworks.com   AOL-IM: BKClements

___
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-dev] Plugable brains changed in 2.3x vs 2.2?

2001-04-23 Thread Brad Clements

I've been using zope 2.2.2 with a plugable brain that does something like this:


class Mybrain:
   def __init__(self):
   self.__dict['myvar'] = 'xyzzy'



I just moved to the latest 2.3 beta and get an error that __dict__ doesn't exist.

Anyone have a quick pointer for a fix, I have 60 minutes to make this work.

thanks


Brad Clements,[EMAIL PROTECTED]   (315)268-1000
http://www.murkworks.com  (315)268-9812 Fax
netmeeting: ils://ils.murkworks.com   AOL-IM: BKClements

___
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 )



Re: [Zope-dev] Plugable brains changed in 2.3x vs 2.2?

2001-04-23 Thread Brad Clements

On 23 Apr 2001, at 14:45, Brad Clements wrote:

 I've been using zope 2.2.2 with a plugable brain that does something like
 this:
 
 
 class Mybrain:
def __init__(self):
self.__dict['myvar'] = 'xyzzy'


Uh, sorry, this should probably not be on zope-dev.

anyway the answer is

self.aq_parent.__dict__['myvar'] = 'xyzzy'

I'm using the pluggable brain approach so I can get first-myvar in dtml-in



Brad Clements,[EMAIL PROTECTED]   (315)268-1000
http://www.murkworks.com  (315)268-9812 Fax
netmeeting: ils://ils.murkworks.com   AOL-IM: BKClements

___
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 )



Re: [Zope-dev] The field converters (:int, :text, etc.)

2001-02-05 Thread Brad Clements

On 4 Feb 2001, at 15:59, Morten W. Petersen wrote:

 IIRC, there was some talk about modularizing the field
 converters (checkers) so that they could be easiliy modified
 and added to.  Is there currently any efforts to solving
 this problem?  If not, there's definently a need for it,
 IMO..

I agree. Each time I get a Zope update I have to edit Converters.py

What I want is something like :empty_as_none

So a float, int or date field will be passed as None if the fields are blank, 
rather than having the converter raising an exception.

ignore_empty doesn't work, because then the field isn't passed in the 
Record at all. 

I use SQLDict as the backend for all my forms (wow, it's great), so None 
really is needed for every field if its blank. If I have ignore_empty, then that 
field doesn't get updated in the database, so if someone wants to blank 
out a field, they can't do it.



Brad Clements,[EMAIL PROTECTED]   (315)268-1000
http://www.murkworks.com  (315)268-9812 Fax
netmeeting: ils://ils.murkworks.com   AOL-IM: BKClements

___
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 )



Re: [Zope-dev] The field converters (:int, :text, etc.)

2001-02-05 Thread Brad Clements

On 5 Feb 2001, at 9:38, Chris McDonough wrote:


 The last time I had to mess around with it, IE didn't pass along any empty
 form fields at all.  Is this still the case?


Still?

I've never seen the behaviour you describe. My client uses IE exclusively.

What version of IE did you test?



Brad Clements,[EMAIL PROTECTED]   (315)268-1000
http://www.murkworks.com  (315)268-9812 Fax
netmeeting: ils://ils.murkworks.com   AOL-IM: BKClements

___
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 )



Re: [Zope-dev] dtml-in batching

2001-01-23 Thread Brad Clements

On 24 Jan 2001, at 9:43, [EMAIL PROTECTED] wrote:

 Tres Seaver wrote:

  Please post this as a "Bug w/ patch" to the Collector:
  
   http://classic.zope.org:8080/Collector
  
  That way we don't lose your fix in the list traffic (losing it
  along with our marbles is another problem :)
 
Someone else responded to the list saying that he'd already done it.
 There was no match to my search of dtml-in though, so I've submitted a new
 bug report.


I posted this same bug AND a patch as bug # 1566 on Aug 28th, 2000.


http://classic.zope.org:8080/Collector/1566/view

Sad to see its *still* pending



Brad Clements,[EMAIL PROTECTED]   (315)268-1000
http://www.murkworks.com  (315)268-9812 Fax
netmeeting: ils://ils.murkworks.com   AOL-IM: BKClements

___
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 )




Re: [Zope-dev] dtml-in batching

2001-01-23 Thread Brad Clements

On 24 Jan 2001, at 11:15, [EMAIL PROTECTED] wrote:


 Brad Clements wrote:

  I posted this same bug AND a patch as bug # 1566 on Aug 28th, 2000.
  
  http://classic.zope.org:8080/Collector/1566/view
  
  Sad to see its *still* pending
 
 Well that's odd - I searched the collector for "dtml-in" and got no
 matches. A search for "renderwb" (which is in the title) works. Looks like
 it doesn't search the description after all. Boo to the search engine.
 
 Just curious: why specify the browser/platform/python version stuff when
 the problem is independant of those things?
 

Because I'm Anal Retentive.

Also figured perhaps my entry would be ignored without that information.

Or worse the form would be rejected on submit because those fields 
where blank AND it wouldn't remember what I'd put in AND back would 
fail.

So, I filled out the form entirely.


Brad Clements,[EMAIL PROTECTED]   (315)268-1000
http://www.murkworks.com  (315)268-9812 Fax
netmeeting: ils://ils.murkworks.com   AOL-IM: BKClements

___
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-dev] Converters.py field2date() and :ignore_empty

2000-12-12 Thread Brad Clements

If I have ignore_empty set in a variable name of type date, field2date() 
fails if the returned value is truly empty.

I think field2date() should return None rather than trying to call DateTime 
with an empty string.

I keep making this patch to each Zope release, but would like to talk 
about a more permanant and "correct" solution. What do others think?



Brad Clements,[EMAIL PROTECTED]   (315)268-1000
http://www.murkworks.com  (315)268-9812 Fax
netmeeting: ils://ils.murkworks.com   AOL-IM: BKClements

___
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-dev] Pending bugs in collector - how do I send this patch?

2000-12-11 Thread Brad Clements

I have found a bug in ZSQL methods that is describe by this collector 
item:

http://classic.zope.org:8080/Collector/718/view

This item was posted over a year ago! The bug is still in the program, so 
I'm guessing that DC folks are too busy to get to this.

The collector item described above describes a weak work-around 
because the submitter didn't understand how this exception can occur.. 
Here's how it happens..

If a query is executed twice, the second time beyond the cache time 
limit. Then the query string is stored in tcache{} twice (two different 
times) but in cache{} only once.

Eventually the cache reaches it's maximum size and entries are expired 
in reverse time order. The earlier tcache{} entry is encountered and the 
query in cache{} is deleted.

Eventually the later query is also deleted from tcache{}, but the query no 
longer exists in cache{} and a KeyError is raised.

Here's the fix I'm applying. I'm only deleting the cache{} entry if it's time 
matches the tcache{} entry that is about to be deleted.

I couldn't figure out how to post a patch for a pending collector item. 
Also didn't want to duplicate the pending bug report either. 

--

lib/python/Shared/DC/DA.py line 392 or so

while keys and (len(keys)  max_cache or keys[-1]  t):
key=keys[-1]
q=tcache[key]
del tcache[key]
if int(cache[q][0]) == key:
del cache[q]
del keys[-1]


My change is:

if int(cache[q][0]) == key:
del cache[q]


Brad Clements,[EMAIL PROTECTED]   (315)268-1000
http://www.murkworks.com  (315)268-9812 Fax
netmeeting: ils://ils.murkworks.com   AOL-IM: BKClements

___
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-dev] Adding execute() to Zope DA's for use by External methods

2000-11-14 Thread Brad Clements

I have Python code that I use outside of Zope, and inside Zope via 
external methods. This code uses database adapters (anything version 
1 or later).

When my code is used within Zope, I have in the past had two database 
connections from within the Zope process. One connection is the actual 
Zope DA (I'm using gvib) and the other is a python db connection.

This has worked okay on Windows, but I'm getting strange lockup 
problems after moving to Linux.

In any case, it seems to me the better way to do this would be to allow 
external methods to get  db-like access to a zope DA.

Most Zope DA's are built in db-sig type db connectors, so it seems like 
a relatively simple matter to define a new interface for Zope DA's to 
make available that supports execute semantics.

The big issue in my mind is determining what kind of security needs to 
be applied to such a function, and how that security would be 
implemented.

I suppose stealing roles/rights from SQL_Methods for use here makes 
sense. If you can call an SQL method, you can call execute() directly.

Is there any support from the Zope community to add execute() like 
operations to Zope DA's?

If yes, where should I start in figuring out security for this.

And finally, how does an external method pass security information 
"back" to the DA?

For example, I tried passing my Gvib instance to an external method. 
But when that method called  the gvib instance to get a connection 
instance, it got a "no __call__ method" error.

So then I tried passing the connection from dtml,
ie
dtml-var "MyMethod(db=MyInterbaseConnection())"

but when MyMethod calls db.cursor() it gets a security error. Probably 
because this function isn't exposed by the security machinery.

(same thing probably for the __call__ error)


Brad Clements,[EMAIL PROTECTED]   (315)268-1000
http://www.murkworks.com  (315)268-9812 Fax
netmeeting: ils://ils.murkworks.com   AOL-IM: BKClements

___
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 )




Re: [Zope-dev] Wrox Book

2000-10-13 Thread Brad Clements

On 13 Oct 2000, at 15:59, Chris Withers wrote:

 Josh Zeidner wrote:
  
WROX contacted me a while back saying they wanted to do a Zope book as
  well.  Does anyone know anything about this?
  
-josh
 
 Yeah, that project has just been pulled, I think ;-)

Pulled as in cancelled?

-Brad

p.s.  Anyone see my chapter on Embedding/Extending Python in the 
Wrox Professional Linux Programming book? looking for feedback 
(kudos, hatemail, etc)




Brad Clements,[EMAIL PROTECTED]   (315)268-1000
http://www.murkworks.com  (315)268-9812 Fax
netmeeting: ils://ils.murkworks.com   AOL-IM: BKClements

___
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 )




Re: [Zope-dev] Converters.field2date, allow empty string to return None?

2000-09-04 Thread Brad Clements

On 3 Sep 2000, at 13:33, Dieter Maurer wrote:


 One solution would be to use a valid (special) date as default
 value and test against it in the body.
 

I don't like this "solution" because the end-user has  to know what the 
special date is, it looks ugly on the form and it still does *not* fix the 
problem of using the test function in an SQL Method.




Brad Clements,[EMAIL PROTECTED]   (315)268-1000
http://www.murkworks.com  (315)268-9812 Fax
netmeeting: ils://ils.murkworks.com   AOL-IM: BKClements

___
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-dev] Converters.field2date, allow empty string to return None?

2000-09-01 Thread Brad Clements

One thing that has been bothering me is that I can't easily test my 
ZSQL Methods if they accept a date type unless I completely fill all the 
date arg types.

For example, if the sqlmethod has argument type 
  startdate:date=''


and in the body I have
 dtml-if startdate ...

When i use the test form, I can't leave the date field empty, otherwise I 
get a conversion error from Converters.field2date()

I also have this problem with any form that has type date, if the end-user 
doesn't put a date in the form, I get a conversion error.

Its okay with me to receive an empty string, which gets converted to 
None .. I just put NULL in the sql database.

So .. what's the correct fix to allow empty fields to return either '' or 
None from field2date?

I can alter Converters.py...

I see that converters required: exists, but does that imply that all other 
converters allow an empty string to return None? Or do we need to add 
an explicit "optional" type?

Either way, I'd like to fix this, but what's the best way?


Brad Clements,[EMAIL PROTECTED]   (315)268-1000
http://www.murkworks.com  (315)268-9812 Fax
netmeeting: ils://ils.murkworks.com   AOL-IM: BKClements

___
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-dev] Bug in DT_In.py, still using collector? Here's a patch

2000-08-08 Thread Brad Clements

In Zope 2.2.0 

If you have a bug in your DTML in a dtml-in xx next block, you don't 
see the bug. DT_In assumes that you just don't have more records to 
see.

DT_In.py, around line 545

This code:

elif next:
try:
# The following line is a sneaky way to test whether
# there are more items, without actually
# computing a length:
sequence[end]
pstart,pend,psize=opt(end+1-overlap,0,
  sz,orphan,sequence)
kw['next-sequence']=1
kw['next-sequence-start-index']=pstart-1
kw['next-sequence-end-index']=pend-1
kw['next-sequence-size']=pend+1-pstart
result=render(section,md)
except:
if self.elses: result=render(self.elses, md)
else: result=''

SHOULD BE:

elif next:
try:
# The following line is a sneaky way to test whether
# there are more items, without actually
# computing a length:
sequence[end]
pstart,pend,psize=opt(end+1-overlap,0,
  sz,orphan,sequence)
kw['next-sequence']=1
kw['next-sequence-start-index']=pstart-1
kw['next-sequence-end-index']=pend-1
kw['next-sequence-size']=pend+1-pstart
except:
if self.elses: result=render(self.elses, md)
else: result=''
else:
result=render(section,md)


Brad Clements,[EMAIL PROTECTED]   (315)268-1000
http://www.murkworks.com  (315)268-9812 Fax
netmeeting: ils://ils.murkworks.com   AOL-IM: BKClements

___
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 )