[Zope-Checkins] CVS: Packages/ZEO - component.xml:1.4.6.1 mkzeoinst.py:1.18.8.4 runzeo.py:1.15.6.5

2005-04-12 Thread Sidnei da Silva
Update of /cvs-repository/Packages/ZEO
In directory cvs.zope.org:/tmp/cvs-serv13625

Modified Files:
  Tag: Zope-2_7-branch
component.xml mkzeoinst.py runzeo.py 
Log Message:

* Borrow Zope's 'Signal' mechanism for Windows, if available, to
  implement clean shutdown and log rotation handlers for Windows.
* Back to creating a .PID for ZEO, so external programs that wish to set
  the 'signal' can get the PID and therefore derive the signal name.
  Currently only necessary on Windows but created on all platforms which
  implement os.getpid(), as long as the 'pid-filename' option is set,
  or the 'INSTANCE_HOME' environment variable can be found.


=== Packages/ZEO/component.xml 1.4 = 1.4.6.1 ===
--- Packages/ZEO/component.xml:1.4  Fri May 30 15:20:57 2003
+++ Packages/ZEO/component.xml  Tue Apr 12 22:54:54 2005
@@ -93,6 +93,15 @@
   /description
 /key
 
+key name=pid-filename datatype=existing-dirpath
+ required=no
+  description
+The full path to the file in which to write the ZEO server's Process ID
+at startup. If omitted, $INSTANCE/var/ZEO.pid is used.
+  /description
+  metadefault$INSTANCE/var/ZEO.pid (or $clienthome/ZEO.pid)/metadefault
+/key
+
   /sectiontype
 
 /component


=== Packages/ZEO/mkzeoinst.py 1.18.8.3 = 1.18.8.4 ===
--- Packages/ZEO/mkzeoinst.py:1.18.8.3  Wed Feb 18 17:10:14 2004
+++ Packages/ZEO/mkzeoinst.py   Tue Apr 12 22:54:54 2005
@@ -47,6 +47,7 @@
   address %(port)d
   read-only false
   invalidation-queue-size 100
+  # pid-filename $INSTANCE/var/ZEO.pid
   # monitor-address PORT
   # transaction-timeout SECONDS
 /zeo


=== Packages/ZEO/runzeo.py 1.15.6.4 = 1.15.6.5 ===
--- Packages/ZEO/runzeo.py:1.15.6.4 Wed Jan 14 14:07:00 2004
+++ Packages/ZEO/runzeo.py  Tue Apr 12 22:54:54 2005
@@ -48,6 +48,11 @@
 obj = ZConfig.datatypes.SocketAddress(arg)
 return obj.family, obj.address
 
+def windows_shutdown_handler():
+# Called by the signal mechanism on Windows to perform shutdown.
+import asyncore
+asyncore.close_all()
+
 class ZEOOptionsMixin:
 
 storages = None
@@ -95,6 +100,8 @@
  None, 'auth-database=')
 self.add('auth_realm', 'zeo.authentication_realm',
  None, 'auth-realm=')
+self.add('pid_file', 'zeo.pid_filename',
+ None, 'pid-file=')
 
 class ZEOOptions(ZDOptions, ZEOOptionsMixin):
 
@@ -117,6 +124,7 @@
 self.setup_default_logging()
 self.check_socket()
 self.clear_socket()
+self.make_pidfile()
 try:
 self.open_storages()
 self.setup_signals()
@@ -125,6 +133,7 @@
 finally:
 self.close_storages()
 self.clear_socket()
+self.remove_pidfile()
 
 def setup_default_logging(self):
 if self.options.config_logger is not None:
@@ -175,6 +184,8 @@
 method is called without additional arguments.
 
 if os.name != posix:
+if os.name == nt:
+self.setup_win32_signals()
 return
 if hasattr(signal, 'SIGXFSZ'):
 signal.signal(signal.SIGXFSZ, signal.SIG_IGN) # Special case
@@ -186,6 +197,27 @@
 method()
 signal.signal(sig, wrapper)
 
+def setup_win32_signals(self):
+# Borrow the Zope Signals package win32 support, if available.
+# Signals does a check/log for the availability of pywin32.
+try:
+import Signals.Signals
+except ImportError:
+debug(Signals package not found. 
+  Windows-specific signal handler 
+  will *not* be installed.)
+return
+SignalHandler = Signals.Signals.SignalHandler
+if SignalHandler is not None: # may be None if no pywin32.
+SignalHandler.registerHandler(signal.SIGTERM,
+  windows_shutdown_handler)
+SignalHandler.registerHandler(signal.SIGINT,
+  windows_shutdown_handler)
+# Can use the log rotate handler too.
+from Signals.Signals import logfileRotateHandler
+SIGUSR2 = 12 # not in signal module on Windows.
+SignalHandler.registerHandler(SIGUSR2, logfileRotateHandler)
+
 def create_server(self):
 from ZEO.StorageServer import StorageServer
 self.server = StorageServer(
@@ -232,6 +264,53 @@
 except: # Keep going
 exception(failed to close storage %r % name)
 
+def _get_pidfile(self):
+pidfile = self.options.pid_file
+# 'pidfile' is marked as not required.
+if not pidfile:
+# Try to find a reasonable location if the pidfile is not
+# set. If we are running in a Zope environment, we can
+# safely assume INSTANCE_HOME.
+instance_home = os.environ.get(INSTANCE_HOME)
+if not 

[Zope-Checkins] CVS: Zope/skel/bin - zopeservice.py.in:1.1.2.10

2005-04-12 Thread Sidnei da Silva
Update of /cvs-repository/Zope/skel/bin
In directory cvs.zope.org:/tmp/cvs-serv27740/skel/bin

Modified Files:
  Tag: Zope-2_7-branch
zopeservice.py.in 
Log Message:

Major service enhancements.  Service cleanly shuts down child, and if child
fails the tail of the process output (which generally contains a traceback)
is
written to the event log.

Minor tweaks to the Windows build 'clean' process and documentation tweaks.


=== Zope/skel/bin/zopeservice.py.in 1.1.2.9 = 1.1.2.10 ===
--- Zope/skel/bin/zopeservice.py.in:1.1.2.9 Thu Dec 16 13:08:39 2004
+++ Zope/skel/bin/zopeservice.py.in Tue Apr 12 23:41:34 2005
@@ -38,8 +38,9 @@
 
   install : Installs the service
 
-  update : Updates the service, use this when you change
-   the service class implementation 
+  update : Updates the service.  Use this if you change any
+   configuration settings and need the service to be
+   re-registered.
 
   remove : Removes the service
 
@@ -53,13 +54,9 @@
 
   debug : Runs the service in debug mode
 
-You can view the usage options by running ntservice.py without any
+You can view the usage options by running this module without any
 arguments.
 
-Note: you may have to register the Python service program first,
-
-  win32\PythonService.exe /register
-
   Starting Zope
 
 Start Zope by clicking the 'start' button in the services control
@@ -74,19 +71,17 @@
 
   Event logging
 
-Zope events are logged to the NT application event log. Use the
-event viewer to keep track of Zope events.
+Service related events (such as startup, shutdown, or errors executing
+the Zope process) are logged to the NT application event log. Use the
+event viewer to see these events.
 
-Note: to successfully run this script, the Zope software home needs to be on
-the PYTHONPATH.
-
+Zope Events are still written to the Zope event logs.
 
-import os.path
-from os.path import dirname as dn
-import sys
+
+import sys, os
 
 # these are replacements from mkzopeinstance
-PYTHONW = r'PYTHONW'
+PYTHON = r'PYTHON'
 SOFTWARE_HOME=r'SOFTWARE_HOME'
 INSTANCE_HOME = r'INSTANCE_HOME'
 ZOPE_HOME = r'ZOPE_HOME'
@@ -95,17 +90,35 @@
 CONFIG_FILE= os.path.join(INSTANCE_HOME, 'etc', 'zope.conf')
 PYTHONSERVICE_EXE=r'%s\bin\PythonService.exe' % ZOPE_HOME
 
-os.environ['PYTHONPATH'] = SOFTWARE_HOME
+# Setup the environment, so sub-processes see these variables
+parts = os.environ.get(PYTHONPATH, ).split(os.pathsep)
+if SOFTWARE_HOME not in parts:
+parts = filter(None, [SOFTWARE_HOME] + parts)
+os.environ[PYTHONPATH] = os.pathsep.join(parts)
+os.environ[INSTANCE_HOME] = INSTANCE_HOME
+
+# Ensure SOFTWARE_HOME is on our current sys.path so we can import the
+# nt_svcutils package.
+if SOFTWARE_HOME not in sys.path:
+sys.path.insert(0, SOFTWARE_HOME)
 
 from nt_svcutils.service import Service
 
 servicename = 'Zope_%s' % str(hash(INSTANCE_HOME.lower()))
 
 class InstanceService(Service):
-start_cmd = '%s %s -C %s' % (PYTHONW, ZOPE_RUN, CONFIG_FILE)
 _svc_name_ = servicename
 _svc_display_name_ = 'Zope instance at %s' % INSTANCE_HOME
-_exe_name_ = PYTHONSERVICE_EXE
+# _svc_description_ can also be set (but what to say isn't clear!)
+# If the exe we expect is not there, let the service framework search
+# for it.  This will be true for people running from source builds and
+# relying on pre-installed pythonservice.exe.
+# Note this is only used at install time, not runtime.
+if os.path.isfile(PYTHONSERVICE_EXE):
+_exe_name_ = PYTHONSERVICE_EXE
+
+process_runner = PYTHON
+process_args = '%s -C %s' % (ZOPE_RUN, CONFIG_FILE)
 
 if __name__ == '__main__':
 import win32serviceutil

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope] Full-text search in Office/PDF

