[Zope-dev] Custom dtml tag ... parameters not evaluated

2001-04-12 Thread Romain Slootmaekers

Yo,
I'm trying to create a custom dtml tag, and after the How-to on this
(http://www.zope.org/Members/z113/1) that in itself posed no problem: easy
as pie. The problem I'm having with the tag is that parameters are not
evaluated. for instance (my tag's name is 'aa')

dtml-let y="someValue"
dmlt-aa role="y" ... /dtml-aa 
/dtml-let


gives me in the code:  role=="y" 
while I want it to be "someValue", playing with the quotes
doesn't help either. I think that, in the python code I need to do some
extra call to some routine that do the evaluation/substitution... but I
don't know which.

Anyway, I uncluded a code thingy below, (basically the code  from
the How-to)

Can anyone help me on this ?

TIA,

Sloot.

 code thingy  20 lines ---
from DocumentTemplate.DT_Util import *
from DocumentTemplate.DT_String import String

TAGNAME = 'aa'

class AATag:
name = TAGNAME
blockContinuations = ()
def __init__(self, blocks):
tagname, args, section = blocks[0]
args = parse_params(args,
role="dont-know",
property=None,
id="no-id-given")
self.args, self.section = args, section

def render(self, md):
# some code here...


__call__ = render

String.commands[TAGNAME] = AATag





___
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] Call me stupid (login form Howto other Q)

2001-04-20 Thread Romain Slootmaekers

Yo,
you can call me stupid but I can't get this working:
I have a logon form with user  passwd,
but what do have to do after the user has submitted this?

Do I have to create a new BasicUser and assign that to AUTHENTICATED_USER
or what ?

Normally I'd just create a Folder that requires some privileges, but this
is not possible here (for other reasons)

And something completely different:
to be able to see the inside of a ZClass, I added an external method 
that just returns self.__dict__ . Is this the right approach, or is there
something more direct ?


TIA,

Sloot.


___
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] ZStyleSheets

2001-04-27 Thread Romain Slootmaekers

Yo,
when trying to use the ZStyleSheets, we only found a zip, but no tarball.
After unzipping, it didn't work because appearantly the zip was made for
some OS that has a  case-insensitive file-system.
after renaming the files (zstylesheet* - ZStyleSheets* aso) everything
behaved as expected.

It's a cool product though.
 
you guys be warned.

have fun,

Sloot



___
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] installing 2.4.0b3 from source confusion

2001-07-07 Thread Romain Slootmaekers

Yo,
dudes,
I downloaded the 2.4.0b3 tarball and in the README it states:
'''Important
 
  This release requires Python 1.5.2.

'''

clear enough, but the doc/INSTALL.txt states:

'''
Important notes
 
   ZOPE 2.4 REQUIRES PYTHON 2.1!
 
   See CHANGES.txt for important notes on Zope 2.4.
'''

This simple person is somewhat confused

so what do I acutally need to build it, and to run it.

TIA,

Sloot.


___
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] Zope 2.4.1 bugfix in RestrictedPython/__init__.py

2001-09-14 Thread Romain Slootmaekers

Yo dudes,
VSEval in Documenttemplate tries to set Eval
No problem but RestictedPython has no Eval attribute by default
so you need to import it

add this line to RestrictedPython/__init__.py

import Eval


can someone add this to the source tree ?

Tia  have fun,
Sloot.





___
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] Any interest in a set of Zope products to supportCVS-versioned, XML/XSLT-based Zope development?

2001-10-31 Thread Romain Slootmaekers



 In our opinion, Zope
 is about a year or two ahead of where these guys are in many respects. 
  Kudos!

When I asked the tomcat mailing list for Zope like functionality in tomcat
(some year ago) nobody even answered. The product probably wasn't known or
nobody saw the possibilities. I still think cocoon rocks, and 
session managament in Tomcat is way better than in Zope. The problem is
that Tomcat demands more skills from the webbies. and Zope allows easy
maintainance of 'live' sites, on site. Anyway,
 
 
 The main problems we faced while moving to Zope were these:
 
 - how to support version control, branching, merging, tagging, etc. 
 etc.  (we use CVS)
 - how to support our XML/XSLT-pipeline based document publishing 
 paradigm (cf Cocoon2)
Having moved ZZICT towards zope from jsp. we faced the same XSL/XSLT
problems. I often wondered: how come they have xml-rpc but not XSLT?


snipped
 XMLDocument:
 (Sorry for the name clash).  Inherits from CVSFile.Has a notion 
 of a transformer property that points to an XSLT transformer.
 This enables it to be rendered automatically into HTML when __call__ or 
 index_html is called.The underlying XML file
 can either be external or not.  The XMLDocument object represents the 
 entire file, as opposed to the parsedXML stuff that explodes
 a single document into multiple Zope objects for each XML node (correct 
 me if I am wrong...)

We developed more or less the same thingy: a ZZXML product which is an XML
file which upon rendering can be transformed by any number of XSLTs. the
way the XML and XSL are linked is that of the XSLT spec: 

?xml version = 1.0?
?xml-stylesheet href=xsl type=text/xml?
...

I personally hacked in into a Zope 2.4 with the python xml.xslt and
xml.dom.ext packages and some 200 lines of glue code.

The problems with the thingy are:
- xml authoring :the xml documents are only editable as text
- xslt is not context sensitive. fi I'd like to be able to apply different
  style sheets for (fe) different authorization roles
- for some reason the webbies don't really like an XML/XSLT pipeline,
  because it is rather difficult to get the separation of concerns right.
  (fe content:XML only, first style sheet: structure of page second style
   sheet: markup elements , third style sheet: browser specifics aso)
  Web publishing still remains rather hard. 

 There is lots more to do, but we do have initial development versions of 
 all three working in the lab.   Is there interest in this kind
 of Product?   Would it be considered heretical? ;-)   Are others working 
 on the same thing?
In short: yes, donno, yes.

Romain.


___
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 Romain Slootmaekers



On Thu, 6 Dec 2001, Brad Clements wrote:

 In Zope 2.4.3 binary on Linux
 
 import operator
 
 reduce(operator.add,[0,1,2,3,4])
 
try _.reduce()


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

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


 
 Is this a faq?

probably.

have fun,

Sloot.


___
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] ZGDChart-0.6.2.babel restarts my Zope

2001-12-06 Thread Romain Slootmaekers

Yo,
I installed ZGDChart and was playing around with it. cool stuff...

But I came across this problem:

at first, everything worked fine, but know, whenever I try to view a 
chart, my zope server restarts. no messages what so ever.

I tried the test.py that came with ZGDChart , and that seems to work fine.

I don't have a clue on how to tackle this problem except for adding

print 'cucu' 

lines all over the ZGDChart code :(

I have a 2.4.0b3 built from source and a 2.1 python (if this might help)


Anyone any ideas ??

TIA,

Sloot.


___
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 Romain Slootmaekers



On Thu, 6 Dec 2001, Brad Clements wrote:

 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.
 

try in your script:
print filter
return printed

and after that works function guarded_filter at ...

try :
print reduce
return printed

someone probably just forgot to implement the guarded_reduce method




___
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 Romain Slootmaekers



indeed. in 
lib/python/AccessControl/ZopeGuards.py

the guarded_reduce isn't there

those who are are:
['cmp', 'round', 'AttributeError', 'random', 'str', 'range',
'ArithmeticError', 'whrandom', 'unichr', 'list', 'FloatingPointError',
'getattr', 'hasattr', 'setattr', 'IndexError', 'TypeError', 'delattr',
'AssertionError', 'divmod', 'ord', 'ZeroDivisionError', '__import__',
'callable', 'len', 'repr', 'max', 'tuple', 'StandardError', 'string',
'hash', 'isinstance', 'Exception', 'map', 'math', 'oct', 'OverflowError',
'IOError', 'test', 'filter', 'abs', 'chr', 'NameError', 'long', 'hex',
'complex', 'EOFError', 'min', 'reorder', 'OSError', 'same_type',
'RuntimeError', 'LookupError', 'apply', 'EnvironmentError', 'unicode',
'ValueError', 'issubclass', 'ImportError', 'None', 'KeyError', 'float',
'SyntaxError', 'pow', 'int', 'sequence', 'DateTime']

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

Sloot.


___
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] CMF attribute horror or too many [t|T]itles

2002-01-14 Thread Romain Slootmaekers

