[Zope-Checkins] SVN: Zope/branches/ajung-zpt-end-game/lib/python/Products/PageTemplates/PageTemplateFile.py clean up, missing imports, missing logger

2006-05-08 Thread Philipp von Weitershausen
Log message for revision 68030:
  clean up, missing imports, missing logger
  

Changed:
  U   
Zope/branches/ajung-zpt-end-game/lib/python/Products/PageTemplates/PageTemplateFile.py

-=-
Modified: 
Zope/branches/ajung-zpt-end-game/lib/python/Products/PageTemplates/PageTemplateFile.py
===
--- 
Zope/branches/ajung-zpt-end-game/lib/python/Products/PageTemplates/PageTemplateFile.py
  2006-05-08 18:09:21 UTC (rev 68029)
+++ 
Zope/branches/ajung-zpt-end-game/lib/python/Products/PageTemplates/PageTemplateFile.py
  2006-05-08 18:16:32 UTC (rev 68030)
@@ -12,30 +12,27 @@
 ##
 
 import os
+from logging import getLogger
 
-from Globals import package_home, InitializeClass
+import AccessControl
+from Globals import package_home, InitializeClass, DevelopmentMode
 from App.config import getConfiguration
 from Acquisition import aq_parent, aq_inner
-from ZopePageTemplate import ZopePageTemplate
-from zope.app.content_types import guess_content_type
-import AccessControl
-
 from ComputedAttribute import ComputedAttribute
 from OFS.SimpleItem import SimpleItem
-from Expressions import SecureModuleImporter
 from OFS.Traversable import Traversable
-from zope.pagetemplate.pagetemplatefile import PageTemplateFile as PTF
-from zope.pagetemplate.pagetemplate import PageTemplate as PT
-
 from Shared.DC.Scripts.Script import Script
-
-from OFS.SimpleItem import Item_w__name__
 from Shared.DC.Scripts.Signature import FuncCode
+from Products.PageTemplates.Engine import Engine
+from Products.PageTemplates.Expressions import SecureModuleImporter
+from Products.PageTemplates.ZopePageTemplate import guess_type
 
-from Engine import Engine
+from zope.contenttype import guess_content_type
+from zope.pagetemplate.pagetemplate import PageTemplate
 
+LOG = getLogger('PageTemplateFile')
 
-class PageTemplateFile(SimpleItem, Script, PT, Traversable):
+class PageTemplateFile(SimpleItem, Script, PageTemplate, Traversable):
  A Zope 2-aware wrapper class around the Zope 3 ZPT
 PageTemplateFile implementation.
 
@@ -56,9 +53,7 @@
 
 _default_bindings = {'name_subpath': 'traverse_subpath'}
 
-
 def __init__(self, filename, _prefix=None, **kw):
-
 name = None
 if kw.has_key('__name__'):
 name = kw['__name__']
@@ -83,8 +78,6 @@
 self.filename = filename
 
 content = open(filename).read()
-
-from ZopePageTemplate import guess_type
 self.pt_edit( content, guess_type(filename, content))
 
 

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


[Zope-Checkins] SVN: Zope/branches/ajung-zpt-end-game/lib/python/Products/PageTemplates/Engine.py clean up

2006-05-08 Thread Philipp von Weitershausen
Log message for revision 68031:
  clean up
  

Changed:
  U   
Zope/branches/ajung-zpt-end-game/lib/python/Products/PageTemplates/Engine.py

-=-
Modified: 
Zope/branches/ajung-zpt-end-game/lib/python/Products/PageTemplates/Engine.py
===
--- 
Zope/branches/ajung-zpt-end-game/lib/python/Products/PageTemplates/Engine.py
2006-05-08 18:16:32 UTC (rev 68030)
+++ 
Zope/branches/ajung-zpt-end-game/lib/python/Products/PageTemplates/Engine.py
2006-05-08 18:20:14 UTC (rev 68031)
@@ -11,18 +11,17 @@
 #
 ##
 
-
-from GlobalTranslationService import getGlobalTranslationService
-
 from zope.tales.tales import ExpressionEngine
-from zope.tales.expressions import PathExpr, StringExpr, NotExpr, DeferExpr, 
SubPathExpr
-from zope.tales.expressions import SimpleModuleImporter, _marker
+from zope.tales.expressions import PathExpr, StringExpr, NotExpr
+from zope.tales.expressions import DeferExpr, SubPathExpr
+from zope.tales.expressions import SimpleModuleImporter
 from zope.tales.pythonexpr import PythonExpr
 from zope.tales.tales import _valid_name, _parse_expr, NAME_RE, Undefined, 
Context 
 from zope.i18n import translate
 
-GTS = getGlobalTranslationService()
+from Products.PageTemplates.GlobalTranslationService import 
getGlobalTranslationService
 