2005-04-12 Thread Robert Sösemann
Hello,

I am using a ZOPE-based application on top of the ZOPE APE 
(http://opensource.ca.com/projects/zopeape) persitence mechanism (sort of 
binary storage). So the binaries are in the normal unix file system. I now need 
to extend my application to allow full-text search inside binaries document of 
the Office Word/Excel/PPT and PDF format.

In the first step, I would be happy to find a tool/python/zope module that just 
tells me that a certain string is in a document, without telling me the exact 
place of that occurence. 

Do you have solved a similar problem or know any tool to implement this 
functionality? I am looking forward to your questions.

Robert
PS: I have seen similar questions on other ZOPE lists, but they never had 
meaningful answers.
Konzeption


Gölz  Schwarz GmbH 
Waltherstr. 29, 80337 München, Germany 
phone: + 49 - (0)89 / 54 46 70 - 0 
fax: +49 - (0)89 / 54 46 70 - 10 
e-mail: [EMAIL PROTECTED] 
web: http://www.goelz.com 

Sie suchen den aktiven Dialog mit Ihren Kunden? Sie möchten neue Wege gehen, um
Ihre Zielgruppen online zu motivieren und zu binden? Dann haben wir genau das 
Richtige
für Sie: Marketing Suite - die Komplett-Lösung für intelligentes Online 
Marketing!
Informationen zur Marketing Suite erhalten Sie unter 
http://www.goelz.com/marketingsuite.
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Full-text search in Office/PDF

2005-04-12 Thread Andreas Jung

--On Dienstag, 12. April 2005 9:16 Uhr +0200 Robert Sösemann 
[EMAIL PROTECTED] wrote:

Hello,
I am using a ZOPE-based application on top of the ZOPE APE
(http://opensource.ca.com/projects/zopeape) persitence mechanism (sort of
binary storage). So the binaries are in the normal unix file system. I
now need to extend my application to allow full-text search inside
binaries document of the Office Word/Excel/PPT and PDF format.
Look at TextIIndexNG 2.
-aj


pgpu3xcc7MsCs.pgp
Description: PGP signature
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Full-text search in Office/PDF

2005-04-12 Thread Marco Bizzarri
You could do that using the excellent TextIndexNG inside a ZCatalog. 
This will allow you to index all your documents inside the TextIndexNG, 
and then search them using ZCatalog.

TextIndexNG includes support for a number of plugins in order to convert 
from MS Office/PDF to text and then index them.

We're using the tool inside our project (PAFlow) and we think it is an 
excellent product.

Regards
Marco
Robert Sösemann wrote:
Hello,
I am using a ZOPE-based application on top of the ZOPE APE 
(http://opensource.ca.com/projects/zopeape) persitence mechanism (sort of 
binary storage). So the binaries are in the normal unix file system. I now need 
to extend my application to allow full-text search inside binaries document of 
the Office Word/Excel/PPT and PDF format.
In the first step, I would be happy to find a tool/python/zope module that just tells me that a certain string is in a document, without telling me the exact place of that occurence. 

Do you have solved a similar problem or know any tool to implement this 
functionality? I am looking forward to your questions.
Robert
PS: I have seen similar questions on other ZOPE lists, but they never had 
meaningful answers.
Konzeption

Gölz  Schwarz GmbH 
Waltherstr. 29, 80337 München, Germany 
phone: + 49 - (0)89 / 54 46 70 - 0 
fax: +49 - (0)89 / 54 46 70 - 10 
e-mail: [EMAIL PROTECTED] 
web: http://www.goelz.com 

Sie suchen den aktiven Dialog mit Ihren Kunden? Sie möchten neue Wege gehen, um
Ihre Zielgruppen online zu motivieren und zu binden? Dann haben wir genau das Richtige
für Sie: Marketing Suite - die Komplett-Lösung für intelligentes Online Marketing!
Informationen zur Marketing Suite erhalten Sie unter http://www.goelz.com/marketingsuite.
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )
 

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


Re: [Zope] The Zope Book