Yo dudes,
just a stupid simple question:
After wrestling with the documentation, I have created my own CMF content
type and it actually works except for some details. In retrospect, it was
90% code browsing, and 10% useful
documentation,... cmf is fun, but the cmf dogbowl really sucks ..

Anyway,
The type I created has a method 
def Title(self,REQUEST=None):
  ...

and that gets used by some of the skins,
The meta data of the object also has an attribute Title, which is used by
the Topics for indexing, 

Now my problem: when a topic lists one of my objects, it lists them with

 ...
 li a href=dtml-objURL;dtml-var Title./a /li
 ...

but neither my Title() method nor the Meta-data's Title attribute gets
to be used. I get an empty string.
Where does that one come from ?


To make it even more confusing, the object also acquires a title attribute
from somewhere higher up the acquisition tree. 



PS:
I noticed the same problem when adding fi a File object through the zope
management api instead of the portal management interface. 
  

Anyone any clues ?

TIA,

Sloot.


___
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] persistent threads ?

2002-01-29 Thread Romain Slootmaekers


Yo,
We have some computational expensive task that we execute as a result
of some HTTPRequest. So we spawn a thread and return immediately.

Future requests can get the status and thus we can monitor progress at the
client side. So far so good.

But what should we do when the server restarts before the task finishes ?

Onfortunately, pickling the thread and restarting it is not an option
(Threads are not picklable (pickleable, pickable ??? ah well what's in a
name)  :( )

So what are our options here ?

Should we turn to Stackless python as a vm or what ?


TIA,


Sloot


___
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] Dependency problem with SimpleItem

2002-02-06 Thread Romain Slootmaekers

Yo dudes,
I have problems with dependencies on Zope 2.4.3:

If I try to import OFS.SimpleItem directly, I get following problem.

 from OFS import SimpleItem
Traceback (most recent call last):
  File stdin, line 1, in ?
  File D:\ZopeDevel\lib\python\OFS\SimpleItem.py, line 95, in ?
import re, sys, Globals, App.Management, Acquisition, App.Undo
  File D:\ZopeDevel\lib\python\Globals.py, line 90, in ?
import Acquisition, ComputedAttribute, App.PersistentExtra, os
  File D:\ZopeDevel\lib\python\App\PersistentExtra.py, line 87, in ?
from Persistence import Persistent
ImportError: cannot import name Persistent




If you do 'import Zope' first, you don't have this problem.

But I can't do that because I use my SimpleItem in a process other than
the zope server. and then I get problems with the lock on the Zope
database. I just want to construct a SimpleItem, and store it somewhere
else than the database that the zope server uses 



Anyone any ideas on this?

TIA,

Sloot.
 



___
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] FileSystem based products markup.

2002-02-14 Thread Romain Slootmaekers

Yo,

We have a file system based product, and some dtml-methods are defined the
usual way

 myMethod=DTMLFile('myMethod',globals())

We want our webbies to be able to add some eye-candy. But how would they
go about if they want to add some images ?

Remember: THEY ARE WEBBIES, so it has to be really easy and simple and
changeable, so no 
  
  myImage=ImageFile(..)

  solutions are possible.


Ideas appreciated
Sloot.


___
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] improved logging

2002-02-28 Thread Romain Slootmaekers


Yo,
questions wrt logging:

-) What are the plans to improve the rather primitive logging facilities
in zope ?
I couldn't find anything in the plan for 2.6, nor on the 3.0 homepage.
I think we need at least an extendibl framework with following types of
components:

- Loggers (fi, file logger, db loggers, remote logger, nulllogger,...)
- Filters (fi on severity, on subsystem, ...)
- LogBus (central accesspoint for the logging framework,
  where you can (dynamically) hook your loggers, filters etc...

if time is an issue, we could just copy the design of fi Log4J which is a
good logging framework for apache.
 
-) If there are no such plans, can we hack something up ourselves and
add/donate it to the product ? I hate writing stuff that gets replaced by
something else afterwards 

input appreciated.

Sloot.
 







___
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] ZODB thread safety issue.

2002-03-10 Thread Romain Slootmaekers

Yo,
I read on the doc's :

A key feature of Zope 2 (ZODB 3) is that (a copy of) a persistent object
is never accessed by more than one thread (unless the programmer goes way
out of thier way). Each thread uses it's own database connection(s). Each
connection has it's own copies of persistent objects. This feature
provides a major simplification for application developers.


This explains the problems we have with our system:
we have a multithreaded system where each thread iteratese over a set of
objects in the ZODB, and sees of something needs to be done... if so the
thread does it. Now since each thread gets its own version of the object.
our actions occur multiple times... 


This is not the desired behaviour.
Is there a way we can share the access to the objects, or do we have to
create a global lock ? And if we have to create a global lock, what's the
desired/standard approach in doing so.

TIA,

Sloot.





___
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: ZMI / JavaScript brainstorm

2002-04-08 Thread Romain Slootmaekers



On Mon, 8 Apr 2002, Charles Y. Choi wrote:

 
 IMHO, much of what makes the ZMI difficult to use is due to limitations 
 of the
 textarea widget in a web browser (no syntax highlighting, no indentation 
 support,
 etc.)  
 
 So what if there was a way to get JavaScript to take the contents of a 
 textarea
 widget, save that to a temporary file and then call a local editor of 
 the user's
 choice to edit that file.  Upon exit of the local editor, the contents 
 of the file
 are then put back in the textarea widget.  How would the use model work?
 Hook into the right mouse button menu over the textarea widget an entry
 called Edit Contents with Local Editor.

check out http://www.mijnkopthee.nl/pivot/screenshots.html

but call me stupid isn't emacs an easier solution ?




___
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] how bad are per-request-write-transactions

2002-04-22 Thread Romain Slootmaekers


Yo,

I have been following this thread for quite some time now,
and call me stupid if you must, but why don't you just keep 
the data in the session and write it all out when the session
gets cleaned up?

For the original problem (keeping statistics of site usage)
this will be more than enough. 

I did a webmining project using this in 2000 
(ok, it was jsp and not zope, but the approach is still valid, moreover
since from 2.5? onwards, you have a built in SESSION object you can use) 
 
have fun,

Sloot. 



___
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 components and revision control with cvs

2002-08-01 Thread Romain Slootmaekers

Gary Poster wrote:
 On Thu, 2002-08-01 at 15:04, Shane Hathaway wrote:
 
 
There are a few products on zope.org for integrating with CVS.  Look 
through the downloadable products.  I think there are CVSFolder and 
ZCVSFile (or something like that), maybe more.

However, most version control tools are difficult to integrate into 
applications in a platform-neutral way.  To integrate with CVS, for 
example, Zope spawns a CVS client, but the CVS client runs with the 
privileges of the Zope process rather than the user's privileges.  It 
works but it's not very clean.

Subversion, however, gives us a new opportunity.  The first alpha has 
been released.  Communicating with a Subversion repository involves 
HTTP, WebDAV, and DeltaV--all documented, open standards.  So Zope could 
talk to a Subversion repository in a very transparent, well-integrated 
way.  Anyone out there looking to write a nice, useful product for Zope? 
  A Zope-Subversion adapter would be a great choice. :-)

http://subversion.tigris.org

Shane
 
 
 Hi Shane.  I've been thinking about Zope versioning, and I also did a
 bit of list searches for past discussions on this general topic.  One
 problem that seems pertinent to really any external-to-zope versioning
 system, including Subversion, is dealing with non-folder object
 managers.  If you want to manage the contents of these special object
 managers individually in your versioning system, you're running into
 some trouble, some parts of which seem insurmountable to me at the
 moment (from my admittedly limited knowledge ;-).
 