+_marker = object()
 
 def BoboTraverseAwareSimpleTraverse(object, path_items, econtext):
  a slightly modified version of zope.tales.expressions.simpleTraverse()
@@ -68,10 +67,10 @@
 
 class Context(Context):
 
-
 def translate(self, msgid, domain=None, mapping=None, default=None):
-return GTS.translate(msgid, domain, mapping,
- context=self.contexts['context'], default=default)
+return getGlobalTranslationService().translate(
+msgid, domain, mapping,
+context=self.contexts['context'], default=default)
 
 def translate(self, domain, msgid, mapping=None,
   context=None, target_language=None, default=None):
@@ -108,4 +107,3 @@
 return e
 
 Engine = Engine()
-

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


[Zope-Checkins] SVN: Zope/branches/ajung-zpt-end-game/lib/python/Products/PageTemplates/Engine.py get rid of 2nd, less useful implementation of translate()

2006-05-08 Thread Philipp von Weitershausen
Log message for revision 68033:
  get rid of 2nd, less useful implementation of translate()
  correct argument order in useful implementation
  

Changed:
  U   
Zope/branches/ajung-zpt-end-game/lib/python/Products/PageTemplates/Engine.py

-=-
Modified: 
Zope/branches/ajung-zpt-end-game/lib/python/Products/PageTemplates/Engine.py
===
--- 
Zope/branches/ajung-zpt-end-game/lib/python/Products/PageTemplates/Engine.py
2006-05-08 18:25:50 UTC (rev 68032)
+++ 
Zope/branches/ajung-zpt-end-game/lib/python/Products/PageTemplates/Engine.py
2006-05-08 18:28:01 UTC (rev 68033)
@@ -67,15 +67,10 @@
 
 class Context(Context):
 