2005-04-12 Thread Dario Lopez-Kästen
Chris McDonough wrote:
I don't think anyone has given much thought to actually documenting all
these nice nifty features in 2.9.  Which is no change from the norm, and
it will be a fairly organic process again.  I hate it, but whatever.
- C
Speaking of which, and being one of the people that promised to deliver 
but has not done so 100% yet, is it possible to checkout the Zope Book 
from cvs or svn?

That'd help a lot in terms of incrementally adding stuff, at least for me.
Thanks,
/dario
--
-- ---
Dario Lopez-Kästen, IT Systems  Services Chalmers University of Tech.
...and click? damn, I need to kill -9 Word again... - b using macosx
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] DTML namespace problem (was: dtml-tree issue)

2005-04-12 Thread Vangelis Mihalopoulos
Just added__allow_access_to_unprotected_subobjects__=1as an 
attribute of my class defined in an external python script and it works 
fine.

Thanks Tino!
Tino Wildenhain wrote:
Hi,
Am Montag, den 11.04.2005, 14:08 +0300 schrieb Vangelis Mihalopoulos:
 

Andreas Jung wrote:
   

You should *not* define classes inside PythonScripts. PythonScripts 
are stricted
and don't provide the full functionality. Either use filesystem based 
code (Zope
Product) or use simple Python datatypes as dictionaries in this case.
 

An External Method behaves exactly the same. I have not yet involved in 
writting even the simpler Product and i will not do it now for such a 
trivial issue.

I tried to return a dictionary,
-  return {'a':1, 'b':2, 'c':3}  --
but it the DTML Doc fails with a KeyError.
   

Use a dict and if you really need DTML... see the keyword
mapping for dtml-with and dtml-in tags.
If you want to return custom class objects into untrusted
code (e.g. from external methods) you need to set security
declarations on them - at least add the attribute:
__allow_access_to_unprotected_subobjects=1 

(from top of head - just grep -r zopes source
for the actual name)
HTH
Tino
 

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


[Zope] newbie:cookie expiry problem

2005-04-12 Thread prabuddha ray
This may be very silly plz help
I gave this cookie expiry statement in a python script:


RESPONSE.expireCookie('login')

return context.REQUEST.RESPONSE.redirect('index_html')

but when i checked the cookie values in request page, it wasn't removed. 
the last redirect still worked.

when i put an if like this :
if (RESPONSE.expireCookie('login'))

return context.REQUEST.RESPONSE.redirect('index_html')

redirect dont work.

where am i wrong.
-- 
Share the vision of difference with ME
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] developer docs

2005-04-12 Thread Milos Prudek
What are the best documents for creating Zope products?
I know Zope Book very well and I write TTW scripts. I need to convert a 
bunch of ZClasses into Products.

ZDG seems very outdated. Should I start with mxmEasyProduct and then 
read ZDG? Is there a book available in bookshops that is better than ZDG 
and contains all required information for building products?

--
Milos Prudek
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] developer docs

2005-04-12 Thread Andreas Jung

--On Dienstag, 12. April 2005 13:46 Uhr +0200 Milos Prudek [EMAIL PROTECTED] 
wrote:
ZDG seems very outdated. Should I start with mxmEasyProduct and then read
ZDG? Is there a book available in bookshops that is better than ZDG and
contains all required information for building products?
Why is it out-dated? Most things are still valid. If not, point them out to 
be
corrected or even better: help producing a never version of the ZDG.

-aj


pgpqlq85nAKML.pgp
Description: PGP signature
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] The Zope Book

2005-04-12 Thread Chris McDonough
No, sorry.  THe canonical version is on the web.

- C

On Tue, 2005-04-12 at 04:10, Dario Lopez-Ksten wrote:
 Chris McDonough wrote:
  I don't think anyone has given much thought to actually documenting all
  these nice nifty features in 2.9.  Which is no change from the norm, and
  it will be a fairly organic process again.  I hate it, but whatever.
  
  - C
  
 
 Speaking of which, and being one of the people that promised to deliver 
 but has not done so 100% yet, is it possible to checkout the Zope Book 
 from cvs or svn?
 
 That'd help a lot in terms of incrementally adding stuff, at least for me.
 
 Thanks,
 
 /dario

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


Re: [Zope] developer docs

2005-04-12 Thread Milos Prudek
 Why is it out-dated? Most things are still valid. If not, point them out
 to be
 corrected or even better: help producing a never version of the ZDG.
Hello Andreas,
This kind of response is so common that it deserves a shortcut of its 
own. Such as RTFM. You essentially told me to f*k off. But I did not 
attack ZDG.

ZDG has some outdated parts. You admit that. By following it, I will 
create incorrect code or use obsolete constructs. At least that is what 
reader comments say in ZDG. Well, I do not want to create obsolete 
constructs.

I am looking for a book that will help me. That is all.
--
Milos Prudek
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] developer docs

2005-04-12 Thread Andreas Jung
--On Dienstag, 12. April 2005 15:02 Uhr +0200 Milos Prudek [EMAIL PROTECTED] 
wrote:

  Why is it out-dated? Most things are still valid. If not, point them
out
  to be
  corrected or even better: help producing a never version of the ZDG.
Hello Andreas,
This kind of response is so common that it deserves a shortcut of its
own. Such as RTFM. You essentially told me to f*k off. But I did not
attack ZDG.
I never said that - neither directly nor between the lines.
ZDG has some outdated parts. You admit that.
I haven't had the ZDG in my hands lately. But from that what  I have in 
memory
most things are still true because the basic haven't changed. If yes, point
them out instead of make such comments.

By following it, I will
create incorrect code or use obsolete constructs. At least that is what
reader comments say in ZDG. Well, I do not want to create obsolete
constructs.
It is your good right to expect documentation but documentation has to be 
written
and maintained. Means: someone has to volunteer and take over *some* 
responsibilities.
Complaining about missing, out-dated docs or whatever is one side of the 
medal, helping
to improve thing is the other side *wink*

And don't be pissed off when I try to point out that the community also 
has to take over
some tasks instead of only having expectations.

-aj


pgpJyb5lG9Uuy.pgp
Description: PGP signature
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] developer docs

2005-04-12 Thread Cliff Ford
Milos Prudek wrote:
What are the best documents for creating Zope products?
I know Zope Book very well and I write TTW scripts. I need to convert a 
bunch of ZClasses into Products.

ZDG seems very outdated. Should I start with mxmEasyProduct and then 
read ZDG? Is there a book available in bookshops that is better than ZDG 
and contains all required information for building products?

I don't know about best documents! There is a minimal Product How To:
http://www.zope.org/Members/maxm/HowTo/minimal_01/
Faced with the same problem (conversion of ZClasses to file system 
Products), I decided to have a look at Zope3X. There are a couple of 
good new books with worked examples - but as soon as I stepped off the 
guided path I found myself struggling. Still, I think I can see how to 
go from 2.7 to 3 and not bother with ZClasses.

Cliff
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] developer docs