This is true. the problem is that simple versioning tools don't know the 
meta type of a file that's on the file system.
For example: you have a file MyFile.dtml on the file system.
is the meta-type DTMLMethod or DTMLDocument ? Not even talking about the 
more complex container types here (

The same goes with the FTP access to zope objects. uploading new objects
is a problem... appearantly, you first have to create an empty object of 
the correct type in zope and after that you can upload the content of 
that object.


We at ZZICT too suffer severly from the restriction that versioning
a product that consists of code ass well as ZODB objects is a real
pain, yet from an architetural point of view splitting the product into 
core stuff (functionality) that resides in a filesystem based product 
and presentation layer stuff that resides in the ZODB is a natural way 
to go about.

If you take a poll, I bet this problem bothers a lot of us.

Maybe, you could do it the other way around: add CVS like (hopefully 
better or at least less sucky) functionality to zope.

Sloot.



___
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 Romain Slootmaekers

Mr Tobias Schiebeck wrote:
 Hi,
 
 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. 
 
 I managed to modify the passive_acceptor within the medusa ftp server
 file. The problem I have is that certain FTP clients (e.g. gftp) 
 close there connection because of messages coming from the server.
 
 The code I have modified is in 
 
/usr/lib/zope/ZServer/medusa/ftp_server.py
 
 class passive_acceptor (asyncore.dispatcher):
   ready = None
 
   def __init__ (self, control_channel):
   # connect_fun (conn, addr)
   asyncore.dispatcher.__init__ (self)
   self.control_channel = control_channel
   self.create_socket (socket.AF_INET, socket.SOCK_STREAM)
   to=open('/tmp/zope.log','a')
   for i in range(1,11000): 
   # bind to an address on the interface that the
   # control connection is coming from.
   to.write(ftp connection - port %d\n%i)
   bres = self.bind ((
   self.control_channel.getsockname()[0],
   i
   ))
   to.write(ftp connection - bind:+`bres`+\n)
   if bres == None :
   break
   self.addr = self.getsockname()
   self.listen (1)
   to.close()
 
 Accessing the Zope-server through a firewall that has only the ports
 1 to 11000 open using gftp allows the firs connection but 
 disconnects with an error message when I change the directory.
 
 The error message is:
 
 451 Server Error: socket.error, (98,'Address already in use'): file:
 /usr/lib/zope/ZServer/medusa/asyncore.py line: 250
 
 Do you have any hints on this?
 
 Thanks and Best Regards
 
 Tobias

passive ftp through a firewall ?
you still need to have a whole range of ports opened so what's the 
point. FTP sucks and should be illegal.

you could solve the same problem using sftp (which is more secure but 
moreover,
just uses 1 connection) and a FSDirectoryview.

have fun,

Sloot.





___
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] Coroner's toolkit for zope, or how to figure out what went wrong.

2002-08-12 Thread Romain Slootmaekers

Yo,

we had a nasty crash of our zope server that we use for a b2b web 
application. The Data.fs ZODB lost a significant amount of data.

At this point, we restored the Data.fs from our last backup and the 
server is back up and running. (breathing relieved)

What worries me is that we have no clue whatsoever on what happened,
besides the constatation that somehow, somewhere we lost a whole tree of 
objects.

So does anyone have an object browser of the ZODB or some
tools/procedures on how to find out what went wrong?

I really hope we are not going to lose a lot of sleep because of this.


TIA,

Sloot.


___
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] Follow up: Coroner's toolkit for zope, or how to figureout what went wrong.

2002-08-12 Thread Romain Slootmaekers

Toby Dickenson wrote:
 On Monday 12 Aug 2002 4:50 pm, Joachim Werner wrote:
 
Hi!

I know of exactly two cases that could really cause a ZODB loose data: if
you reach the 2GB limit with a Python not compiled for larger files and if
you reach the physical limit of your storage. That is, if your case doesn't
add a third one ...

well, it isn't the 2GB limit, nor the storage limit,...
BTW, i wish I still had your good faith in software :(

 
 
 FileStorage is robust and mature, but its not a good as this statement 
 suggests.  There have been a number of bugs that cause packing to delete more 
 than it should (a few very small holes still remain), bugs that cause 
 FileStorage to overwrite the middle of its log file, and bugs that cause its 
 position index to get muddled.

ouch. packing couldn't be the problem though (we haven't packed 
recently)

After spending some times looking at the logs. I could dig up the 
following traceback :


   File 
/home/zope/Zope-2.5.1-linux2-x86/lib/python/ZODB/Connection.py, line 46
3, in setstate
 raise ReadConflictError(object=object)

ReadConflictError: database read conflict error (oid bc8d,

our code that causes it basically changes some attributes and then
does a

self._p_changed=1

in some persistent object.


The problem is this:
appearantly that object is also touched in some other thread causing the 
conflict error.

So far I understand what's happening. but then it gets blurry.
the resolution of the conflict handeling somehow drops everything in 
that object tree.

Basically we have

class DB (Persistent,Implicit):
.

def __init__(self):
self.__dbItems=[]

class DBItem(Persistent,Implicit):


def setSomething(self,...):
...
self._p_changed=1




and DB contains a set of DBItem objects, and touching one of them drops 
the DB object.


 
 
 The first thing I would recommend trying today is shutting down, removing 
 data.fs.index, and restarting. In recebnt versions data.fs.index make very 
 heavy use of BTrees, and all released versions of the BTree code have small 
 bugs.

hm, isn't there a policy on adding tests that expose the bugs to the set 
of unittests ?

If we (our company that is)can't resolve the problem, we'll have to 
reconsider our strategy on data storage and perhaps even drop the use of 
the ZODB for anything but scripts and static content. all managed 
content types then have to stored in something more robust like some 
relational database, and we all know how well object trees fit into 
relational databases. :(


Anyway, If we find more, then we'll post it here.
Sloot.






___
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] Coroner's toolkit for zope, or how to figure out whatwent wrong.

2002-08-12 Thread Romain Slootmaekers

Jim Fulton wrote:
 Romain Slootmaekers wrote:
 
 Yo,

 we had a nasty crash of our zope server that we use for a b2b web 
 application. The Data.fs ZODB lost a significant amount of data.
 
 
 What sort of crash? Was this a hardware failure, or a software failure?

software.
basically, the server didn't crash, but our applications couldn't 
function anymore because some objects that really have to exist
were gone.

the Data.fs was NOT corrupted,
  but (so far I can tell) a bug in the conflict resolution code caused 
our object (the one upon we set self._p_changed=1)  to be empty. This 
object is a container of other objects that are Persistent themselves 
and at this point, we don't believe the conflict resolution mechanism 
handles these cases correctly.


 
 At this point, we restored the Data.fs from our last backup and the 
 server is back up and running. (breathing relieved)

 What worries me is that we have no clue whatsoever on what happened,
 besides the constatation that somehow, somewhere we lost a whole tree 
 of objects.
 
 
 Was this in the backup? Or in the damaged data file?

nope. the loss of data occured in the 12 hours after our last backup.
so we only (well, it actually is quite a lot :( ) lost the transactions 
that happened between the backup and the restore/restart.


The stack trace in the follow up mail gives some clue on where the 
problem is situated in the code. (as well as the exact version of the 
Zope installation)

Anyway, Murphy's law is once again proven as this thing happened on the 
first day of my vacation. :|

Sloot.



___
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] Coroner's toolkit for zope, or how to figure out whatwent wrong.

2002-08-12 Thread Romain Slootmaekers

Jim Fulton wrote:
 Romain Slootmaekers wrote:
 
 
 I think you are pretty far off here. You said you saw a read conflict.
 No conflict resolution is done for a read conflict. Further, from the very
 brief description of your DB class, it doesn't appear to use any objects
 that actually try to resolve conflicts. I doubt seriously that this has
 anything to do with conflict resolution. It is very doubtful that a 
 database
 error would cause your data to simply disappear without some sort of error,
 like a database corruption error or an error about invalid object ids 
 (dangling
 references). Have you considered an application error?

yes, that's the first thing one does: doubt your own code.

the object in question is created once, and there is no code to delete 
it since in that application, it is of no use.
The only thing that happens is that we add/moify/delete other object to
that rootnode.



 
 If you still have the data file with the lost data, it should be 
 possible to
 analyze it to figure out what went wrong. In particular, it would be 
 helpful
 to figure out just what transaction made the data go away to figure out 
 what it
 might have been doing.

that was exactly the question I was asking in the first place :
tools to browse the ZODB, to see where it broke.


 It simply causes the transaction with the read conflict to be reexecuted.
 


Ok, I figured that out by now as well. the read conflict error has 
indeed nothing to do with our problem. sorry 'bout that...

But we found something else:

I included a script below that produces a stripped down analogy
of our problem. (no zope needed, just ZODB, and you might wanna modify 
the first line to get it working)

The script produces the following output:


C:\zope\develbin\python.exe \temp\test.py
Foo instance at 008DCAC8 0
Foo instance at 008E1280 0
Traceback (most recent call last):
   File \temp\test.py, line 68, in ?
 get_transaction().commit()
   File C:\zope\devel\lib\python\ZODB\Transaction.py, line 234, in commit
 j.commit(o,self)
   File C:\zope\devel\lib\python\ZODB\Connection.py, line 348, in commit
 s=dbstore(oid,serial,p,version,transaction)
   File C:\zope\devel\lib\python\ZODB\FileStorage.py, line 665, in store
 data=self.tryToResolveConflict(oid, oserial, serial, data)
   File C:\zope\devel\lib\python\ZODB\ConflictResolution.py, line 108, 
in tryTo
ResolveConflict
 resolved=resolve(old, committed, newstate)
   File \temp\test.py, line 30, in _p_resolveConflict
 print savedState['data'].getHello()
AttributeError: PersistentReference instance has no attribute 'getHello'


The question is: is intended ZODB behaviour or not, and is there a work 
around ?

have fun,

Sloot.


swhome=r'C:\zope\devel'
import sys
sys.path.insert(0, '%s/lib/python' % swhome)
sys.path.insert(1, '%s/bin/lib' % swhome)

import ZODB
from Persistence import Persistent

class Dummy(Persistent):

def __init__(self):
self.hello = Hello there...

def getHello(self):
return self.hello

class Foo(Persistent):

def __init__(self):
self.data = Dummy()
self.count = 0

def incCounter(self):
self.count += 1

def getCount(self):
return self.count

def _p_resolveConflict(self, oldState, savedState, newState):
print savedState['data'].getHello()
print newState['data'].getHello()
print oldState['data'].getHello()
diffsaved = savedState['count'] - oldState['count']
diffnew = newState['count'] - oldState['count']
newState['count'] = oldState['count'] + diffsaved + diffnew
return newState


from ZODB import FileStorage, DB

storage = FileStorage.FileStorage('/temp/test.fs')
db = DB( storage )

# Init van test object
conn = db.open()

root = conn.root()
root['foo'] = Foo()
get_transaction().commit()

conn.close()

conn1 = db.open()
root1 = conn1.root()
foo1 = root1['foo']

conn2 = db.open()
root2 = conn2.root()
foo2 = root2['foo']

print foo1, foo1.getCount()
print foo2, foo2.getCount()

foo1.incCounter()
get_transaction().commit()

foo2.incCounter()
get_transaction().commit()

print foo1, foo1.getCount()
print foo2, foo2.getCount()



[Zope-dev] Database Cursors and Gargabe collection ?

2002-09-08 Thread Romain Slootmaekers

Yo,

we have a problem using garbage collection to clean up open database 
cursors. Our approach is really simple, but doesn't work. :(

we have a method( on a SimpleItem object) getCursor:

def getCursor(self):
 
 doc
 
 if not hasattr(self,'_v_cursor'):
 from MySQLdb import connect,escape_string
 db=connect(...)
 cursor=db.cursor()
 self._v_cursor=CursorWrapper(cursor)
 cursor=self._v_cursor.getCursor()
 return cursor

the cursorwrapper is a class that closes the cursor on GC.

class CursorWrapper:
 def __init__(self,cursor):
 print created
 self.__cursor=cursor

 def getCursor(self):
 print given out
 return self.__cursor

 def __del__(self):
 self.__cursor.close()
 del self.__cursor
 print deleted

So in theory, the cursor will be closed on GC.

In practice however, we get multiple 'created' a lot of 'given out' but 
no 'deleted' messages in the cucu debugging.

After searching the web/zope site the only related thing we could find 
was a quote from Jim: old objects don't die, they just fade away'
not very useful.

So the questions are:
1) why doesn't the __del__ get called on our wrapper ?
2) do we have to resort to closing and opening database cursors every 
single time we access the RDB ?