-def translate(self, msgid, domain=None, mapping=None, default=None):
-return getGlobalTranslationService().translate(
-msgid, domain, mapping,
-context=self.contexts['context'], default=default)
-
-def translate(self, domain, msgid, mapping=None,
+def translate(self, msgid, domain, mapping=None,
   context=None, target_language=None, default=None):
 if context is None:
-context = self.contexts.get('here')
+context = self.contexts.get('context')
 return getGlobalTranslationService().translate(
 domain, msgid, mapping=mapping,
 context=context,

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


[Zope-Checkins] SVN: Zope/branches/ajung-zpt-end-game/lib/python/Products/PageTemplates/Engine.py Greatly sanify the way we marry Zope 3 ZPTs and Zope 2 traversal.

2006-05-08 Thread Philipp von Weitershausen
Log message for revision 68038:
  Greatly sanify the way we marry Zope 3 ZPTs and Zope 2 traversal.
  
  Basically, zope.app's path expressions use ITraversable adapters to
  traverse through the object graph. This is the only sane thing to do,
  really. However, we still want to take care of Zope2's OFS.Traversable
  which most promimently allowes the __bobo_traverse__ hook.  (The irony
  is that OFS.Traversable uses Zope 3-style *URL* traversal these days;
  yes, *URL* traversal, not *object graph* traversal).
  
  Still confused?
  
  Basically, if we encounter something that is OFS.Traversable'ish, use
  restrictedTraverse. Use Zope3-style object graph traversal in all other
  cases
  

Changed:
  U   
Zope/branches/ajung-zpt-end-game/lib/python/Products/PageTemplates/Engine.py

-=-
Modified: 
Zope/branches/ajung-zpt-end-game/lib/python/Products/PageTemplates/Engine.py
===
--- 
Zope/branches/ajung-zpt-end-game/lib/python/Products/PageTemplates/Engine.py
2006-05-08 19:02:45 UTC (rev 68037)
+++ 
Zope/branches/ajung-zpt-end-game/lib/python/Products/PageTemplates/Engine.py
2006-05-08 19:18:42 UTC (rev 68038)
@@ -18,52 +18,49 @@
 from zope.tales.pythonexpr import PythonExpr
 from zope.tales.tales import _valid_name, _parse_expr, NAME_RE, Undefined, 
Context 
 from zope.i18n import translate
+from zope.traversing.adapters import traversePathElement
 
+from zExceptions import NotFound
+from OFS.interfaces import ITraversable
 from Products.PageTemplates.GlobalTranslationService import 
getGlobalTranslationService
 
 _marker = object()
 
-def BoboTraverseAwareSimpleTraverse(object, path_items, econtext):
+def boboTraverseAwareSimpleTraverse(object, path_items, econtext):
  a slightly modified version of zope.tales.expressions.simpleTraverse()
 that interacts correctly with objects implementing bobo_traverse().
 
+request = getattr(econtext, 'request', None)
+path_items = list(path_items)
+path_items.reverse()
 
-for name in path_items:
-next = getattr(object, name, _marker)
-if next is not _marker:
-object = next
-else:
+while path_items:
+name = path_items.pop()
+if ITraversable.providedBy(object):
 try:
 object = object.restrictedTraverse(name)
-except (KeyError, AttributeError):
-try:
-object = object[name]
-except:
-object = getattr(object, name)
-
+except NotFound, e:
+# OFS.Traversable.restrictedTraverse spits out
+# NotFound (the Zope 2 version) which Zope 3's ZPT
+# implementation obviously doesn't know as an
+# exception indicating failed traversal.  Perhaps Zope
+# 2's NotFound should be made to extend LookupError at
+# some point (or it should just be replaced with Zope
+# 3's version).  For the time being, however, we
+# simply converting NotFounds into LookupErrors:
+raise LookupError(*e.args)
+else:
+object = traversePathElement(object, name, path_items,
+ request=request)
 return object
 
 
-class PathExpr(PathExpr):
-We need to subclass PathExpr at this point since there is no other
-   away to pass our own traverser because we do not instantiate 
-   PathExpr on our own...this sucks!
-
+class ZopePathExpr(PathExpr):
+Zope2-aware path expression implementation
 
-def __init__(self, name, expr, engine, 
traverser=BoboTraverseAwareSimpleTraverse):
-self._s = expr
-self._name = name
-paths = expr.split('|')
-self._subexprs = []
-add = self._subexprs.append
-for i in range(len(paths)):
-path = paths[i].lstrip()
-if _parse_expr(path):
-# This part is the start of another expression type,
-# so glue it back together and compile it.
-add(engine.compile('|'.join(paths[i:]).lstrip()))
-break
-add(SubPathExpr(path, traverser, engine)._eval)
+def __init__(self, name, expr, engine):
+super(ZopePathExpr, self).__init__(name, expr, engine,
+   boboTraverseAwareSimpleTraverse)
 
 class Context(Context):
 
@@ -91,13 +88,12 @@
 
 def Engine():
 e = ExpressionEngine()
-reg = e.registerType
-for pt in PathExpr._default_type_names:
-reg(pt, PathExpr)
-reg('string', StringExpr)
-reg('python', PythonExpr)
-reg('not', NotExpr)
-reg('defer', DeferExpr)
+for pt in ZopePathExpr._default_type_names:
+e.registerType(pt, ZopePathExpr)
+e.registerType('string', StringExpr)
+e.registerType('python', PythonExpr)
+e.registerType('not', NotExpr)
+

[Zope-Checkins] SVN: Zope/branches/ajung-zpt-end-game/lib/python/Products/ switch to branch of Five

2006-05-08 Thread Philipp von Weitershausen
Log message for revision 68040:
  switch to branch of Five
  

Changed:
  _U  Zope/branches/ajung-zpt-end-game/lib/python/Products/

-=-

Property changes on: Zope/branches/ajung-zpt-end-game/lib/python/Products
___
Name: svn:externals
   - Five svn://svn.zope.org/repos/main/Products.Five/tags/1.5b

   + Five 
svn://svn.zope.org/repos/main/Products.Five/branches/ajung-zpt-end-game


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


[Zope-Checkins] SVN: Zope/branches/ajung-zpt-end-game/lib/python/Products/PageTemplates/ use expressions that have been implemented doubly from Zope 3.

2006-05-08 Thread Philipp von Weitershausen
Log message for revision 68042:
  use expressions that have been implemented doubly from Zope 3.
  this still needs further clean up, is to say consolidation.
  also, Five needs to be fixed regarding its (very funky) usage of 
Expressions.py
  

Changed:
  UU  
Zope/branches/ajung-zpt-end-game/lib/python/Products/PageTemplates/DeferExpr.py
  UU  
Zope/branches/ajung-zpt-end-game/lib/python/Products/PageTemplates/Expressions.py

-=-
Modified: 
Zope/branches/ajung-zpt-end-game/lib/python/Products/PageTemplates/DeferExpr.py
===
--- 
Zope/branches/ajung-zpt-end-game/lib/python/Products/PageTemplates/DeferExpr.py 
2006-05-08 22:04:29 UTC (rev 68041)
+++ 
Zope/branches/ajung-zpt-end-game/lib/python/Products/PageTemplates/DeferExpr.py 
2006-05-08 22:17:46 UTC (rev 68042)
@@ -45,39 +45,12 @@
 div tal:conditionpython: not (foo or bar).../div
 /div
 
+from zope.tales.expressions import DeferWrapper, DeferExpr
 
-_marker = object()
-
-# defer expression
-
-class DeferWrapper:
-Wrapper for defer: expression
-
-def __init__(self, expr, econtext):
-self._expr = expr
-self._econtext = econtext
-
-def __str__(self):
-return str(self())
-
-def __call__(self):
-return self._expr(self._econtext)
-
-class DeferExpr:
-defer: expression handler for deferred evaluation of the context
-
-def __init__(self, name, expr, compiler):
-self._s = expr = expr.lstrip()
-self._c = compiler.compile(expr)
-
-def __call__(self, econtext):
-return DeferWrapper(self._c, econtext)
-
-def __repr__(self):
-return 'defer:%s' % `self._s`
-
 # lazy expression
 
+_marker = object()
+
 class LazyWrapper(DeferWrapper):
 Wrapper for lazy: expression
 
@@ -99,4 +72,3 @@
 
 def __repr__(self):
 return 'lazy:%s' % `self._s`
-


Property changes on: 
Zope/branches/ajung-zpt-end-game/lib/python/Products/PageTemplates/DeferExpr.py
___
Name: svn:keywords
   + Id

Modified: 
Zope/branches/ajung-zpt-end-game/lib/python/Products/PageTemplates/Expressions.py
===
--- 
Zope/branches/ajung-zpt-end-game/lib/python/Products/PageTemplates/Expressions.py
   2006-05-08 22:04:29 UTC (rev 68041)
+++ 
Zope/branches/ajung-zpt-end-game/lib/python/Products/PageTemplates/Expressions.py
   2006-05-08 22:17:46 UTC (rev 68042)
@@ -10,36 +10,37 @@
 # FOR A PARTICULAR PURPOSE
 #
 ##
-
 Page Template Expression Engine
 
 Page Template-specific implementation of TALES, with handlers
 for Python expressions, string literals, and paths.
-
 
-__version__='$Revision: 1.45 $'[11:-2]
-
+$Id$
+
 import re, sys
-from TALES import Engine
-from TALES import CompilerError
-from TALES import _valid_name
-from TALES import NAME_RE
-from TALES import Undefined
-from TALES import Default
-from TALES import _parse_expr
+from TALES import Engine, CompilerError, NAME_RE, Undefined, Default
+from TALES import _parse_expr, _valid_name
 from Acquisition import aq_base, aq_inner, aq_parent
-from DeferExpr import LazyWrapper
-from DeferExpr import LazyExpr
-from DeferExpr import DeferWrapper
-from DeferExpr import DeferExpr
+from DeferExpr import LazyWrapper, LazyExpr
+from zope.tales.expressions import DeferWrapper, DeferExpr, StringExpr, NotExpr
 
+# BBB 2005/05/01 -- remove after 12 months
+import zope.deferredimport
+zope.deferredimport.deprecatedFrom(
+Use the Zope 3 ZPT engine instead of the Zope 2 one.  Expression 
+types can be imported from zope.tales.expressions.  This reference 
+will be gone in Zope 2.12.,
+zope.tales.expressions,
+StringExpr, NotExpr
+)
+
 _engine = None
 def getEngine():
 global _engine
 if _engine is None:
-from PathIterator import Iterator
-_engine = Engine(Iterator)
-installHandlers(_engine)
+   from PathIterator import Iterator
+   _engine = Engine(Iterator)
+   installHandlers(_engine)
 return _engine
 
 def installHandlers(engine):
@@ -190,64 +191,6 @@
 def __repr__(self):
 return '%s:%s' % (self._name, `self._s`)
 
-
-_interp = re.compile(r'\$(%(n)s)|\${(%(n)s(?:/[^}]*)*)}' % {'n': NAME_RE})
-
-class StringExpr:
-def __init__(self, name, expr, engine):
-self._s = expr
-if '%' in expr:
-expr = expr.replace('%', '%%')
-self._vars = vars = []
-if '$' in expr:
-parts = []
-for exp in expr.split('$$'):
-if parts: parts.append('$')
-m = _interp.search(exp)
-while m is not None:
-parts.append(exp[:m.start()])
-parts.append('%s')
-vars.append(PathExpr('path', m.group(1) or m.group(2),
-   

RE: [Zope] problem opening pdf-files with firefox in LocalFS folders onZope

2006-05-08 Thread Marinussen, M.J. (Ria)
Hi Dieter,

Thanks for your quick response and solution.
It's a great relief to have it working OK for Firefox too!

With regards,
Ria


 -Original Message-
 From: Dieter Maurer [mailto:[EMAIL PROTECTED] 
 Sent: 05 May 2006 22:19
 To: Marinussen, M.J. (Ria)
 Cc: zope@zope.org
 Subject: Re: [Zope] problem opening pdf-files with firefox in 
 LocalFS folders onZope
 
 Marinussen, M.J. (Ria) wrote at 2006-5-4 09:52 +0200:
 I've got Zope 2.8.5 installed with LocalFS version 
 LocalFS-1-3-andreas 
 on Solaris (SunOs 5.8, I'm not sure which version number of solaris 
 that
 is...)
 
 When I place pdf-files in the LocalFS directories, sometimes 
 they open 
 correctly, but most of the time they open as text-file when using 
 Firefox.
 
 A bug in LocalFS.
 
 In our local copy, I fixed it this way (in 
 LocalFS/StreamingFile.py):
 
 class StreamingFile(File):
 
 # DM 2005-11-07
 #  funny that we should not need a Content-Type header
 #  when the file is sufficiently small?
 if RESPONSE is not None:
 # DM 2005-11-18: support for 'if_modified_since' 
 and range requests
 if 
 self._if_modified_since_request_handler(REQUEST, RESPONSE):
 # we were able to handle this by returning a 304
 return ''
 if self._range_request_handler(REQUEST, RESPONSE):
 # we served a chunk of content in response to 
 a range request.
 return ''
   RESPONSE.setHeader('Content-Type', self.content_type)
 #DM 2005-11-17: 'Last-Modified' support
   RESPONSE.setHeader(
 'Last-Modified',
 rfc1123_date(stat(self._local_path)[8])
 )
 # DM 2005-11-18: support for range requests
   RESPONSE.setHeader('Accept-Ranges', 'bytes')
   threshold = 2  16 # 128 kb
   if self.size  threshold or RESPONSE is None:
   try:
   f = open(self._local_path, 'rb')
   return f.read()
   finally:
   f.close()
   else:
   RESPONSE.setHeader('Content-Length', self.size)
 # DM 2005-11-07: moved outside the if
   #RESPONSE.setHeader('Content-Type', self.content_type)
   return filestream_iterator(self._local_path, 'rb')
 
 
 The fix also provides if-modified-since and if-ranges.
 
 
 With other browsers (Internet Explorer, Opera) this problem does not 
 occur.
 
 They ignore the (wrong) Content-Type and look on the 
 filename extension.
 
 
 --
 Dieter
 
___
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] psycopgda

2006-05-08 Thread Josh Stephenson

Thanks for the help Infor

I deleted the psycopgda 1.0.0 product from zope and installed version 
1.1.21 via the psycopg-1.1.21 tarball.  After consulting the FAQ I 
realized I had to install mxDateTime, and run ./configure telling it 
where to find zope, postgres libs and the mxdatetime lib.  Then, after 
running make, make install and make install-zope, I had to copy the 
PsycopgDA dir to the Product dir of my zope instance.


Thanks for the help from everyone else too!


Infor Gates wrote:
version 1.0.0 is very old. You should try the last stable version 
1.1.21.  I have used this version with Zope 2.8.x with Postgresql 
8.0.x.  It is stable.


CY

*/Josh Stephenson [EMAIL PROTECTED]/* wrote:

I recently installed psycopgda version 1.0.0 and restarted zope. I
can
see that it installed because it's listed under products in zope's
control panel, but it's not listed in the drop-down menu where all
the
other products are.

I installed by doing:
python install.py build
python install.py install

Zope 2.9.2
Python 2.4.2
PostgreSQL 8.1.3


I've tried installing psycopg version 2-2.0b8, but I don't even get a
listing in the products under zope's control panel.

What am I doing wrong?
___
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 )



Blab-away for as little as 1¢/min. Make PC-to-Phone Calls 
http://us.rd.yahoo.com/mail_us/taglines/postman2/*http://us.rd.yahoo.com/evt=39663/*http://voice.yahoo.com 
using Yahoo! Messenger with Voice. 


___
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] Zope 2.9.2 -- Upgrading

2006-05-08 Thread Chris Withers

David Ayres wrote:

Hi Everyone.

I am still running Zope 2.7.5. Will there be any problems if I jump directly
to 2.9.2?


I had no end of fun with this very jump ;-)

Most 3rd party products will need some kind of tweaking or version upgrade.

If you rely on the history tab for python scripts / zpt or if you edit 
python scripts from windows machines via webdav, then you'll need to 
apply patches until 2.9.3 is out.


Above all, do a test run on a development machine with your production 
data and do loads and loads of testing!


good luck,

Chris

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

___
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] Metal:fill-slot *always* returns a span?

2006-05-08 Thread Chris Withers

Doyon, Jean-Francois wrote:

What am I missing here? Is this a bug/misfeature?  Could any one point to
the source code that handles this?


I've never seen this before, my guess would be that whatever you're 
filling that slot with isn't what you think it is ;-)


cheers,

Chris

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

___
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] Questions on ZODB BTrees versus bsddb BTrees

2006-05-08 Thread Chris Withers

Terry Jones wrote:

That's 3 times where I somehow get to be in the wrong for taking the time
to point out that a piece of documentation in the project is quite
misleading.


You didn't say you thought it was misleading, you worded it as if you 
expected it to still be true. A small difference maybe, but we're all 
busy people ;-)



That's one of the aims. It works against
that aim if the documentation is misleading. And, it works against the aim
of having more people involved if someone new and well-intentioned shows
up, runs into what looks like a clear (and, yes, very minor) problem, takes
the time to report it, and is then repeatedly told that they're in the
wrong!


Well, you didn't say this is wrong, I want to fix it. You said doing 
this thing that's obviously out of date should work, why doesn't it, 
which is a slightly different kettle of fish ;-)


Sure. But when it's the only thing you have to go on, 


It's not. There's plenty of coverage both in the 2.6 book on zope.org 
and the 2.7 book on plope.org...



when the document is
sitting on the official zope.org web site,


zope.org is a joke, despite many people's efforts. Get over it and move 
on to enjoying zope despite this ;-)



and when it says something is
separately downloadable, experience dictates that you ignore the mentioned
version number and go looking for the latest version of that thing. Which
is exactly what I did.


I don't think that's correct. If you see an ancient version of any 
software mentioned in a doc, you might want to consider the validity of 
the document as a whole...



original smiley). I was trying to help yesterday.  I'm trying to now too,
when I say that I don't think it's in the best interests of the project to
tell newcomers who run across problems that they're in the wrong because
they were naive enough to read and rely on the documentation.


Well, okay, I'll try and make the point again: you need to think hard 
when reading docs... if it's ancient, it might well be out of date and 
wholely inaccurate to the point of being totally misleading, as in this 
case...


cheers,

Chris

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

___
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] LocalFS problems

2006-05-08 Thread Chris Withers

Dennis Allison wrote:

LocalFS product (1.3-andreas) seems to be having a problem with the
dtml-tree tag in Zope 2.9.2/Python 2.4.2.  


Then don't use DTML, it does, after all suck (tm) ;-)


The problem seems to be with the tpValues() program in the LocalFS product
which returns an empty list. 


then tpValues() is likely wrong for localfs, unless localfs doesn't want 
to play ball with the tree tag. Given that the tree tag is used by the 
zmi, and you don't really want to display potentially millions of 
sub-objects in the zmi, it might be perfectly legitimate for local-fs to 
do what it's doing...


There seems to be some trickery going on with the isPrincipiaFolderish 
and the tree_view attributes, but I don't quite get what's supposed to 
happen.  SmileyChris?  I think these were your mods.


Not me, I don't smile, but you knew that already ;-)


Incidentally, the ZMI panel which uses dtml-tree seems to have the same
sort of problems I am seeing when there is a LocalFS.


See my comments above.

I'd roll your own code without using dtml and just iterate over the 
objectIds method...


cheers,

Chris

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

___
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] LocalFS problems

2006-05-08 Thread Dennis Allison

Or just do a custom tpValues equivalent for the particular special case.

I suspect that is what we will try next...   ;-)


On Mon, 8 May 2006, Chris Withers wrote:

 Dennis Allison wrote:
  LocalFS product (1.3-andreas) seems to be having a problem with the
  dtml-tree tag in Zope 2.9.2/Python 2.4.2.  
 
 Then don't use DTML, it does, after all suck (tm) ;-)
 
  The problem seems to be with the tpValues() program in the LocalFS product
  which returns an empty list. 
 
 then tpValues() is likely wrong for localfs, unless localfs doesn't want 
 to play ball with the tree tag. Given that the tree tag is used by the 
 zmi, and you don't really want to display potentially millions of 
 sub-objects in the zmi, it might be perfectly legitimate for local-fs to 
 do what it's doing...
 
  There seems to be some trickery going on with the isPrincipiaFolderish 
  and the tree_view attributes, but I don't quite get what's supposed to 
  happen.  SmileyChris?  I think these were your mods.
 
 Not me, I don't smile, but you knew that already ;-)
 
  Incidentally, the ZMI panel which uses dtml-tree seems to have the same
  sort of problems I am seeing when there is a LocalFS.
 
 See my comments above.
 
 I'd roll your own code without using dtml and just iterate over the 
 objectIds method...
 
 cheers,
 
 Chris
 
 

-- 

___
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] Metal:fill-slot *always* returns a span?

2006-05-08 Thread Dieter Maurer
Doyon, Jean-Francois wrote at 2006-5-5 17:47 -0400:
 ...
Now for some reason I can't figure out, the end result ALWAYS has span
tags surrounding the content of the slot, despite the fact I say here they
shoul dbe div's ...

Usually, this means, that the active code it taken from a location
different from where you expect (and that this location uses span).

-- 
Dieter
___
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] strange behaviour:can not access source-view.gif but a copy of it

2006-05-08 Thread Dieter Maurer
robert rottermann wrote at 2006-5-7 10:05 +0200:
 ...
 What does the wget -S http://www.ersigen.ch/view-source.gif;
 gives you?

   
prints the following and waits for ever:
[EMAIL PROTECTED]:/home/zope/Products/redProducts/RedUtils/commander/tests 
wget -S http://www.ersigen.ch/view-source.gif
--09:59:48--  http://www.ersigen.ch/view-source.gif
   = `view-source.gif'
Auflösen des Hostnamen »www.ersigen.ch« 193.246.254.98
Verbindungsaufbau zu www.ersigen.ch|193.246.254.98|:80... verbunden.
HTTP Anforderung gesendet, warte auf Antwort...

Okay, I would not want to believe it. But, apparently, Zope
really does not answer.

Thus check at the bottom of Control_Panel -- Debug information
that Zope is indeed still processing the request.
If it does, use DeadlockDebugger to find out where it is hanging
around.

-- 
Dieter
___
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] ftp server deadlocking zope with DeadlockDebugger

2006-05-08 Thread Dieter Maurer
Michael Kaplan wrote at 2006-5-6 10:23 +0200:
 ...
Stays the part above (maybe partially) accross several
DeadlockDebugger invocations (or changes the tail of your
traceback continously)?

In this case, there would seem to be some infinite loop caused
by the AT ReferenceEngine (I like it).

  

As you supposed the tail changes if I invoke DeadlockDebugger several times.
Here are 3 more examples besides the one I sent before:

 ... examples stripped ...

There is a known problem in LinguaPlone.
Usually, it is described by: Zope takes almost all CPU time.
Maybe, what you see is an instance of thos bug.

Alternatively, something may be wrong with getTranslations.

Obviously, the problem occurs still in BaseRequest.traverse.
This means, manage_FTPlist has not even started and you
do not have an FTP problem. But a problem with the folder
you try to FTP into. That translations are maintained in
references is a bit suspicious.


Check whether the LinguaPlone bug hits you.


If this is not the case, then debugging getTranslations
is probably the most efficient way to locate the problem.

-- 
Dieter
___
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] LocalFS problems

2006-05-08 Thread Dieter Maurer
Dennis Allison wrote at 2006-5-7 19:21 -0700:
 ...
The problem seems to be with the tpValues() program in the LocalFS product
which returns an empty list.  The controlling flag,
o.isPrincipiaFolderish, seems to be set to zero when it ought to have a
value of 1 when the object being referenced is a LocalDirectory instance.  
As a result, instead of returning a list of sub-directories it returns an 
empty list. 

A good analysis. Thus, you change what is necessary to let
tpValues behave well ...

-- 
Dieter
___
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] Preventing files from being viewed by web clients

2006-05-08 Thread Brian
I have a flash app that accesses .xml files.

The source is viewable and some creative crackers have figured out how to
meld a url together to get vital information from those .xml's.

I need to prevent the web client from directly accessing them.

Is there a directive (such as Apache's) or mechnisim to keep web clients
from accessing yet allow my app access these files?

Somthing like

FilesMatch \.(?i:gif|jpe?g|xml)$
   Order allow,deny
   Allow from some file name
   Deny from all
   some other web trick
/FilesMatch

in zope.conf or ???

TIA

Brian



___
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] Preventing files from being viewed by web clients

2006-05-08 Thread Lennart Regebro

On 5/8/06, Brian [EMAIL PROTECTED] wrote:

I have a flash app that accesses .xml files.

The source is viewable and some creative crackers have figured out how to
meld a url together to get vital information from those .xml's.

I need to prevent the web client from directly accessing them.

Is there a directive (such as Apache's) or mechnisim to keep web clients
from accessing yet allow my app access these files?

Somthing like

FilesMatch \.(?i:gif|jpe?g|xml)$
   Order allow,deny
   Allow from some file name
   Deny from all
   some other web trick
/FilesMatch

in zope.conf or ???


Zopes security is based on being authenticated, so no. What you can do
it let the Flash app login as a special user, and make the files only
accessible to that user. To prevent people from sneaking the password
from the IP-traffic, you also need to use SSL from the Flash app.

--
Lennart Regebro, Nuxeo http://www.nuxeo.com/
CPS Content Management http://www.cps-project.org/
___
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] Preventing files from being viewed by web clients

2006-05-08 Thread Andreas Jung



--On 8. Mai 2006 13:19:02 -0500 Brian [EMAIL PROTECTED] wrote:


I have a flash app that accesses .xml files.

The source is viewable and some creative crackers have figured out how to
meld a url together to get vital information from those .xml's.

I need to prevent the web client from directly accessing them.

Is there a directive (such as Apache's) or mechnisim to keep web clients
from accessing yet allow my app access these files?



This question makes little sense. If your flash app must accest the .xml 
file then it must be accessible for everyone. You think about checking the

user agent for flash apps but all this stuff can be faked.

-aj


--
ZOPYX Ltd.  Co. KG - Charlottenstr. 37/1 - 72070 Tübingen - Germany
Web: www.zopyx.com - Email: [EMAIL PROTECTED] - Phone +49 - 7071 - 793376
E-Publishing, Python, Zope  Plone development, Consulting


pgpUYTMwCc2hQ.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] Zope 3.3.0 beta 1 released!

2006-05-08 Thread Stephan Richter
Hello everyone,

The Zope 3 development team is proud to announce Zope 3.3.0 beta 1.

Zope 3 is the next major Zope release and has been written from scratch based
on the latest software design patterns and the experiences of Zope 2.

Cleanup of the Zope 3 packages has continued to ensure a flexible and
scalable platform. We continued the work on making the transition from Zope 2
to Zope 3 by making Zope 2.10 use even more of the Zope 3 packages. But we're
not there yet. **You can't run Zope 2 applications in Zope 3.**


Downloads

  http://zope.org/Products/Zope3

  Installation instructions for both Windows and Un*x/Linux are now available
  in the top level 
README.txt:http://www.zope.org/Products/Zope3/3.3.0b1/README.txt
  file of the distribution. The binary installer is recommended for Windows.

  Zope 3.3 requires Python 2.4.1 to run. You must also have zlib
  installed on your system.

Most Important Changes Since 3.2

  - Provided a new component registry API that allows multiple
component registries to be combined more flexibly than before.
See 'zope.component.interfaces.IComponentRegistry' for more
information.

  - Greatly simplified local-component registration.
See 'zope.component.interfaces.IComponentRegistry' for more
information.

  - Moved many packages out of zope.app to make them easier to use
outside of Zope.

  - Change the session credentials plugin to make it configurable
in which fields it looks for the credentials.

  - Added a new API for collating text.  You can now adapt
a locale to 'zope.i18n.interfaces.ILocales.ICollator'.  You can
then use that to sort strings, such as menu entries, in a
locale-specific fashion.

  - A new 'zope.annotation.factory' helper function that makes
it easier to create annotations. Also added a README in
'zope.annotation' which explains how to use it.

  - Added a more complete set of widgets for fields that use
iterable sources.  These widgets now mirror the set provided
by vocabulary-based fields.

  - Added a cleaner and more robust API to testbrowser for setting
file-upload data.


  - Deprecated several ZCML directives:

* factory

* vocabulary

* content (as an alias to the class directive)

* modulealias

* renderer:renderer

  - The 'browser:layer' directive and the 'ILayer' interface
has been deprecated.  Registering layers has become obsolete,
layers should be created as interfaces extending
'IBrowserRequest'.

  - The 'browser:skin' directive has been deprecated.  Skins
should be created as interfaces extending 'IBrowserRequest'
and can be registered using a simple 'utility' directive.

  - The 'ISkin' interface has been renamed to 'IBrowserSkinType'.

  For a complete list of changes see the 'CHANGES.txt' file.


Resources

  - Zope 3 Development Web Site:http://dev.zope.org/Zope3

  - Zope 3 Dev Mailing List:http://mail.zope.org/mailman/listinfo/zope3-dev

  - Zope 3 Users Mailing 
List:http://mail.zope.org/mailman/listinfo/zope3-users

  - IRC Channel: #zope3-dev at irc.freenode.net


Acknowledgments

  Thanks goes to everyone that contributed.

Enjoy!

The Zope 3 Development Team
___
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] Preventing files from being viewed by web clients

2006-05-08 Thread Tino Wildenhain
Brian wrote:
 I have a flash app that accesses .xml files.
 
 The source is viewable and some creative crackers have figured out how to
 meld a url together to get vital information from those .xml's.

Well, dont put vital information there :-)

 I need to prevent the web client from directly accessing them.
 
 Is there a directive (such as Apache's) or mechnisim to keep web clients
 from accessing yet allow my app access these files?

Your flash app is a web client too and thus indistinguishable
from any other web client.

 Somthing like
 
 FilesMatch \.(?i:gif|jpe?g|xml)$
Order allow,deny
Allow from some file name
 what exactly would you want to
put into this hypothetical statement? :-)

Deny from all
some other web trick
 /FilesMatch
 
 in zope.conf or ???

No. Just dont send something over the web to any client
what you dont want to send to people. Everything you send
can and will be read no matter whats the intended client
is. SSL nor custom auth will prevent people from reading
it. (see tcpflow and openssl client)

Regards
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] Re: [Zope3-Users] Zope 3.3.0 beta 1 released!

2006-05-08 Thread Stephan Richter
On Monday 08 May 2006 17:07, Lorenzo Gil Sanchez wrote:
 Is there a small document or howto explaining how to migrate from the
 old skins/layers to the new system?

I migrated by reading the deprecation messages and following their advice. :-)

Unfortunately, we do not have the resources to write migration guides or new 
feature how-tos. I hope that someone (thinking specifically of Jeff Shell 
here) will blog on the new features and changes. :-)

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 )