2005-04-12 Thread Stephan Richter
On Tuesday 12 April 2005 09:47, Cliff Ford wrote:
 Faced with the same problem (conversion of ZClasses to file system
 Products), I decided to have a look at Zope3X. There are a couple of
 good new books with worked examples - but as soon as I stepped off the
 guided path I found myself struggling. Still, I think I can see how to
 go from 2.7 to 3 and not bother with ZClasses.

I'll note that we *try* to answer questions on the zope3-users mailing list in 
a timely fashion. If noone response to your question there, it is usually 
because it is a harder problem. ;-)

Regards,
Stephan
-- 
Stephan Richter
CBU Physics  Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] developer docs

2005-04-12 Thread Milos Prudek
 It is your good right to expect documentation but documentation has to
 be written
I've written about 50 pages of rather detailed documentation for Zope 
Page Templates and it is available online at www.root.cz. But not in 
English. So I know, understand and follow the concept you mentioned.

I do not feel I can contribute to ZDG at this time. Is there any other 
resource you can recommend, please?

--
Milos Prudek
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] developer docs

2005-04-12 Thread Milos Prudek

I'll note that we *try* to answer questions on the zope3-users mailing list in 
a timely fashion. If noone response to your question there, it is usually 
because it is a harder problem. ;-)
I found out that you wrote a book about Zope 3 that gather raving 
reviews on Amazon. Does the book contain all info required to develop 
products (or whatever are they called in Zope 3) for Zope 3?

--
Milos Prudek
http://www.spoxdesign.com - your web usability testing
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] developer docs

2005-04-12 Thread Stephan Richter
On Tuesday 12 April 2005 11:01, Milos Prudek wrote:
  I'll note that we *try* to answer questions on the zope3-users mailing
  list in a timely fashion. If noone response to your question there, it is
  usually because it is a harder problem. ;-);-)

 I found out that you wrote a book about Zope 3 that gather raving
 reviews on Amazon. Does the book contain all info required to develop
 products (or whatever are they called in Zope 3) for Zope 3?

Yes. In Zope X3.0 you can only develop filesystem-based Python packages, so in 
fact this is all the book covers. Section C has a fairly complex example of a 
message board application, complete with simple and containerish content 
objects. Other sections of the book cover the development of different 
components using filesystem-based development.

Regards,
Stephan
-- 
Stephan Richter
CBU Physics  Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] developer docs

2005-04-12 Thread Milos Prudek
I don't know about best documents! There is a minimal Product How To:
http://www.zope.org/Members/maxm/HowTo/minimal_01/
That's exactly what I was looking for. Thanks!
--
Milos Prudek
http://www.spoxdesign.com - your web usability testing
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] Security on email.Message.Message

2005-04-12 Thread Tim Hicks
Hi,

I'm trying to import and use the email.Message.Message class in a zope
'Script (Python)'.

I have the following security assertions in my product code::

  from AccessControl import allow_module, allow_class
  from AccessControl import ModuleSecurityInfo

  ModuleSecurityInfo('email.Message').declarePublic('Message')
  from email.Message import Message
  allow_class(Message)

As a result, I can successfully import like::

  from email.Message import Message

I can even create an instance and call most methods on it::

  m = Message()
  m.set_payload('read that')

However, when I try to use the mapping interface, I get an error.  For
example, the following::

  m['from'] = '[EMAIL PROTECTED]'

produces a traceback like::

  Traceback (innermost last):
Module ZPublisher.Publish, line 101, in publish
Module ZPublisher.mapply, line 88, in mapply
Module ZPublisher.Publish, line 39, in call_object
Module Shared.DC.Scripts.Bindings, line 306, in __call__
Module Shared.DC.Scripts.Bindings, line 343, in _bindAndExec
Module Products.PythonScripts.PythonScript, line 323, in _exec
Module None, line 6, in AAA
 - PythonScript at /test/AAA
 - Line 6
Module RestrictedPython.Guards, line 96, in handler
  TypeError: object does not support item or slice assignment

Does anyone have any idea what the problem is?


Tim

ps Not subscribed here, so please do cc me with replies.
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Security on email.Message.Message

2005-04-12 Thread Andreas Jung

--On Dienstag, 12. April 2005 16:18 Uhr +0100 Tim Hicks 
[EMAIL PROTECTED] wrote:

Hi,
I'm trying to import and use the email.Message.Message class in a zope
'Script (Python)'.
I have the following security assertions in my product code::
  from AccessControl import allow_module, allow_class
  from AccessControl import ModuleSecurityInfo
  ModuleSecurityInfo('email.Message').declarePublic('Message')
  from email.Message import Message
  allow_class(Message)
As a result, I can successfully import like::
  from email.Message import Message
I can even create an instance and call most methods on it::
  m = Message()
  m.set_payload('read that')
However, when I try to use the mapping interface, I get an error.  For
example, the following::
  m['from'] = '[EMAIL PROTECTED]'
produces a traceback like::
  Traceback (innermost last):
Module ZPublisher.Publish, line 101, in publish
Module ZPublisher.mapply, line 88, in mapply
Module ZPublisher.Publish, line 39, in call_object
Module Shared.DC.Scripts.Bindings, line 306, in __call__
Module Shared.DC.Scripts.Bindings, line 343, in _bindAndExec
Module Products.PythonScripts.PythonScript, line 323, in _exec
Module None, line 6, in AAA
 - PythonScript at /test/AAA
 - Line 6
Module RestrictedPython.Guards, line 96, in handler
  TypeError: object does not support item or slice assignment
Does anyone have any idea what the problem is?
Move your code into an external method which is less painful than dealing
with module security issues. As an alternative: look at TrustedExecutables.
-aj

pgpIV267dYumO.pgp
Description: PGP signature
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Security on email.Message.Message

2005-04-12 Thread Tim Hicks
Andreas Jung said:

 Module RestrictedPython.Guards, line 96, in handler
   TypeError: object does not support item or slice assignment

 Does anyone have any idea what the problem is?

 Move your code into an external method which is less painful than dealing
 with module security issues. As an alternative: look at
 TrustedExecutables.

Thanks Andreas.

I suppose I could move the code to a product (which I would prefer over an
external method), but it seems a little heavy-weight for my requirements.

In fact, generally, I think I would like to be able to use
email.Message.Message instances in TTW code, so if anyone does know what's
going wrong here, I'd be most pleased to hear.

Tim

ps Is it me or is the traceback I'm seeing not particularly helpful?  I
mean, I know that these objects *do* support the dictionary interface!
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] developer docs

2005-04-12 Thread Milos Prudek
Yes. In Zope X3.0 you can only develop filesystem-based Python packages, so in 
Well, then your book debuted at number 1 on my book shopping list.
--
Milos Prudek
http://www.spoxdesign.com - your web usability testing
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] developer docs

2005-04-12 Thread Stephan Richter
On Tuesday 12 April 2005 11:47, Milos Prudek wrote:
  Yes. In Zope X3.0 you can only develop filesystem-based Python packages,
  so in

 Well, then your book debuted at number 1 on my book shopping list.