TIA,

Sloot.


___
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] http://cvs.zope.org/Products/Scheduler vs Xron forcron-like functionality. Advice?

2002-10-05 Thread Romain Slootmaekers

Joachim Werner wrote:
Hi All,
I'm interested in starting to maintain Xron, if it has potential to be a
stable products.
 From the code it doesn't seem to do any strange things, but I would
like to know if anybody has experience of using it in a production
environment, or any other experiences and that would recommend not
using it in a production environment.
 
 
 We are using it, but there seem to be some problems. One of them is that I
 frequently have cases where Xron doesn't reschedule properly (I am using the
 improved user interface stuff for Xron, so the bug could also be in there).
 What happens is that an event that is scheduled for daily execution at
 midnight will not be rescheduled for the next day after it was executed, but
 reset to the year 1970, which actually means it is switched off.

We are also using Xron in a production environment, and have the same 
problem, and also the reverse: Xron doesn't reschedule properly, does 
not reset the scheduled date, and when the server is restarted tries to 
catch up on all missed events. pretty annoying.
I think the problem is related to conflict errors that cause Zope to 
reissue the request.


  Another issue is that Xron will use the current virtual host settings when
 it executes and reschedules an event. That means that the entries in the
 Xron Schedule ZCatalog will have different URLs. In some cases the URL that
 is used to execute an event could be important. E.g., we use Apache with
 some tricky rewrite rules in front of Zope, and to get around the Apache
 server the Zope server has to be called from a different URL.

This is a pain, Xron tries to invoke the actions from the front side of 
zope, ie by issuing a HTTP request. since we use a Zope+Apache 
httphttps setup, we just hacked Xron to rewrite the urls to 
http://127.0.0.1:8080/..

Anyway, Xron is a backend zope product and
shouldn't try to do it's thing going through the main gates, especially 
if the
site is only reachable through https.
We really would like to something that just repeats itself after it's 
done, instead of just doing something every X hours.


 
 I am willing to help with maintaining Xron, especially the part concerning
 ZEO, because we really need it ...
 
 Joachim

same here because, at this point, we are considering moving to a cron 
based approach, and it would be nice if we would not need to do it.


Sloot.



___
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] product refresh and random number generation.

2003-01-28 Thread Romain Slootmaekers
hi,

I'm having problems with random number generation and product refreshes. 
To illustrate the problem, consider the following product code:

class RandomNumberGenerator(SimpleItem.SimpleItem):

 ...

def __init__(self,id):
initialize an instance
self.id = id
self.__random = Random(time.time())


def next(self):

 returns next random number.

return self.__random.random()


ok, this works but whenever the product is refreshed or the zope server 
restarts, the generator will start to generate the same sequence of 
numbers, which is not what I want.

I'm having trouble understanding what is happening:

since the object gets pumped up every request it would make sense
that you get the same random number if you lose some state from the 
internal random generator. But this isn't happening. You apparantly only 
lose state when the product is refreshed or when the zope server 
restarts. Could this be a cache effect ?

(I could, as a last resort seed the generator with the current time 
every request, but then, I lose all guarantees about the period for the 
random number generation)

any input appreciated.

Romain.



___
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] Accept-Charset hearders causing 500 internal server error.[correctbut not lenient]

2003-01-29 Thread Romain Slootmaekers
Hi,

We have problems with the Accept-Charset headers that are sent to the 
zope server by some mobile phones:
fi:
'Accept-Charset':'ISO-8859-1, US-ASCII, UTF-8; Q=0.8'

These cause a 500 internal server error. (Error Value: invalid literal 
for float(): =0.8 )

I checked with the HTTP1.1 RFC26160 section 14.2 and the header seems 
valid, but in fact isn't:
there is a space between the semi-colon and the Q char (which shouldn't 
be there acoording to the spec).

So, in principle, this is not a zope server bug, but an inflexibility.

I think the server should be a bit more lenient.
a simple .strip() in the right place should do.

Could you guys fix this?

TIA,

Sloot.




BTW, for completeness, I included a quick test program is included below 
(causes a 500 on my zope 2.6.0) :



#- program illustrating the behavior ---
import httplib, urllib

def sendHTTP():



headers = {'Accept':
   'application/vnd.wap.wmlc, 
application/vnd.wap.wmlscriptc, application/vnd.wap.wbxml, 
image/vnd.wap.wbmp, image/gif, application/*, text/html, 
application/xhtml+xml, application/vnd.wap.wml+xml, text/css',
   'Accept-Charset':'ISO-8859-1, US-ASCII, UTF-8; Q=0.8'}#, 
ISO-10646-UCS-2; Q=0.6'
conn = httplib.HTTPConnection(127.0.0.1:8080)
conn.request(GET, /mobile/wap/games/,headers=headers)
response = conn.getresponse()
print response.status, response.reason
data = response.read()
print data

conn.close()

sendHTTP()




___
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] robustness in management interface.

2003-02-07 Thread Romain Slootmaekers
Hi,

The zope management interface has some robustness problems:

whenever you call manage_workspace (the normal way of managing a folder 
through the HTML Zope management interface) on a folder X, and some 
object y in that folder gives an error (fi, it has no title attribute, ) 
the whole folder becomes unmanageble. The only thing you can do at that 
point is to manually delete the problematic object by typing:

http:///X/manage_delObjects?ids=y

It seems to me that an object in a folder should not interfere with the 
management of the folder (at least, you should be able to throw the 
object out of the folder)


probably, a try/except or dtml-try in the right place fix this.

have fun,

Sloot.


___
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] robustness in management interface.

2003-02-07 Thread Romain Slootmaekers
Jim Washington wrote:

Romain Slootmaekers wrote:


Hi,

The zope management interface has some robustness problems:

whenever you call manage_workspace (the normal way of managing a 
folder through the HTML Zope management interface) on a folder X, and 
some object y in that folder gives an error (fi, it has no title 
attribute, ) the whole folder becomes unmanageble. The only thing you 
can do at that point is to manually delete the problematic object by 
typing:

http:///X/manage_delObjects?ids=y

It seems to me that an object in a folder should not interfere with 
the management of the folder (at least, you should be able to throw 
the object out of the folder)


probably, a try/except or dtml-try in the right place fix this.



Or, you could assure that your objects all have titles (at least =) if 
you want them managed through the ZMI.  I have not seen this as a 
*requirement*, but every example of a zope object I have seen uses 
self.title=aString in __init__(). 
It is also important to have titles for most cataloging.  Do you catalog 
your site?  Is not title a good thing for searching?  Might you catalog 
in the future?

maybe I didn't express myself as clearly as I could have:
the title attribute was an example (fi=for instance) of what can go wrong.


Perhaps something for a BestPractices document(?) or wiki(?):

ZMI-manageable objects have a title attribute.  This is a string.

For a bit of context on the above, I put together a product that has 
title as a function (=[:30] of some content) some time ago.  I have been 
led to understand that this was a bad idea because it breaks some 
cataloging.

yep.your catalog can be inconsistent, unless the changing of the 
attribute will call a recatalog orso.

Your idea of dtml-try does have merit IMHO.  Should the ZMI really 
assume existence of anything other than id for objects?


Sloot.



___
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] Accept-Charset hearders causing 500 internal servererror.[correct but not lenient]

2003-02-10 Thread Romain Slootmaekers
Romain Slootmaekers wrote:
Hi,
below the original post:

it is a bug in Products/Localizer/Accept.py

here's the code to fix it:

#--- code fix starting from line 102 ---


# Get the quality
try:
if len(x) == 2:
quality = x[1]# Get the quality
quality =quality.strip()
quality = quality[2:] # Get the number (remove 
q=)
quality = float(quality)  # Change it to float
else:
quality = 1.0
except:
quality=1.0
#--- end of code fix ---

I added a strip() and a try/except for other things that can go wrong.

This way Nokia Wap surfers can access your site while Localizer is 
installed.

have fun,

Sloot.

BTW, exceptions that originate here are not caught in the error_log.
this is probably unintended as well.


- original post -
Hi,

We have problems with the Accept-Charset headers that are sent to the 
zope server by some mobile phones:
fi:
'Accept-Charset':'ISO-8859-1, US-ASCII, UTF-8; Q=0.8'

These cause a 500 internal server error. (Error Value: invalid literal 
for float(): =0.8 )

I checked with the HTTP1.1 RFC26160 section 14.2 and the header seems 
valid, but in fact isn't:
there is a space between the semi-colon and the Q char (which shouldn't 
be there acoording to the spec).

So, in principle, this is not a zope server bug, but an inflexibility.

I think the server should be a bit more lenient.
a simple .strip() in the right place should do.

Could you guys fix this?

TIA,

Sloot.




BTW, for completeness, I included a quick test program is included below 
(causes a 500 on my zope 2.6.0) :



#- program illustrating the behavior ---
import httplib, urllib

def sendHTTP():



headers = {'Accept':
   'application/vnd.wap.wmlc, 
application/vnd.wap.wmlscriptc, application/vnd.wap.wbxml, 
image/vnd.wap.wbmp, image/gif, application/*, text/html, 
application/xhtml+xml, application/vnd.wap.wml+xml, text/css',
   'Accept-Charset':'ISO-8859-1, US-ASCII, UTF-8; Q=0.8'}#, 
ISO-10646-UCS-2; Q=0.6'
conn = httplib.HTTPConnection(127.0.0.1:8080)
conn.request(GET, /mobile/wap/games/,headers=headers)
response = conn.getresponse()
print response.status, response.reason
data = response.read()
print data

conn.close()

sendHTTP()




___
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 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] Accept-Charset hearders causing 500 internal servererror.[correct but not lenient]

2003-02-10 Thread Romain Slootmaekers
Leonardo Rochael Almeida wrote:

On Mon, 2003-02-10 at 10:27, Romain Slootmaekers wrote:


Romain Slootmaekers wrote:
Hi,
below the original post:

it is a bug in Products/Localizer/Accept.py

here's the code to fix it:

#--- code fix starting from line 102 ---


# Get the quality
try:
if len(x) == 2:
quality = x[1]# Get the quality
quality =quality.strip()
quality = quality[2:] # Get the number (remove 
q=)
quality = float(quality)  # Change it to float
else:
quality = 1.0
except:
quality=1.0
#--- end of code fix ---

I added a strip() and a try/except for other things that can go wrong.



Please, please, please, don't use generic except:. They can cause ZODB
corruption if they catch ConflictErrors. In the case of the code above,
test for specific errors that float(quality) or x[1] can raise and
catch those instead.



In general, a generic except is evil.
Here, I seriously don't see how the code inside the try/except can cause 
a conflict error or other serious damage.

In general, general remarks are evil ;)

Sloot.



___
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: Bare except dangerous to ZODB?

2003-02-11 Thread Romain Slootmaekers
Shane Hathaway wrote:

Jeremy Hylton wrote:


On Tue, 2003-02-11 at 12:10, Shane Hathaway wrote:


I added a test to testZODB.py on a new branch 
(shane-conflict-handling-branch) that exercises the conflict handling 
bug.  The test currently fails.  It might be simpler to go with 
Toby's implementation for now: add a veto object to the transaction 
that refuses any attempt to commit.  But maybe your transaction 
states are better.  Let me know what you want to do.



I'd like to do the transaction states, because it would keep the code in
zodb3 and zodb4 similar.  Unless there's a reason to think there are
problems with the transaction state approach.



That would be fine.  We only need all tests (including the new test) to 
pass. :-)

I didn't look carefully at the test, but if I remember the discussion
last time around, the problem is with read conflicts caught outside of
2PC.  In that case, we either need to mark the connection so that it
votes no when it gets to prepare() or we need to veto() method.  I'd
prefer the vote-no-in-prepare because it keeps the API smaller, but
veto() isn't so bad; maybe it's better to stop the transaction quickly.



If we have veto(), it should probably expect a string argument that 
explains the reason for the veto.  Then if something tries to commit, we 
can raise VetoedError(explanation).  Otherwise, it seems like failed 
transactions would be opaque and hard to decipher.

hm this is starting to look an awful lot like Persistent Java Beans.
maybe you should take a look there and borrow some architecture.

Sloot.


___
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: [Zope] PCGI?

2003-02-14 Thread Romain Slootmaekers

here's an edited repost from an answer I got from this mailing list.
it has helped me with zope+apache (+ ssl) and is a good start for the
documentation upgrade, (although I personally use the apache proxypass 
directives)

-- original help from Leonardo Rochael Almeida [EMAIL PROTECTED] --


Here is how you'd do it with VirtualHostMonster and apache:

1. add a single one virtual host monster to your Zope root. Give it any
id you want. You can be creative, 'cause it won't matter :-)

2. In apache, change your configuration to read like below. To
understand why the ProxyPass urls read like that, look at the
VirtualHostMonster object or consult the SiteAccess2 documentation here:
http://www.zope.org/Members/4am/SiteAccess2/info

### Apache ###

# better to use the IP address instead of the name here,
# to avoid dns lookups on apache initialization
NameVirtualHost www.greatsite.com

# better to use the IP address here too, for the same reason
VirtualHost www.greatsite.com
  # here you put the server name instead of the address.
  # it won't result in a dns lookup.
  ServerName www.greatsite.com
  # secure /private
  RedirectMatch permanent ^/private https://www.greatsite.com/private$1
  # the :80 below is NECESSARY. Don't ommit it
  ProxyPass / 
http://127.0.0.1:8080/VirtualHostBase/http/www.greatsite.com:80/greatsite/VirtualHostRoot/
/VirtualHost

NameVirtualHost www.greatsite.com:443

VirtualHost www.greatsite.com:443
  ServerName www.greatsite.com
  # note the protocol specification after VirtualHostBase. As above,
  # the port specification is not optional
  ProxyPass / 
http://127.0.0.1:8080/VirtuaHostBase/https/www.greatsite.com:443/greatsite/VirtualHostRoot/
  SSLEngine on
  SSLCertificateFile /etc/httpd/ssl.crt/server.crt
  SSLCertificateKeyFile /etc/httpd/ssl.key/server.key
/VirtualHost

EOF

I haven't tested the configuration above. I'd use RewriteRules instead
of RedirectMatch and ProxyPass, but just because that's what I'm used to
doing.

Notice that ProxyPassReverse directives aren't needed, because the
VirtualHostMonster, when presented with the above URLs, effectively
convinces Zope that it's running in the above mentioned ports and
protocols.

No SiteRoot objects are needed.
--- end of original help ---


have fun,

Sloot.


--
Science can amuse and fascinate us all,
 but it is engineering that changes the world.
 Isaac Asimov




___
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] support for low level HTTP Response logging?

2003-02-25 Thread Romain Slootmaekers
Yo,

searching the zope site and googling yielded too many data and no info, 
so I might as well ask it here.

We are very interested in finding out the exact HTTP Responses that the 
zope server pushes towards the client.

So is there a low level hook for logging the http responses ?
We want the exact response, complete with all header info etc.
Why not just sniff, you might ask? Well, we are developing a web 
application for mobile microbrowsers, and most these clients have no 
hooks for attaching a sniffer client side. Installing a sniffer server 
side is not possible for other reasons.

TIA,

Sloot.

___
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] support for low level HTTP Response logging?

2003-02-25 Thread Romain Slootmaekers
Andreas Jung wrote:
http://hathaway.freezope.org/Software/TCPWatch
Apparantly, I forgot to mention this:
proxying isn't an option either.
You can't just, on the fly, put a proxy between several components in a 
production setup.

Sloot.


--On Dienstag, 25. Februar 2003 11:24 +0100 Romain Slootmaekers 
[EMAIL PROTECTED] wrote:

Yo,

searching the zope site and googling yielded too many data and no info,
so I might as well ask it here.
We are very interested in finding out the exact HTTP Responses that the
zope server pushes towards the client.
So is there a low level hook for logging the http responses ?
We want the exact response, complete with all header info etc.
Why not just sniff, you might ask? Well, we are developing a web
application for mobile microbrowsers, and most these clients have no
hooks for attaching a sniffer client side. Installing a sniffer server
side is not possible for other reasons.
TIA,

Sloot.

___
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 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] support for low level HTTP Response logging?

2003-02-25 Thread Romain Slootmaekers
Clemens Robbenhaar wrote:
Hi Romain,

  Yo,
  
  searching the zope site and googling yielded too many data and no info, 
  so I might as well ask it here.
  
  We are very interested in finding out the exact HTTP Responses that the 
  zope server pushes towards the client.
  
  So is there a low level hook for logging the http responses ?
  We want the exact response, complete with all header info etc.

 There is no  explicit hook, but you might add Your logging code in 
Zope/lib/python/ZPublicher/HTTPResponse.py, for example in the 'write'
method of the HTTPResponse, or by wrapping the 'self.stdout' in __init__
by something that also logs the output before writing to the passed
'stdout' stream. 

 Of course this most probably will bring performance down (or even the
complete Zope, if there is a simple typo in the hacked code ;-) I assume
You only need this for testing.
No. actually, it is for a production setup, so it would be preferable if 
it could be done without changing the zope source code [this gives all 
kinds of problems, extra work,... when we need to update a server]

We need this in our 3th line support, were we want to be able to follow 
all ins and outs for singled out user (fi filtered on cookie).
We also need to be able to turn this on/off at runtime.

We can sift out the user we want, turn off/on the logging, aso
in our own code, if we could just have a low level zope hook.
For the requests, we already have done this since there are plenty of 
hooks available. (yes, grep -i someString $(find ./ -name *.py) is 
my friend ;) )

for Test/Development setups, we have plenty of options: proxying, 
sniffing, source code hacking, stepping with debugger,.

Romain.



___
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] HTTP Response headers in ZPublisher.HTTPResponse

2003-03-03 Thread Romain Slootmaekers
Yo,

the response headers set in ZPublisher.HTTPResponse our not always RFC 
compliant. In case of exceptions you get: (round lines 670 in 
HTTPResponse.py)

if ev.find( 'html') = 0:
ev = 'bobo exception'
self.setHeader('bobo-exception-value', ev[:255])


If the content is a xml,wml,whtml,... page, this results in exception 
headers like:

Bobo-Exception-Value: ?xml version=1.0?  !DOCTYPE ...

while most browsers will not barf on this, we encountered numerous 
problems with wap-gateways refusing to swallow this.

Another question is whether it is wise to send things like
the file and line numbers where the exception took place to the client.
I can understand that it can be useful in debug mode, but I can't see a 
reason to do this in a production setup.

The simplest way of fixing this is to change the code to something like:

ev = 'bobo exception'
self.setHeader('bobo-exception-value', ev)
or to leave out these headers altogether.

Romain.





___
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 + Jabber?

2003-04-01 Thread Romain Slootmaekers
Yo,

couldn't resist to mention that Zabber means drewl/saliva in Dutch,
so the name might be not that fortunate. ;)
Sloot.

___
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] oh boy [id,getId() madness]

2003-06-11 Thread Romain Slootmaekers
Yo,
I have an error in this code fragment:
-  fragment --
for childObject in container.objectValues():
id=childObject.getId()
childObject2=container[id] # sometimes gives a KeyError 
#...
- /fragment --
So it means that there are contained objects with an getId member that 
returns something different than the key that is used for these objects 
in the container object.

As it turns out, I indeed have such objects in my ZODB, and they cause 
all kinds of problems (fe, you can't rename them with the management 
interface)

The questions are:
  - has anyone else experienced this ?
  - what could be causing this ?
TIA,

Romain.





___
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] Maxinum number of versions for a single object in the ZODB ?

2003-07-12 Thread Romain Slootmaekers
Yo,

Somewhere in our deployment we have a SimpleItem.SimpleItem object with
a random number generator in it.
The code to get a new random number is:
 random=self.__random.random()
 #
 self._p_changed = 1 # make sure to store the changed generator
We use that generator A LOT,
but today, after some months of working correctly, it just stopped
returning different random numbers. I have no other clue than to guess 
there is a maxinum number of different versions any object can have in 
the ZODB.

Is my hunch correct ?

TIA,

Romain.





___
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] pre-export and post-import hooks.

2003-08-14 Thread Romain Slootmaekers
Yo,

I have an object for which I'd like to have pre-export and post 
import-hooks.

After some code browsing, I found the ObjectManager api with
the manage_exportObject method.
overwriting this for the export looks good, but the problem is that this 
only works when called directly on the object, and not when you export a 
container of the object in question.

Is there an easy solution to this problem ?

Romain Slootmaekers







___
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 Boa-Constructor

2003-08-23 Thread Romain Slootmaekers
Bruce Williams wrote:
Anyone else using the combonation?
yeah.
it works great.


___
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] zope.org down....

2003-08-26 Thread Romain Slootmaekers
Sorry for the offtopic/crosspost but,

  www.zope.org is down,
and with a rather ugly error message:
ugly_message
ERROR
The requested URL could not be retrieved


While trying to retrieve the URL: 
http://12.155.117.33:8082/VirtualHostBase/http/zope.org:80/zopeorg/VirtualHostRoot/ 

The following error was encountered:

Connection Failed
The system returned:
(111) Connection refused
The remote host or network may be down. Please try the request again.
Your cache administrator is [EMAIL PROTECTED]

/ugly_message

hope someone can do something ;)

Romain Slootmaekers

___
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 2.7 running with Stackless 3.0

2003-08-28 Thread Romain Slootmaekers
Christian Tismer wrote:
Dear friends,

just by chance, I got into the position to try out
Zope 2.7.0 beta 1/2, and since it needs Python 2.2.3
at least, and Stackless 3.0 was just ported to that, I tried
to build Zope with Stackless 3.0.
It works very very well! After a few patches to get the includes
right, here the installation instructions.
Get the current Stakless 3.0 beta.

CVSROOT=:pserver:[EMAIL PROTECTED]:/home/cvs
export CVSROOT
cvs co stackless

cd stackless/src
./configure
make
# su if your weren't root
make install
Then, install the Zope source, and make the same dance as usual.

This is very, very cool. I've been waiting for this quite a while...

Romain.

___
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] bug in manage_pasteObjects ??

2003-08-28 Thread Romain Slootmaekers
hi,

after an object is copied  paste, the following method is called:

def manage_afterClone(self, item):




as it happens, both self and item refer to the same object which 
severely limits the use of the method. You probably want a reference to 
the original object from which this one was cloned.

I googled and found a mail with the same remarks posted in 1999:
http://mail.python.org/pipermail/zope-dev/1999-November/002303.html
from which I copy the relevant part for your convenience:

--- c amp; p ---
In lib/OFS/CopySupport.py
In the function manage_pasteObjects
the following line appears:
ob=ob._getCopy(self)
ob.manage_afterClone(ob)
Passing ob as an argument doesn't make sense
because the function is being called on ob,
(so self is already ob)
it would make more sense to to something along the lines of:
original_ob=ob
ob=ob._getCopy(self)
ob.manage_afterClone(original_ob)
/--- c amp; p ---

but there's no follow- up, no reply, no fix. :(

Romain Slootmaekers





___
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] bug in manage_pasteObjects ??

2003-08-29 Thread Romain Slootmaekers
Romain Slootmaekers wrote:
hi,

after an object is copied  paste, the following method is called:

def manage_afterClone(self, item):




as it happens, both self and item refer to the same object which 
severely limits the use of the method. You probably want a reference to 
the original object from which this one was cloned.

I googled and found a mail with the same remarks posted in 1999:
http://mail.python.org/pipermail/zope-dev/1999-November/002303.html
from which I copy the relevant part for your convenience:

--- c amp; p ---
In lib/OFS/CopySupport.py
In the function manage_pasteObjects
the following line appears:
ob=ob._getCopy(self)
ob.manage_afterClone(ob)
Passing ob as an argument doesn't make sense
because the function is being called on ob,
(so self is already ob)
it would make more sense to to something along the lines of:
original_ob=ob
ob=ob._getCopy(self)
ob.manage_afterClone(original_ob)
/--- c amp; p ---

but there's no follow- up, no reply, no fix. :(

Romain Slootmaekers





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

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

have fun,

Romain Slootmaekers



___
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] bug in manage_pasteObjects ??

2003-08-30 Thread Romain Slootmaekers
Dieter Maurer wrote:
Romain Slootmaekers wrote at 2003-8-28 22:14 +0200:
  after an object is copied  paste, the following method is called:
  
  
  def manage_afterClone(self, item):
   
   
  
  
  
  
  as it happens, both self and item refer to the same object which 
  severely limits the use of the method. You probably want a reference to 
  the original object from which this one was cloned.

I am not so sure about this.

I think, in most use cases, it is sufficient to have the copied
object. At least for all currently handled use cases it is apparently
sufficient.
What use case do you have that needs the original object?
We have a content type that has 2 types of attributes:
- private attributes (private as 'not shared')
- shared attributes
   (btw, these reside in  a RDB, the object only knows a primary key)
Only the original content object can modify the shared attributes
the others can view them but only edit their private attributes
This all works fine.

We want to delete all clones automatically when an original is deleted.
For this, we need an accounting scheme that notifies the original about 
its clones. The designated place to do this is manage_afterClone, but we 
lack the necessary information in that method, hence the suggested change.

So the official use case would be:
  clone needs to call method on original.



Under no circumstances are you allowed to redefine the item
parameter above to refer to the original object (as suggested in
the quoted message):
  manage_clone is often implemented recursively and
  while in the top call self and item are identical,
  this changes in recursive calls.
  Knowing item (where the recursive manage_clone started)
  is essential to differentiate actions depending on the
  relative position of item with respect to other objects:
  e.g. initialize workflow when item is below the portal
  but do not when it is above.
  Code that makes these checks will break when you pass a differnt
  object as item.
I changed my 2.6.1 and haven't noticed any defects (yet ;)) in the plone 
that uses this behaviour.

I'm willing to run the whole testset against my changes but this will 
cost me significant setup time as I'm not a (registered) zope developer.
as the changes only affect 10 lines, I was wondering if someone else 
would 'do the honours'. :)

Dieter
Romain







___
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] Catalog performance

2003-09-10 Thread Romain Slootmaekers
Nguyen Quan Son wrote:
Hi,
I have a problem with performance and memory consumption when trying to do some 
statistics, using following code:
...
docs = container.portal_catalog(meta_type='Document', ...)
for doc in docs:
obj = doc.getObject()
value = obj.attr
...
With about 10.000 documents this Python script takes 10 minutes and more than 500MB of 
memory, after that I had to restart Zope. I
am running Zope 2.6.1 + Plone 1.0 on Windows 2000, Xeon P4 with 1GB RAM.
What's wrong with this code? Any suggestion is appreciated.
Nguyen Quan Son.
it's not the catalog that's slow:

t1=time.time()
docs = container.portal_catalog(meta_type='Document', ...)
t2=time.time()
for doc in docs:
 obj = doc.getObject()
 value = obj.attr
 ...
t3=time.time()
print out the times and you'll see that the the finding is fast.
the problem is that you are inflating each and every document one after 
another, and that takes time.

Romain Slootmaekers.


___
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 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] Zope doesn't know enough mime types.

2003-10-24 Thread Romain Slootmaekers
Yo,

Zope doesn't know enough mime types, and there's no easy way to add them 
add runtime since you removed the add_type(...) method from mimetypes.py

mime types that spring to mind are:

.ra .ram .rm  : audio/x-pn-realaudio
.rpm  : audio/x-pn-realaudio-plugin
.jad : text/vnd.sun.j2me.app-descriptor
.jar : application/java-archive
I'm sure there must be quite a few others.
Maybe someone can add the lot of'em.
This also is vaguely related to:
http://zope.org/Collectors/Zope/969
TIA,

Romain Slootmaekers





___
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 doesn't know enough mime types.

2003-10-24 Thread Romain Slootmaekers
Clemens Robbenhaar wrote:

Hi Romain,

  Yo,
  
  Zope doesn't know enough mime types, and there's no easy way to add them 
  add runtime since you removed the add_type(...) method from mimetypes.py

 Who is you which has removed the function? I guess mimetypes 
is a core python module ...
you = zope development team

mimtypes IS a core python module, but zope feels compelled to deliver us 
a modified version with less functionality (and probably has good 
reasons to do so).

But why the modified mimetypes file has to contain about 40 less 
mime-types than the corresponding file in a python installation from 
python.org is a mistery to me.

Anyway if You feel the need to add content types to the global
mimetypes map, You can do this manually in Your custom product
__init__.py, e.g.:
from mimetypes import types_map
types_map['.ra'] = 'audio/x-pn-realaudio'
# etcetcetc
I guess this is not worse than letting Zope to the patches.
(Monkey)patching zope(s) to workaround (bugs | missing features) is 
indeed sometimes needed but if the fix is as simple as adding some 
name-value pairs I see no reason why not to do this before the next release.

Romain.
Cheers,
Clemens



___
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 doesn't know enough mime types.

2003-10-24 Thread Romain Slootmaekers
Tres Seaver wrote:

On Fri, 2003-10-24 at 09:03, Romain Slootmaekers wrote:

Yo,

Zope doesn't know enough mime types, and there's no easy way to add them 
add runtime since you removed the add_type(...) method from mimetypes.py

mime types that spring to mind are:

.ra .ram .rm  : audio/x-pn-realaudio
.rpm  : audio/x-pn-realaudio-plugin


Note that this entry is ambiguous:  Real's use of the
already-conventional '.rpm' (the extension for RPM pacakges) for their
own plugins is obnoxious.  I *wouldn't* agree that we should wire that
into Zope.
as it turns out, it is ambiguous, but neither Red Hat nor Real
have an .rpm entry on the official list. but that's not surprising 
either, since that one was last updated in 2001.

http://www.isi.edu/in-notes/iana/assignments/media-types/media-types



.jad : text/vnd.sun.j2me.app-descriptor
.jar : application/java-archive
I'm sure there must be quite a few others.
Maybe someone can add the lot of'em.
This also is vaguely related to:
http://zope.org/Collectors/Zope/969


Tres.


___
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 doesn't know enough mime types.

2003-10-24 Thread Romain Slootmaekers
Leonardo Rochael Almeida wrote:



Put it in the collector.

http://zope.org/Collectors/Zope/1091

___
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] Zope 2.6+ pyton 2.3 ? and Bad Call on zope 2.6.2/python 2.1.3 with profiling turned on.

2003-10-29 Thread Romain Slootmaekers
Yo,

I have an elaborate piece of python code that works fine, but with 
profiling turned on, it barfs a Bad Call message.

When google-ing for a solution, the only thing I could find was a

http://mail.python.org/pipermail/python-bugs-list/2003-June/018510.html

There's a follow up stating it's already fixed,
and does not occur in  Python 2.2.x and beyond.
So now my questions are:

-  how difficult is it to get a zope 2.6.2 (or 2.7) working with a 
python 2.2.x or 2.3. on a windows platform? (I read up on the changes 
between 2.6 and 2.7 and it does not seem to change python version.)

- I believe there's a concensus that the next major 2.X release should 
jump immediately 2.3, but is there a timeline ?

- or is there a workaround/solution to the Bad Call problem?

This all to see if I should invest time in getting a 2.6 or 2.7 +python 
2.3 up and running or I should do my own time measurements/profiling effort.

TIA,

Romain Slootmaekers.









___
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 2.6+ pyton 2.3 ? and Bad Call on zope 2.6.2/python 2.1.3 with profiling turned on.

2003-10-30 Thread Romain Slootmaekers
Dieter Maurer wrote:

Romain Slootmaekers wrote at 2003-10-29 11:28 +0100:
  I have an elaborate piece of python code that works fine, but with 
  profiling turned on, it barfs a Bad Call message.
  
  When google-ing for a solution, the only thing I could find was a
  
  http://mail.python.org/pipermail/python-bugs-list/2003-June/018510.html
  
  There's a follow up stating it's already fixed,
  and does not occur in  Python 2.2.x and beyond.

I think the bug report is from me.

I do not believe the followup (does not occur in Python 2.2.x).
While I analysed the problem with Python 2.1.3 (and therefore reported
it as an 2.1.3 bug), I am almost sure (not completely) that
my colleague hit the problem with Python 2.2 in the first place
(which triggered my analysis).
Thus, watch out for the same behaviour in Python 2.2.
I think I added a followup with a workaround to the bug report.
No you did not, but the problem was prpbably not that sever:
apparantly, from what I understand from your bug report, you get a 
Exception Bad call ... ignored

In my particular case, that exception is not ...ignored, but cascades 
upwards, to the top level.

Should the problem come back with Python 2.2 or Python 2.3
and you do not find the patch in Python's bug tracker, come
back. I can send you the patch in this case.
So you have a patch ?

Romain Slootmaekers.

___
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] New-style ExtensionClass , maybe stupid question...

2003-12-02 Thread Romain Slootmaekers
Yo,
this maybe a stupid question, and totally off topic, but ...
will the new type extension class avoid the problems related with mixin 
classes not extending ExtensionClass.Base?

(for explanation and workaround see the thread 
http://mail.zope.org/pipermail/zope/2002-June/116094.html
)

Romain Slootmaekers.



___
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] bug in 2.6.2, 2.6.1 , and probably others.

2004-02-03 Thread Romain Slootmaekers
Yo,

I just stumbled on a bug in the python scripting parameter passing.
It seems that under certain conditions, the actual parameters are 
ignored, and the default parameters are always used.

It is best shown by the following example:

0) create a python script with the following source:

## Script (Python) buggy
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=a = 'default_a', b = 'default_b', c = 'default_c'
##title=exposes a bug in 2.6.1 and 2.6.2
##
print a
print b
print c
return printed
1) in the ZMI click on the test tab
and fill in the values:
parameter   value
a   a
b   b
c   c
2) click on run script

3) the result page is:

default_a
default_b
default_c
that's not what it should be.

I quickly browsed the bug collector and did not found a related issue,
but before I file a bug report, I'd like to know what versions are affected.
I don't have the time nor the desire to install all versions and test 
this. So if you guys could take a minute to test it on your version.

tia,

Romain Slootmaekers.









___
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] How to make Zope fail nicely under high load?

2004-02-11 Thread Romain Slootmaekers
Bjorn Stabell wrote:

Hi,

We've run into an interesting problem when load-testing a Zope site
behind Apache, a problem that we've also encountered in real life.
Basically, when the load gets high, Zope has a huge backload of work
(several minutes of requests), making the average latency for each
request many minutes.  What are effective ways to do this kind of
overload management so that the backlog of work doesn't get that big?
The ideal would be for requests to fail immediately if the backlog of
work is more than a certain number of requests (or even better,
estimated time to process).
Here's what we've tried:

Naively, we thought we could just set the socket.listen() backlog in
Apache and Zope to a lower value, but in TCP connect()'s apparently
don't fail if the server's listen backlog is full; instead requests are
retried, resulting in a client side managed listen backlog, also
giving the same long latency.  (If someone knows this stuff, please
confirm/deny these allegations against TCP :)
It appears the way to control it would for Apache or Zope to return 503
Service Unavailable when the load is too high, but we haven't found a
good way to do this; Zope doesn't appear to have any mechanism for it,
and Apache's ProxyPass doesn't either.  I guess load balancers would,
but that's a bit overkill since we run the server on one machine.
Regards,
Naturally,

It would be really nice to have a solution inside zope where you can 
configure stuff like the maxinum number of concurrent sessions, and a 
hook for handling the refusal of a new session.
This so called graceful degradation functionality could also be used for

-) graceful shutdown:
now, a shutdown of a zope server is brutal. For some applications you 
want people to be able to finish their business, while at the same time 
you want that no new users can get into the system.

-) licensing policies:
having web services that are used by at most X people at the same time.
These things have to be handled at the Zope level, since neither the 
apache, nor the networking layer have any clue about things like user 
session, aso.

Ok,
This said.
who writes the proposal? ;)
Romain Slootmaekers.



___
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] ZODB for Java?

2004-04-15 Thread Romain Slootmaekers
Ian Beatty wrote:
Greetings.

Does anyone know of a good (stable, reliable, fast enough for production 
use in a web app) ZODB-equivalent for persisting Java objects?
www.jdocentral.com


Thanks,

..Ian

-- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- -- --- --
Dr. Ian Beatty   [EMAIL PROTECTED]
Physics Education Researchvoice: 413.545.9483
Department of Physics   fax: 413.545.4884
Univ. of Massachusetts  AIM: (available upon request)
Amherst, MA 01003-9337 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 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] TALParser barfing on byte-order marked utf8 XML files.

2004-07-09 Thread Romain Slootmaekers
Yo,
We are using TAL for things other than ZPT. but are having problems with 
files that include a BOM preamble.

the problem is that althought the underlying XML parser is capable of 
parsing these kind of files, TALParser initialises his parent without 
encoding (XMLParser.__init__(self) in TALParser.py  line 27)

Anyway,
I have attached a small example (test.py  + test.ml) that illustrates 
the problem with Zope 2.7.1.

running the test gives:
UnicodeEncodeError: 'ascii' codec can't encode character u'\ufeff' in 
position 0: ordinal not in range(128)
which is perfectly logical: feff (the start of the bom preamble) is not 
ascii.

chipping away the preamble (data=data[4:] ) gives problems further on in 
the file as the test example has some german characters (ä)

UnicodeEncodeError: 'ascii' codec can't encode character u'\xe4' in 
position 50: ordinal not in range(128) which is also perfectly logical: 
ä has code 132.

My question is simply: why is TALParser not taking the encoding into 
acount ? Is this deliberate, or is it an oversight ?

Romain Slootmaekers.

?xml version=1.0 encoding=UTF-8 ? 
fails
Archäologe Paläo-Anthropologie
/fails#
#
#
from xml.dom.minidom import parseString

import sys
from TAL.TALParser import TALParser
from TAL.TALInterpreter import TALInterpreter
from TAL.DummyEngine import DummyEngine
import StringIO

import codecs



print sys.getdefaultencoding()

def readData():
f = open('test.xml','r')

readerClass = codecs.getreader('utf8')
print readerClass
reader = readerClass(f)
data = reader.read()
f.close()
print size = %s % len(data)
return data


def expand(xml):

parser = TALParser()
xml = xml[4:]
parser.parseString(xml)
program, macros = parser.getCode()
engine = DummyEngine(0)
out = StringIO.StringIO()
interpreter = TALInterpreter(program,macros,engine,stream=out)
interpreter()
result = out.getvalue()

return result

data = readData()
expanded = expand(data)
document = parseString(expanded)

print ok___
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 )