Cool. :-)

Regards,
Stephan
-- 
Stephan Richter
CBU Physics  Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Security on email.Message.Message

2005-04-12 Thread Tim Hicks
Andreas Jung said:

 Module RestrictedPython.Guards, line 96, in handler
   TypeError: object does not support item or slice assignment

 Does anyone have any idea what the problem is?

Digging further...

I made the TypeError a little more revealing on line 96 of
RestrictedPython/Guards.py so it now shows the 'secattr' (method) being
accessed, and its args::

def handler(self, *args):
try:
f = getattr(self.ob, secattr)
except AttributeError:
raise TypeError, '%s | %s | %s' % (error_msg, secattr,
str(args))

The value of 'secattr' is apparently '__guarded_setitem__' in my case. 
So, it seems that the email.Message.Message class does not have a
__guarded_setitem__ on it.  This is unsurprising.  I assume that it is
supposed to get added during zope initialisation somewhere, right?  Can
anybody point out where?

Tim
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] developer docs

2005-04-12 Thread Paul Winkler
On Tue, Apr 12, 2005 at 04:37:58PM +0200, Milos Prudek wrote:
 I do not feel I can contribute to ZDG at this time. Is there any other 
 resource you can recommend, please?

ZDG is really it.  It could use some cleanup to fold in the
comments and errata that are posted to the online version.
For now, just read the ZDG and heed the comments.

I personally do not use mxmEasyProduct. I did at one point, but I found
that while it's a timesaver for trivial things, I ended up having to
understand plain old Product development anyway, anytime I wanted to do
something different, plus I had to figure out how mxmMinimal worked.
That's typical of frameworks that hide details from you...
great until you want the details back ;-)

Rather, I would look at the venerable old Boring and Minimal 
example products.  (But be aware that Boring (last time I looked)
used the old-style security declarations.  Instead
of an __ac_permissions__ attribute, you should use
ClassSecurityInfo as shown in, well, just about any Product
you have lying around.)

I know, this all screams for an organized, updated effort :-(

-- 

Paul Winkler
http://www.slinkp.com
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] developer docs

2005-04-12 Thread Milos Prudek
Rather, I would look at the venerable old Boring and Minimal 
example products.  (But be aware that Boring (last time I looked)
Oh yes, I will look at those. Thanks for the supporting documentation in 
your post.

--
Milos Prudek
http://www.spoxdesign.com - your web usability testing
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Security on email.Message.Message

2005-04-12 Thread Tim Hicks
Tim Hicks said:
 Andreas Jung said:

 Module RestrictedPython.Guards, line 96, in handler
   TypeError: object does not support item or slice assignment

 Does anyone have any idea what the problem is?

 Digging further...

 I made the TypeError a little more revealing on line 96 of
 RestrictedPython/Guards.py so it now shows the 'secattr' (method) being
 accessed, and its args::

 def handler(self, *args):
 try:
 f = getattr(self.ob, secattr)
 except AttributeError:
 raise TypeError, '%s | %s | %s' % (error_msg, secattr,
 str(args))

 The value of 'secattr' is apparently '__guarded_setitem__' in my case.
 So, it seems that the email.Message.Message class does not have a
 __guarded_setitem__ on it.  This is unsurprising.  I assume that it is
 supposed to get added during zope initialisation somewhere, right?  Can
 anybody point out where?

Well, I've fixed this with an awful hack.  My security assertions now look
like::

  from AccessControl import allow_module, allow_class
  from AccessControl import ModuleSecurityInfo

  def _secure_mapping(klass):
  XXX Awful hack!!
  
  klass.__guarded_getitem__ = klass.__getitem__
  klass.__guarded_setitem__ = klass.__setitem__
  klass.__guarded_delitem__ = klass.__delitem__

  ModuleSecurityInfo('email.Message').declarePublic('Message')
  from email.Message import Message
  _secure_mapping(Message)
  allow_class(Message)

That gets me to where I want (for now).  I'd still love the 'correct'
answer though.


Tim

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


Re: [Zope] Session without cookies.

2005-04-12 Thread Fernando Lujan
Jens Vagelpohl wrote:
On Apr 12, 2005, at 1:02, Fernando Lujan wrote:
The URL test1 in the form tag is obviously *not* generated by 
Zope. You put it in there manually. So it cannot work as you expect.

Hum, I see. Just web pages that aren't dinamically generated by Zope. 
For instance, other DTML document will not keep the Session. Is this 
correct?

No, you misunderstand what Chris said earlier. You need to let Zope 
generate the URL. In this case, instead of just saying...

form action=test1
you could do
form action=dtml-var test1.absolute_url()
of course that's ugly because it looks like putting a tag inside a 
tag, ZPT is much nicer that way:

form action= tal:attributes=action here/test1/absolute_url

Thanks, jens... Now I acquire my goal! ;)
Fernando Lujan

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


[Zope] ZEO and Sessions.

2005-04-12 Thread Fernando Lujan
Hi again people,
I've just read the article about SESSIONS in the upcoming ZOPE Book 2.7.
Here, we have ZEO running, and I need to use SESSION and ZEO. I read the 
article http://www.zope.org/Members/randy/ZEO-Sessions.

Isn't there a easy way to do this? I was wondering if I couldn just 
createa new filestorage entry in the zeo.conf, and add some lines in my 
zope.conf file.

Thanks.
Fernando Lujan
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] ZEO and Sessions.

2005-04-12 Thread Chris McDonough
Yes.

All the information in that article is geared for Zope 2.5 which had no
facility for using mounted databases from a config file... everything up
until At this time you should be able to navigate to the
/session_storage folder... in that article can be done by reconfiguring
ZEO using zeo.conf to serve a new storage, changing your ZEO clients'
zope.conf files to recognize the new storage and adding a ZODB Mount
Point from within the ZMI from one of the appservers.  The rest of it
is pretty simple. ;-)

- C


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


[Zope] Q: Embedding documentation in Page Templates?

2005-04-12 Thread Stephen Nesbitt
All:

Does anyone know of a way of embedding documentation directly into a page 
template without using !-- --? In other words is there some construct which 
tells the rendering engine to simply ignore some content.?

Thanks,

-steve
-- 


Stephen Nesbitt
Senior Configuration Management Engineer
The Cobalt Group
[EMAIL PROTECTED]
x8271
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Q: Embedding documentation in Page Templates?

2005-04-12 Thread J Cameron Cooper
Stephen Nesbitt wrote:
All:
Does anyone know of a way of embedding documentation directly into a page 
template without using !-- --? In other words is there some construct which 
tells the rendering engine to simply ignore some content.?
I usually use
 tal:comment replace=nothing
  comment in here
 /tal:comment
There are other constructs, but I think this is most reasonable.
The tag can be anything, of course::
 span tal:replace=nothing
  comment in here
 /span
Come to think of it, that's a few less keystrokes. This is even shorter::
 a tal:replace=nothing
  comment in here
 /a
	--jcc
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] ZEO and Sessions.

2005-04-12 Thread Fernando Lujan
Chris McDonough wrote:
Yes.
All the information in that article is geared for Zope 2.5 which had no
facility for using mounted databases from a config file... everything up
until At this time you should be able to navigate to the
/session_storage folder... in that article can be done by reconfiguring
ZEO using zeo.conf to serve a new storage, changing your ZEO clients'
zope.conf files to recognize the new storage and adding a ZODB Mount
Point from within the ZMI from one of the appservers.  The rest of it
is pretty simple. ;-)
 

Please, take a look in what I've done! Is that right? It works pretty 
fine here! :-)

If this is right, are there a desire for a how-to? I think I can write 
one, once it's pretty simple as you said.

zope.conf
zodb_db main
 mount-point /temp_folder
 container-class Products.TemporaryFolder.TemporaryContainer
 # ZODB cache, in number of objects
 cache-size 5000
 zeoclient
   server localhost:8100
  storage 1
   name zeostorage
   var $INSTANCE/var
   # ZEO client cache, in bytes
   cache-size 20MB
   # Uncomment to have a persistent disk cache
   #client zeo1
 /zeoclient
/zodb_db
zodb_db temporary
 mount-point /
 # ZODB cache, in number of objects
 cache-size 5000
 zeoclient
   server localhost:8100
  storage 2
   name zeotemporary
   var $INSTANCE/var
   # ZEO client cache, in bytes
   cache-size 20MB
   # Uncomment to have a persistent disk cache
   #client zeo1
 /zeoclient
/zodb_db

zeo.conf
# ZEO configuration file
%define INSTANCE /home/flujan/tmp/zeo
zeo
 address 8100
 read-only false
 invalidation-queue-size 100
 # monitor-address PORT
 # transaction-timeout SECONDS
/zeo
filestorage 1
 path $INSTANCE/var/Data.fs
/filestorage
filestorage 2
 path $INSTANCE/var/SessionData.fs
/filestorage
eventlog
 level info
 logfile
   path $INSTANCE/log/zeo.log
 /logfile
/eventlog
runner
 program $INSTANCE/bin/runzeo
 socket-name $INSTANCE/etc/zeo.zdsock
 daemon true
 forever false
 backoff-limit 10
 exit-codes 0, 2
 directory $INSTANCE
 default-to-interactive true
 # user zope
 python /usr/bin/python2.3
 zdrun /usr/local/zope-2.7.5/lib/python/zdaemon/zdrun.py
 # This logfile should match the one in the zeo.conf file.
 # It is used by zdctl's logtail command, zdrun/zdctl doesn't write it.
 logfile $INSTANCE/log/zeo.log
/runner
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] ZEO and Sessions.

2005-04-12 Thread Chris McDonough
On Tue, 2005-04-12 at 18:23, Fernando Lujan wrote:
 Please, take a look in what I've done! Is that right? It works pretty 
 fine here! :-)

If it works for you, it's right. ;-)

 
 If this is right, are there a desire for a how-to? I think I can write 
 one, once it's pretty simple as you said.

Sure, if you'd like... we could point to it from that chapter...

- C


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


Re: [Zope] Q: Embedding documentation in Page Templates?

2005-04-12 Thread Paul Winkler
On Tue, Apr 12, 2005 at 04:49:26PM -0500, J Cameron Cooper wrote:
 Stephen Nesbitt wrote:
 All:
 
 Does anyone know of a way of embedding documentation directly into a page 
 template without using !-- --? In other words is there some construct 
 which tells the rendering engine to simply ignore some content.?
 
 I usually use
 
  tal:comment replace=nothing
   comment in here
  /tal:comment
 
 There are other constructs, but I think this is most reasonable.
 
 The tag can be anything, of course::
 
  span tal:replace=nothing
   comment in here
  /span
 
 Come to think of it, that's a few less keystrokes. This is even shorter::
 
  a tal:replace=nothing
   comment in here
  /a

Of those, I like your first: it explicitly says comment.
Even somebody unfamiliar with ZPT can probably figure out
what that means.
 
-- 

Paul Winkler
http://www.slinkp.com
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] ZEO and Sessions.

2005-04-12 Thread Richard Jones
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Wed, 13 Apr 2005 05:47 am, Fernando Lujan wrote:
 Isn't there a easy way to do this? I was wondering if I couldn just
 createa new filestorage entry in the zeo.conf, and add some lines in my
 zope.conf file.

Is there a viable non-versioned alternative to the filestorage approach? My 
sessions database grows ridiculously quickly. I'm also fairly sure it's 
causing problems when my site gets ~5 requests a second (yes, that low)

Maybe one of these days I'll have time to look into SQLSession, but I'm not 
sure how well it will be able to replace the core session handling (and it 
does need to seamlessly replace it). I wonder how hard it'd be to write a new 
Session Data Manager using an RDBMS as the backend, or even just a filesystem 
approach that didn't use versioning. *shrug*. Mmm. Transactions.


Richard
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFCXFUJrGisBEHG6TARAphlAJ4hp/D6u0l/7G1MEhuEsLgykYASfACeNDm0
2CngEMS5lvja4vf2lSuCP5U=
=+7Se
-END PGP SIGNATURE-
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] METALError:incompatible version error when try to do use-macro and python script

2005-04-12 Thread Gautam Saha
Hi:
I am getting a METALError when I try to do use-macro in ZPT.
Here is my code  in main_template.pt
.
..
 div metal:use-macro=here/subtab/macros/tools_sub
 /div
 div metal:use-macro=python:here.getSubTab()
 /div


The first  use-macro works (as I put the full macro path), But the 2nd 
call does not work
and giving the error.
I am basically returning  'here/subtab/macros/tools_sub' from the 
getSubTab() py
script. ( my script has one line for testing - return  
'here/subtab/macros/tools_sub'

Any help to resolve this is greatly appreciated.
Thanks,
Gautam
---
Zope/Plone spec:
Zope Version: (Zope 2.7.3-0, python 2.3.4, freebsd5)
Python Version: 2.3.4 (#2, Oct 21 2004, 17:49:27) [GCC 3.3.3 [FreeBSD] 
20031106]
Plone 2.0.4

===
Site Error
An error was encountered while publishing this resource.
METALError
Sorry, a site error occurred.
Traceback (innermost last):
   * Module ZPublisher.Publish, line 175, in publish_module_standard
   * Module Products.PlacelessTranslationService.PatchStringIO, line 
51, in new_publish
   * Module ZPublisher.Publish, line 132, in publish
   * Module Zope.App.startup, line 204, in zpublisher_exception_hook
   * Module ZPublisher.Publish, line 101, in publish
   * Module ZPublisher.mapply, line 88, in mapply
   * Module ZPublisher.Publish, line 39, in call_object
   * Module Products.CMFCore.PortalContent, line 116, in __call__
   * Module Shared.DC.Scripts.Bindings, line 306, in __call__
   * Module Shared.DC.Scripts.Bindings, line 343, in _bindAndExec
   * Module Products.CMFCore.FSPageTemplate, line 191, in _exec
   * Module Products.CMFCore.FSPageTemplate, line 124, in pt_render
   * Module Products.PageTemplates.PageTemplate, line 96, in pt_render
 FSPageTemplate at /21cif.imsa.edu/frontpage_view used for 
/21cif.imsa.edu/index_html
   * Module TAL.TALInterpreter, line 190, in __call__
   * Module TAL.TALInterpreter, line 234, in interpret
   * Module TAL.TALInterpreter, line 671, in do_useMacro
   * Module TAL.TALInterpreter, line 234, in interpret
   * Module TAL.TALInterpreter, line 409, in do_optTag_tal
   * Module TAL.TALInterpreter, line 394, in do_optTag
   * Module TAL.TALInterpreter, line 389, in no_tag
   * Module TAL.TALInterpreter, line 234, in interpret
   * Module TAL.TALInterpreter, line 671, in do_useMacro
   * Module TAL.TALInterpreter, line 234, in interpret
   * Module TAL.TALInterpreter, line 409, in do_optTag_tal
   * Module TAL.TALInterpreter, line 394, in do_optTag
   * Module TAL.TALInterpreter, line 389, in no_tag
   * Module TAL.TALInterpreter, line 234, in interpret
   * Module TAL.TALInterpreter, line 664, in do_useMacro

METALError: macro 'python:here.getSubTab()' has incompatible version 
None, at line 88, column 4 (Also, an error occurred while attempting to 
render the standard error message.)

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


Re: [Zope] METALError:incompatible version error when try to do use-macro and python script

2005-04-12 Thread Andrew Milton
+---[ Gautam Saha ]--
| Hi:
| 
| I am getting a METALError when I try to do use-macro in ZPT.
| 
| Here is my code  in main_template.pt
| .
| ..

[snip]

|  div metal:use-macro=python:here.getSubTab()
|  /div
| 
| 
| 

[snip]

| I am basically returning  'here/subtab/macros/tools_sub' from the 
| getSubTab() py
| script. ( my script has one line for testing - return  
| 'here/subtab/macros/tools_sub'
| 
| Any help to resolve this is greatly appreciated.

You actually have to return a macro, not a string representing the path to the
macro. Your script will have to return here.subtab.macros['tools_sub']
I think that's the right format.

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


Re: [Zope] ZEO and Sessions.

2005-04-12 Thread Richard Jones
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Wed, 13 Apr 2005 09:44 am, you wrote:
 On Tue, 2005-04-12 at 19:08, Richard Jones wrote:
  Is there a viable non-versioned alternative to the filestorage approach?
  My sessions database grows ridiculously quickly. I'm also fairly sure
  it's causing problems when my site gets ~5 requests a second (yes, that
  low)

 You could use temporarystorage on the ZEO server if you don't really
 need your session data to be persistent across ZEO server restarts.
 This is what Fernando appeared to do in the end.

Having sessions persist across ZEO restarts is a handy thing.

Also, I never figured how to configure a temp storage in a ZEO server. I 
started looking once, but either ran into a dead end or got distracted (or 
both ;)


 There are no well-maintained nonundoing storages that I know of other
 than temporarystorage.  Once upon a time, BerkeleyStorage minimal used
 to work, but its gone the way of the dinosaurs apparently.

And I distrust anything related to Berkely DB :)


 I think any sessioning setup that uses a ZEO-backed storage will be more
 conflict-prone than one that doesn't use ZEO, just because the
 transaction commit time is typically longer.  I'm not sure if this is
 the problem you mention.

Could be.


 Probably not hard.  You could write a session data manager
 implementation that used a relational database.  The interface for those
 things is in Products/Sessions/SessionInterfaces.py

Yeah, I remember poking around that code way back, and it seemed reasonable. 
Its interactions with transactions are the bits that scare me. Using a 
standard RDBMS connection would probably solve that though.


Richard
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFCXGFkrGisBEHG6TARAkp7AJ9xavG5iY4wQjGLkdjGmvqxn/mDoACfRXsh
5vLa0EwojCSZlBAi7e1Vuqo=
=WTon
-END PGP SIGNATURE-
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] ZEO and Sessions.

2005-04-12 Thread Chris McDonough
On Tue, 2005-04-12 at 19:08, Richard Jones wrote:
 Is there a viable non-versioned alternative to the filestorage approach? My 
 sessions database grows ridiculously quickly. I'm also fairly sure it's 
 causing problems when my site gets ~5 requests a second (yes, that low)

You could use temporarystorage on the ZEO server if you don't really
need your session data to be persistent across ZEO server restarts. 
This is what Fernando appeared to do in the end.

There are no well-maintained nonundoing storages that I know of other
than temporarystorage.  Once upon a time, BerkeleyStorage minimal used
to work, but its gone the way of the dinosaurs apparently.

I think any sessioning setup that uses a ZEO-backed storage will be more
conflict-prone than one that doesn't use ZEO, just because the
transaction commit time is typically longer.  I'm not sure if this is
the problem you mention.

 Maybe one of these days I'll have time to look into SQLSession, but I'm not 
 sure how well it will be able to replace the core session handling (and it 
 does need to seamlessly replace it). I wonder how hard it'd be to write a new 
 Session Data Manager using an RDBMS as the backend, or even just a filesystem 
 approach that didn't use versioning. *shrug*. Mmm. Transactions.

Probably not hard.  You could write a session data manager
implementation that used a relational database.  The interface for those
things is in Products/Sessions/SessionInterfaces.py

- C


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


[Zope] Re: ZEO and Sessions.

2005-04-12 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Richard Jones wrote:
 On Wed, 13 Apr 2005 09:44 am, Chris McDonough wrote:

Probably not hard.  You could write a session data manager
implementation that used a relational database.  The interface for those
things is in Products/Sessions/SessionInterfaces.py
 
 
 Yeah, I remember poking around that code way back, and it seemed reasonable. 
 Its interactions with transactions are the bits that scare me. Using a 
 standard RDBMS connection would probably solve that though.


I revisited the SQLSession product a year ago for a consuling customer,
making their hacked version a drop-in replacement for the transient
storage.  I can't release their code, but I maybe learned enough then to
redo the task as a PluggableSessions product, using the
PluginRegistry product to manage the different requried bits.


Tres.
- --
===
Tres Seaver[EMAIL PROTECTED]
Zope Corporation  Zope Dealers   http://www.zope.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.5 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCXGYNGqWXf00rNCgRAqgqAJ9YjRNE1yqZKOXrl4nWlLCNaa/LvwCffVLH
nqNZzuOutIv9hMTkIWfPu1w=
=rrHr
-END PGP SIGNATURE-
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] ZEO and Sessions.

2005-04-12 Thread Chris McDonough
On Tue, 2005-04-12 at 20:01, Richard Jones wrote:
 On Wed, 13 Apr 2005 09:44 am, you wrote:
  On Tue, 2005-04-12 at 19:08, Richard Jones wrote:
   Is there a viable non-versioned alternative to the filestorage approach?
   My sessions database grows ridiculously quickly. I'm also fairly sure
   it's causing problems when my site gets ~5 requests a second (yes, that
   low)
 
  You could use temporarystorage on the ZEO server if you don't really
  need your session data to be persistent across ZEO server restarts.
  This is what Fernando appeared to do in the end.
 
 Having sessions persist across ZEO restarts is a handy thing.

Yup.  I've not really needed it so far, but if you need it, you need
it...

 Also, I never figured how to configure a temp storage in a ZEO server. I 
 started looking once, but either ran into a dead end or got distracted (or 
 both ;)

Probably something like what Fernando had on the client:

zodb_db temporary
  mount-point /foo/bar
  # ZODB cache, in number of objects
  cache-size 5000
  zeoclient
server localhost:8999
storage temp
name zeotemporary
var $INSTANCE/var
# ZEO client cache, in bytes
cache-size 20MB
# Uncomment to have a persistent disk cache
#client zeo1
  /zeoclient
/zodb_db

And in the ZEO server's zeo.conf file:

%import tempstorage
temporarystorage temp
   name sessions
/temporarystorage

This resource is useful too:

http://longsleep.org/howto/sharesessionwithzeo

  There are no well-maintained nonundoing storages that I know of other
  than temporarystorage.  Once upon a time, BerkeleyStorage minimal used
  to work, but its gone the way of the dinosaurs apparently.
 
 And I distrust anything related to Berkely DB :)

I hear ya! ;-)

  I think any sessioning setup that uses a ZEO-backed storage will be more
  conflict-prone than one that doesn't use ZEO, just because the
  transaction commit time is typically longer.  I'm not sure if this is
  the problem you mention.
 
 Could be.

It'd be pretty obvious with an inordinate number of conflict errors in
the event log.  inordinate is relative, though, so I'm not sure what
to name as a number per minute for your app.  You can get a sense of
what's normal under contrived load by reading:

http://www.plope.com/Members/dunny/conflicts/view

  Probably not hard.  You could write a session data manager
  implementation that used a relational database.  The interface for those
  things is in Products/Sessions/SessionInterfaces.py
 
 Yeah, I remember poking around that code way back, and it seemed reasonable. 
 Its interactions with transactions are the bits that scare me. Using a 
 standard RDBMS connection would probably solve that though.

Yeah.  Probably OK to use a ZRDB connection, those are controlled
automatically.

- C


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


[Zope] too big data.fs

2005-04-12 Thread Jianping Zhu
I have redhat 9.0 with zope on it. the size data.fs is 3.2 GB. my
question is
1. how can find to size of folder and file inside data.fs, So i can ask
the idiot who upload large file to zope to delete it.

2, Recentlt i often get troulble of  losing network connection of my
redhat server, is there any relation between the large data.fs and the
disconnetion?

Thanks
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] too big data.fs

2005-04-12 Thread Andreas Jung

--On Dienstag, 12. April 2005 22:06 Uhr -0400 Jianping Zhu 
[EMAIL PROTECTED] wrote:

I have redhat 9.0 with zope on it. the size data.fs is 3.2 GB. my
question is
3.2 GB is nothing I would call *large* or *big*.

1. how can find to size of folder and file inside data.fs, So i can ask
the idiot who upload large file to zope to delete it.
There are some tools in the Zope distro (utitlites/zodbtools I think) to 
dump
a Data.fs file and to figure out details.

2, Recentlt i often get troulble of  losing network connection of my
redhat server, is there any relation between the large data.fs and the
disconnetion?
Unlikely.
-aj


pgpieA9sOcJpV.pgp
Description: PGP signature
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] newbie:cookie expiry problem

2005-04-12 Thread prabuddha ray
This may be very silly plz help
I gave this cookie expiry statement in a python script:

RESPONSE.expireCookie('login')

return context.REQUEST.RESPONSE.redirect('index_html')

but when i checked the cookie values in request page, it wasn't removed. 
the last redirect still worked.

when i put an if like this :
if (RESPONSE.expireCookie('login'))

return context.REQUEST.RESPONSE.redirect('index_html')

redirect didn't work. where am i wrong?
all the files are in same folder

-- 
Share the vision of difference with ME
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope-DB] Returning values from Oracle function/procedure withZSQLMethod

2005-04-12 Thread Matthew T. Kromer
Chris Withers's branch of DCOracle2 has some changes that help the 
connection pooling problem.

The issue basically is that the Zope adapter for DCOracle2 is fairly 
old and crusty.  I think Jim's correct when he suggests doing your own 
pool management from a module.

All that the DA is supposed to give you is a pool of connection objects 
and Zope transaction manager awareness.   There's a little more to it 
than that, but the Zope DA is so old -- it derives from a product that 
predates Zope 2.  It would probably be solved best by *jettisoning* 
Zope.Shared.RDBMS code, but...

I don't actively maintain the code base any more (I haven't for about 
18 months).  It isn't totally abandoned, but I don't work with Oracle 
at work any more, and so I don't have much of an itch to scratch to fix 
problems.  My home installs of Oracle have all gotten clobbered by 
entropy (read: re-installs of Linux to counter failed hardware).

You can also consider using e-Genix's mxODBC adapter.
On Apr 8, 2005, at 6:58 PM, Cynthia Kiser wrote:
Quoting Jim Abramson [EMAIL PROTECTED]:
In our experience we ended up needing to do increasingly complex
things with plsql, and ultimately, we had no choice to move all our
db access out into ExternalMethods or Products and use DCOracle2
directly.  This does require constructing your own connection
pool/management, but once you've built that you can leverage
DCOracle2 directly in python and this provides much more
flexibility.
When you do our own connection management, are you able to avoid
DCOracle2 leaking connections? In our Zope 2.6.1/DCOracle2-1.3b
server, we accumulate sessions where Oracle is waiting for a response
from Zope, but Zope apparently thinks it closed that connection and
opened a new one. Manually closing and reopening the connection does
not clean up the forgotten sessions, so I periodically (~monthly)
restart the Zope server to clean up. Killing the Zope processes
seems to finally signal Oracle (on a remote machine) that the client
is no longer interested in those old open sessions.
The smidge of testing I did with DCOracle2 from the command line left
me with the impression that its connection closing function did not
work. I could close a connection - and then still use it to talk to my
database. I wasn't really sure enough of those tests to report this as
a bug, but it is vaguely troubling.
--
Cynthia Kiser
___
Zope-DB mailing list
Zope-DB@zope.org
http://mail.zope.org/mailman/listinfo/zope-db
___
Zope-DB mailing list
Zope-DB@zope.org
http://mail.zope.org/mailman/listinfo/zope-db