[Zope-Checkins] CVS: Packages/ZEO - __init__.py:1.19.4.32 version.txt:1.9.4.31

2005-10-12 Thread Tim Peters
Update of /cvs-repository/Packages/ZEO
In directory cvs.zope.org:/tmp/cvs-serv28344/ZEO

Modified Files:
  Tag: Zope-2_7-branch
__init__.py version.txt 
Log Message:
3.2.10 final.


=== Packages/ZEO/__init__.py 1.19.4.31 = 1.19.4.32 ===
--- Packages/ZEO/__init__.py:1.19.4.31  Wed Oct  5 15:05:59 2005
+++ Packages/ZEO/__init__.pyWed Oct 12 13:31:32 2005
@@ -21,4 +21,4 @@
 
 
 
-version = 2.2.10b2
+version = 2.2.10


=== Packages/ZEO/version.txt 1.9.4.30 = 1.9.4.31 ===
--- Packages/ZEO/version.txt:1.9.4.30   Wed Oct  5 15:05:59 2005
+++ Packages/ZEO/version.txtWed Oct 12 13:31:32 2005
@@ -1 +1 @@
-2.2.10b2
+2.2.10

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


[Zope-Checkins] SVN: Zope/trunk/ Merge rev 39102 from the 2.8 branch.

2005-10-12 Thread Tim Peters
Log message for revision 39103:
  Merge rev 39102 from the 2.8 branch.
  
  Move to ZODB 3.4.2 final.
  

Changed:
  _U  Zope/trunk/doc/
  _U  Zope/trunk/lib/python/
  _U  Zope/trunk/utilities/

-=-

Property changes on: Zope/trunk/doc
___
Name: svn:externals
   - ZEO  svn://svn.zope.org/repos/main/ZODB/tags/3.4.2b3/doc/ZEO

   + ZEO  svn://svn.zope.org/repos/main/ZODB/tags/3.4.2/doc/ZEO



Property changes on: Zope/trunk/lib/python
___
Name: svn:externals
   - zope   
svn://svn.zope.org/repos/main/Zope3/tags/ZopeX3-3.0.1-Zope-2.8/src/zope
ZConfigsvn://svn.zope.org/repos/main/ZConfig/tags/ZConfig-2.3
BTrees svn://svn.zope.org/repos/main/ZODB/tags/3.4.2b3/src/BTrees
persistent svn://svn.zope.org/repos/main/ZODB/tags/3.4.2b3/src/persistent
ThreadedAsync  svn://svn.zope.org/repos/main/ZODB/tags/3.4.2b3/src/ThreadedAsync
transactionsvn://svn.zope.org/repos/main/ZODB/tags/3.4.2b3/src/transaction
ZEOsvn://svn.zope.org/repos/main/ZODB/tags/3.4.2b3/src/ZEO
ZODB   svn://svn.zope.org/repos/main/ZODB/tags/3.4.2b3/src/ZODB
ZopeUndo   svn://svn.zope.org/repos/main/ZODB/tags/3.4.2b3/src/ZopeUndo
zdaemonsvn://svn.zope.org/repos/main/zdaemon/tags/zdaemon-1.1

   + zope   
svn://svn.zope.org/repos/main/Zope3/tags/ZopeX3-3.0.1-Zope-2.8/src/zope
ZConfigsvn://svn.zope.org/repos/main/ZConfig/tags/ZConfig-2.3
BTrees svn://svn.zope.org/repos/main/ZODB/tags/3.4.2/src/BTrees
persistent svn://svn.zope.org/repos/main/ZODB/tags/3.4.2/src/persistent
ThreadedAsync  svn://svn.zope.org/repos/main/ZODB/tags/3.4.2/src/ThreadedAsync
transactionsvn://svn.zope.org/repos/main/ZODB/tags/3.4.2/src/transaction
ZEOsvn://svn.zope.org/repos/main/ZODB/tags/3.4.2/src/ZEO
ZODB   svn://svn.zope.org/repos/main/ZODB/tags/3.4.2/src/ZODB
ZopeUndo   svn://svn.zope.org/repos/main/ZODB/tags/3.4.2/src/ZopeUndo
zdaemonsvn://svn.zope.org/repos/main/zdaemon/tags/zdaemon-1.1



Property changes on: Zope/trunk/utilities
___
Name: svn:externals
   - ZODBTools  svn://svn.zope.org/repos/main/ZODB/tags/3.4.2b3/src/scripts

   + ZODBTools  svn://svn.zope.org/repos/main/ZODB/tags/3.4.2/src/scripts


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


[Zope-Checkins] CVS: Packages/OFS - Image.py:1.145.2.13

2005-10-12 Thread Sidnei da Silva
Update of /cvs-repository/Packages/OFS
In directory cvs.zope.org:/tmp/cvs-serv12347/lib/python/OFS

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

  - OFS.Image.manage_FTPget() would str() it's .data attribute,
potentially loading the whole file in memory as a
string. Changed to use RESPONSE.write() iterating through the
Pdata chain, just like index_html().


=== Packages/OFS/Image.py 1.145.2.12 = 1.145.2.13 ===
--- Packages/OFS/Image.py:1.145.2.12Fri Jun  3 12:15:00 2005
+++ Packages/OFS/Image.py   Wed Oct 12 17:27:06 2005
@@ -218,7 +218,7 @@
 return True
 
 ranges = HTTPRangeSupport.expandRanges(ranges, self.size)
-
+
 if len(ranges) == 1:
 # Easy case, set extra header and return partial set.
 start, end = ranges[0]
@@ -401,10 +401,10 @@
 return result
 
 self.ZCacheable_set(None)
-
+
 data=self.data
 if type(data) is type(''):
-RESPONSE.setBase(None) 
+RESPONSE.setBase(None)
 return data
 
 while data is not None:
@@ -597,6 +597,8 @@
 
 def manage_FTPget(self):
 Return body for ftp.
+RESPONSE = self.REQUEST.RESPONSE
+
 if self.ZCacheable_isCachingEnabled():
 result = self.ZCacheable_get(default=None)
 if result is not None:
@@ -605,9 +607,19 @@
 # from FileCacheManager.
 # the content-length is required here by HTTPResponse, even
 # though FTP doesn't use it.
-self.REQUEST.RESPONSE.setHeader('Content-Length', self.size)
+RESPONSE.setHeader('Content-Length', self.size)
 return result
-return str(self.data)
+
+data = self.data
+if type(data) is type(''):
+RESPONSE.setBase(None)
+return data
+
+while data is not None:
+RESPONSE.write(data.data)
+data = data.next
+
+return ''
 
 manage_addImageForm=DTMLFile('dtml/imageAdd',globals(),
  Kind='Image',kind='image')

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


[Zope-Checkins] CVS: Zope/doc - CHANGES.txt:1.625.2.363

2005-10-12 Thread Sidnei da Silva
Update of /cvs-repository/Zope/doc
In directory cvs.zope.org:/tmp/cvs-serv12347/doc

Modified Files:
  Tag: Zope-2_7-branch
CHANGES.txt 
Log Message:

  - OFS.Image.manage_FTPget() would str() it's .data attribute,
potentially loading the whole file in memory as a
string. Changed to use RESPONSE.write() iterating through the
Pdata chain, just like index_html().


=== Zope/doc/CHANGES.txt 1.625.2.362 = 1.625.2.363 ===
--- Zope/doc/CHANGES.txt:1.625.2.362Tue Oct 11 11:00:35 2005
+++ Zope/doc/CHANGES.txtWed Oct 12 17:27:06 2005
@@ -13,6 +13,11 @@
 
 Bugs fixed
 
+  - OFS.Image.manage_FTPget() would str() it's .data attribute,
+potentially loading the whole file in memory as a
+string. Changed to use RESPONSE.write() iterating through the
+Pdata chain, just like index_html().
+
   - Collector #1914: Harden 'call_with_ns' (in
 'Products.PageTemplates.ZRPythonExpr') against namespaces from other
 callers than page templates.

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


[Zope-Checkins] SVN: Zope/branches/Zope-2_8-branch/ - OFS.Image.manage_FTPget() would str() it's .data attribute,

2005-10-12 Thread Sidnei da Silva
Log message for revision 39108:
  
- OFS.Image.manage_FTPget() would str() it's .data attribute,
  potentially loading the whole file in memory as a
  string. Changed to use RESPONSE.write() iterating through the
  Pdata chain, just like index_html().
  

Changed:
  U   Zope/branches/Zope-2_8-branch/doc/CHANGES.txt
  U   Zope/branches/Zope-2_8-branch/lib/python/OFS/Image.py

-=-
Modified: Zope/branches/Zope-2_8-branch/doc/CHANGES.txt
===
--- Zope/branches/Zope-2_8-branch/doc/CHANGES.txt   2005-10-12 21:04:13 UTC 
(rev 39107)
+++ Zope/branches/Zope-2_8-branch/doc/CHANGES.txt   2005-10-12 21:33:53 UTC 
(rev 39108)
@@ -22,7 +22,7 @@
 
- Collector #1233: port ZOPE_CONFIG patch from Zope 2.7 to Zope 2.8
 
-  after Zope 2.8.1 
+  after Zope 2.8.1
 
 Features added
 
@@ -33,6 +33,11 @@
 
 Bugs Fixed
 
+  - OFS.Image.manage_FTPget() would str() it's .data attribute,
+potentially loading the whole file in memory as a
+string. Changed to use RESPONSE.write() iterating through the
+Pdata chain, just like index_html().
+
   - When PageTemplates have a syntax error, show the traceback output
 in the rendered error message.
 
@@ -44,7 +49,7 @@
 character set used to encode unicode data that reaches
 ZPublisher without any specified encoding.
 
-  - disabled .. include directive for all the ZReST product and the 
+  - disabled .. include directive for all the ZReST product and the
 reStructuredText package
 
   - Collector #1888: Adjust call to 'engine.translate' to accomodate
@@ -57,7 +62,7 @@
 supporting 'debug' argument passed to
 'ZPublisher.Test.publish_module'.
 
-  - Collector #1879: applied patch by Dieter Maurer to fix a bug in 
+  - Collector #1879: applied patch by Dieter Maurer to fix a bug in
 ac_aquire() ignoring the default argument
 
   - Collector #1864, #1906: fixed header normalization in appendHeader()
@@ -83,7 +88,7 @@
   - Collector #1877: skel/Products/README.txt inappropriately copied
 from CMF.
 
-  - Collector #1871: Applied patch to support lists with records using 
+  - Collector #1871: Applied patch to support lists with records using
 ZTUtils.make_query()
 
   - AccessControl: creating a new user through zpasswd inituser did not
@@ -99,11 +104,11 @@
   - DateIndex now properly removes documents from both indexes if
 the value is None
 
-  - Collector #1888: Some parts of the TALInterpreter would not pass a 
-default when  translating, yet expect a string back. This would cause 
-an error (usually NoneType has no attribute 'replace') in the case 
+  - Collector #1888: Some parts of the TALInterpreter would not pass a
+default when  translating, yet expect a string back. This would cause
+an error (usually NoneType has no attribute 'replace') in the case
 the message was not translated.
-
+
   Zope 2.8.1 (2005/08/11)
 
 Features added
@@ -158,11 +163,11 @@
 in Products/BTreeFolder2 (CMFCore will include it after 1.5, with
 an appropriate module alias for backward compatibility).
 
-  - Replaced all transaction.commit(1) calls by  transaction.savepoint() 
+  - Replaced all transaction.commit(1) calls by  transaction.savepoint()
 
   - Collector #1832: UnIndex swallowed ConflictErrors.
 
-  - Collector #1815: ZCTextIndex accepts (again) sequences of strings to 
+  - Collector #1815: ZCTextIndex accepts (again) sequences of strings to
 be indexed.
 
   - Collector #1812: Fixed key error in ZSQL ZMI/Test
@@ -179,7 +184,7 @@
   - Collector #1808: manage_convertIndexes no longer tries to change the
 index types causing some trouble with CMF.
 
-  - manage_convertIndexes did not treat DateRangeIndexes and PathIndexes 
+  - manage_convertIndexes did not treat DateRangeIndexes and PathIndexes
 properly.
 
   - Updated Zope X3 to bugfix release 3.0.1
@@ -200,7 +205,7 @@
 
   - Collector #1803: Fixed InitializeClass for some corner case.
 
-  - Collector #1798, issue 1: ZopeTestCase no longer tries to 
+  - Collector #1798, issue 1: ZopeTestCase no longer tries to
 install products that were installed by Zope during startup.
 
   - Collector #1799: Avoid lying about parent's refcount when

Modified: Zope/branches/Zope-2_8-branch/lib/python/OFS/Image.py
===
--- Zope/branches/Zope-2_8-branch/lib/python/OFS/Image.py   2005-10-12 
21:04:13 UTC (rev 39107)
+++ Zope/branches/Zope-2_8-branch/lib/python/OFS/Image.py   2005-10-12 
21:33:53 UTC (rev 39108)
@@ -594,6 +594,8 @@
 
 def manage_FTPget(self):
 Return body for ftp.
+RESPONSE = self.REQUEST.RESPONSE
+
 if 

[Zope-Coders] Zope tests:

2005-10-12 Thread Zope tests summarizer
Summary of messages to the zope-tests list.
Period Tue Oct 11 11:01:02 2005 UTC to Wed Oct 12 11:01:02 2005 UTC.
There were no messages.

___
Zope-Coders mailing list
Zope-Coders@zope.org
http://mail.zope.org/mailman/listinfo/zope-coders


Re: [Zope-dev] Re: [Zope-Checkins] SVN: Zope/trunk/lib/python/Shared/DC/ZRDB/ Collector #556: sqlvar now returns 'null' rather than 'None'.

2005-10-12 Thread Andreas Jung



--On 11. Oktober 2005 07:50:34 +0100 Chris Withers [EMAIL PROTECTED] 
wrote:



Andreas Jung wrote:

IMO there is no need to ship the Zope core  with *any* DB package except
the ZODB.


I dunno, it's very handy to be able to rely on something RDB-like being
installed when you want to tests things like ZSQL methods...



Yes, it would be handy. But one could also install the stuff as standalone 
product for people that really need it. I am really against this proposal - 
maintaining yet another nice2have package is a burden just for the sake of 
make the lifes of some people easier. Other application servers also don't 
ship with a RDBMSif you need it, install it.


Andreas

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


[Zope-dev] Hold the press!

2005-10-12 Thread Sidnei da Silva
I would like to fix this pearl of memory-comsumption in OFS.Image
manage_FTPget:

def manage_FTPget(self):
Return body for ftp.
snip
return str(self.data)

That and port a fix from webdav.NullResource.PUT to
webdav.LockNullResource.PUT.

But I fear a release is coming out today? If that's the case could it
hold back a bit? I'm already working on the fix.

-- 
Sidnei da Silva
Enfold Systems, LLC.
http://enfoldsystems.com
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: Hold the press!

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

Sidnei da Silva wrote:
 I would like to fix this pearl of memory-comsumption in OFS.Image
 manage_FTPget:
 
 def manage_FTPget(self):
 Return body for ftp.
 snip
 return str(self.data)
 
 That and port a fix from webdav.NullResource.PUT to
 webdav.LockNullResource.PUT.
 
 But I fear a release is coming out today? If that's the case could it
 hold back a bit? I'm already working on the fix.
 

The release of 2.8.2 and 2.7.8 is announced for tomorrow.

Tres.
- --
===
Tres Seaver  +1 202-558-7113  [EMAIL PROTECTED]
Palladion Software   Excellence by Designhttp://palladion.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.5 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDTXYA+gerLs4ltQ4RAvlqAJ427WAA7K95g6pZloYUFFVBkkmVlgCggz1D
FPE4V1jljOV2u+WpaoFidnk=
=yqyj
-END PGP SIGNATURE-

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


Re: [Zope-dev] Hold the press!

2005-10-12 Thread Chris McDonough


Go Sidnei go!  I suspect Andreas won't be all *that* happy about such  
a bugfix going in on the last day but I don't think the release is  
until tomorrow, FWIW. ;-)


On Oct 12, 2005, at 4:30 PM, Sidnei da Silva wrote:


I would like to fix this pearl of memory-comsumption in OFS.Image
manage_FTPget:

def manage_FTPget(self):
Return body for ftp.
snip
return str(self.data)

That and port a fix from webdav.NullResource.PUT to
webdav.LockNullResource.PUT.

But I fear a release is coming out today? If that's the case could it
hold back a bit? I'm already working on the fix.

--
Sidnei da Silva
Enfold Systems, LLC.
http://enfoldsystems.com
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )




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

http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Hold the press!

2005-10-12 Thread Andreas Jung



--On 12. Oktober 2005 17:30:17 -0300 Sidnei da Silva 
[EMAIL PROTECTED] wrote:





But I fear a release is coming out today? If that's the case could it
hold back a bit? I'm already working on the fix.


I'll work on the 2.8.2 release today after 4pm (German time) and on 2.7.8
by tomorrow...

Andreas

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


Re: [Zope] Zope security and packing the database

2005-10-12 Thread Chris Withers

Cameron Beattie wrote:

def main():
   urllib._urlopener = MyUrlOpener()
   url = %s/Control_Panel/Database/manage_pack?days:float=%s % \


*sigh* url whacking, bleugh!

If I use the backup user then urllib can't get the url due to no 
authentication so errors as follows:


What roles do you want to have the backup user to have?
What permissions are mapped to those roles?
What permissions are mapped to the Owner role?
Looking at the differences will tell you what's going on ;-)

PS: I wouldn't do zodb packing by whacking a url. There's a script 
that scripts with ZOpe now that opens up a ZEO connection and does the 
pack that way, that's what I'd do...


I don't use ZEO - can I just do the scripted packing bit without all the 
associated ZEO setup?


You should use ZEO! there's no sane reason not to...

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] Zope Debugger lets WingDbg fail to connect toclient

2005-10-12 Thread Chris Withers

Hi John,

Wingware Support wrote:
sorry, here it is. It is the the WingDbg Product, but you probably 
will be unable to install/use it as it depends on the WingIDE (at 
least part of it) to be installed on the server, too. And as WingIDE 
is not open source, I am not allowed to hand it on.


The patching is a bit worse than I expected, it doesn't look like 
WinDbg makes any attempt to call back to the original version of the 
method it's patching, which is a bit sad :-(


The patching WingDBG does is required so that the co_filename attribute 
of code objects is set correctly. 


That's no good if they're not FS-based ;-)

We would be interested in hearing if 
there is a better way to do this.  


http://www.simplistix.co.uk/software/zope/zdb

We'd be even more interested in 
having Zope changed so that any debugger would work without monkey 
patching ;).


Well, with code stored in an ODB and pdb's fundamentally FS-based and 
suprisingly unpluggable attitude, I don't think that's likely...


Also, bear in mind the oeverhead for getting the debugger stuff working, 
I really wouldn't want to use it in production!


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] reading zope.config file for ClientStorage

2005-10-12 Thread Chris Withers

Mika, David P (Research) wrote:

OK, the opts object really did have everything loaded.  On careful inspection the 
opts.configroot has an attribute databases with a list of 
Zope.Startup.datatypes.ZopeDatabase instances.  I can do what I originally set out to do 
which was to open a ZEO.ClientStorage configured from the zope-with-zeo.conf file (the 
ZEO.ClientStorage is now wrapped in a ZEOClient object):

from Zope.Startup import options, handlers
opts = options.ZopeOptions()
opts.configfile='c:\Zope-Instance-Test\etc\zope-with-zeo.conf'
opts.load_schema()
opts.load_configfile()
for db in opts.configroot.databases:
 if is instance(db.config.storage, ZODB.config.ZEOClient):
  db.config.storage.open()


Great, right? Or am I missing some outstanding issue?

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] Error Type: ExpatError

2005-10-12 Thread Chris Withers
Get a packet sniffer going, looks like something is missing from the 
request when you hit reload!


cheers,

Chris

Garito wrote:

Hi all

I try to read an xml file using
from xml.dom.minidom import parseString

It works fine but when I push the reload button raise these error

Error Type: ExpatError
Error Value: no element found: line 1, column 0

These error is intermittence

These is the trace back any idea?

Traceback (innermost last):

Module ZPublisher.Publish, line 113, in publish
111 |  missing_name,
112 |  dont_publish_class,
113|  request, bind=1)
114 |
115 |if result is not response:

Module ZPublisher.mapply, line 88, in mapply
086 |
087 |args=tuple(args)
088|if debug is not None: return debug(object,args,context)
089 |else: return object(*args)

Module ZPublisher.Publish, line 40, in call_object
038 |
039 |def call_object(object, args, request):
040|result=apply(object,args) # Type scr to step into published 
object.

041 |return result
042 |

Module Shared.DC.Scripts.Bindings, line 311, in __call__
309 |def __call__(self, *args, **kw):
310 |'''Calls the script.'''
311|return self._bindAndExec(args, kw, None)
312 |
313 |def __render_with_namespace__(self, namespace):

Module Shared.DC.Scripts.Bindings, line 348, in _bindAndExec
346 |exec bindcode
347 |bound_data = bound_data[0]
348|return self._exec(bound_data, args, kw)
349 |finally:
350 |security.removeContext(self)

Module Products.PythonScripts.PythonScript, line 323, in _exec
321 |f = new.function(fcode, g, None, fadefs)
322 |
323|result = f(*args, **kw)
324 |if keyset is not None:
325 |# Store the result in the cache.

Module None, line 9, in Lanzar
  - ComandoYanged at /SitiosYanged/Huete/Web/Lanzar   - Line 9
006 |if 'Camino' not in args: args['Camino'] = traverse_subpath
007 |if 'Usuario' not in args: args['Usuario'] = 
str(context.Dame('usuario'))

008|args = context.ObtenerNodo(args)
009 |
010 |if args is None: Module Products.Yanged.SitioYanged, line 268, in 
ObtenerNodo
266 |   
267 |if 'NodoRaiz' not in args:
268|args['NodoRaiz'] = parseString(self.Dame({'nombre': 
self.getId() + '.mm'}).index_html(self.REQUEST, self.REQUEST.RESPONSE))
269 |if 'Nodos' not in args: args['Nodos'] = 
args['NodoRaiz'].childNodes

270 |if 'Nivel' not in args: args['Nivel'] = 0

Module xml.dom.minidom, line 1929, in parseString
1927 |if parser is None:
1928 |from xml.dom import expatbuilder
1929|return expatbuilder.parseString(string)
1930 |else:
1931 |from xml.dom import pulldom

Module xml.dom.expatbuilder, line 940, in parseString
938 |else:
939 |builder = ExpatBuilder()
940|return builder.parseString(string)
941 |
942 |

Module xml.dom.expatbuilder, line 223, in parseString
221 |parser = self.getParser()
222 |try:
223|parser.Parse(string, True)
224 |self._setup_subset(string)
225 |except ParseEscape:
ExpatError: no element found: line 1, column 0



Thanks!



--
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] help with MailTemplates 1.0.0

2005-10-12 Thread Nicolas Georgakopoulos

Chris Withers wrote:


Nicolas Georgakopoulos wrote:

Whatever you have selected is resolving to a string instead of a 
MailHost object :-S



I have selected a Zope mailhost object



Please explain exactly what you did, including how you create the 
MailHost, the Mail Template and the Python Script, in detail...


I just tried to reproduce this on a fresh Zope 2.8.1 instance and 
couldn't...


Using the first example, the mail rendered and sent just fine.

I'm still far from convinced the thing you think is a MailHost object 
is actually a MailHost object, did you perhaps delete or rename your 
MailHost object?


Chris

I make it work , the fist time I try to use it I had copied my Mailhost 
object from another folder and it wasn't working. I delete it and create 
another one with a different name. When I go to the MailTemplate object 
to chooses my new MailHost it was already selected but still not 
working. The problem was solved when I push the save button any way and 
it works ...


Trying to execute the attachment example , you forgot to put ' ' on the 
second mail address  line: mto=('[EMAIL PROTECTED]',[EMAIL PROTECTED]),

And to send the attachment I get another error:
strongError Type: Unauthorized/strongbr/
 strongError Value: You are not allowed to access 'add_file' in this 
context/strongbr/


and the traceback:

Traceback (innermost last):
   Module ZPublisher.Publish, line 113, in publish
   Module ZPublisher.mapply, line 88, in mapply
   Module ZPublisher.Publish, line 40, in call_object
 Module Shared.DC.Scripts.Bindings, line 311, in __call__
 Module Shared.DC.Scripts.Bindings, line 348, in _bindAndExec
 Module Products.PageTemplates.ZopePageTemplate, line 256, in _exec
 Module Products.PageTemplates.PageTemplate, line 102, in pt_render
- ZopePageTemplate at /AtestFordelete/tt
   Module TAL.TALInterpreter, line 206, in __call__
   Module TAL.TALInterpreter, line 250, in interpret
   Module TAL.TALInterpreter, line 426, in do_optTag_tal
   Module TAL.TALInterpreter, line 411, in do_optTag
   Module TAL.TALInterpreter, line 406, in no_tag
   Module TAL.TALInterpreter, line 250, in interpret
   Module TAL.TALInterpreter, line 501, in do_insertText_tal
   Module Products.PageTemplates.TALES, line 227, in evaluateText
 Module Products.PageTemplates.TALES, line 221, in evaluate
- URL: /AtestFordelete/tt
  - Line 12, Column 6
  - Expression: standard:'options/message'
  - Names:
   {'container': Folder at /AtestFordelete,
'context': Folder at /AtestFordelete,
  'default': Products.PageTemplates.TALES.Default instance at 0x01152AF8,
'here': Folder at /AtestFordelete,
  'loop': Products.PageTemplates.TALES.SafeMapping object at 0x01FC2990,
  'modules': Products.PageTemplates.ZRPythonExpr._SecureModuleImporter 
instance at 0x0112DD50,
  'nothing': None,
'options': {'args': ()},
  'repeat': Products.PageTemplates.TALES.SafeMapping object at 0x01FC2990,
'request': HTTPRequest, URL=http://localhost:8080/AtestFordelete/tt,
  'root': Application at ,
'template': ZopePageTemplate at /AtestFordelete/tt,
  'traverse_subpath': [],
  'user': admin}
 Module Products.PageTemplates.Expressions, line 183, in __call__
 Module Products.PageTemplates.Expressions, line 171, in _eval
 Module Products.PageTemplates.Expressions, line 127, in _eval
  - __traceback_info__: options
   Module Products.PageTemplates.Expressions, line 306, in restrictedTraverse
- __traceback_info__: {'path': ['message'], 'TraversalRequestNameStack': []}
KeyError: 'message'

I had change all my security options in the folder that I'm using the example 
objects (checked all the boxes on the Manager colum).
Am I doing something wrong?

PS: The test mail I received on the first simple example,  the part  a 
href=tal:define=url root/absolute_url tal:attributes=href url 
tal:content=url/ doesn't render right , it actually show in the body 
of my message mail  like --  your interest in: a 
href=http://localhost:8080; 
http://localhost:8080/http://localhost:8080 http://localhost:8080//a


Cheers..
___
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] INSTALLING gcc (and ZOPE) on DEBIAN

2005-10-12 Thread benmania

 It's probably not going to be enough anyway.
Oh.But is it possible to install a later DEBIAN PACKAGE VERSION because 
installing DEBIAN PACKAGES does work?
Whenever I try to install ZOPE via apt-get, it is just the 2.6 version that is 
installed but I need a 2.7 ZOPE version. 

 What
 is the end you are trying to reach?

Well, I want to get my ZOPE server running in order to be able to use a CONTENT 
Management System called ZMS that is based on ZOPE. But this CMS requires a 2.7 
ZOPE Version. 

__
Verschicken Sie romantische, coole und witzige Bilder per SMS!
Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193

___
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] Error Type: ExpatError

2005-10-12 Thread Garito

Chris Withers escribió:

Get a packet sniffer going, looks like something is missing from the 
request when you hit reload!


cheers,

Chris

Garito wrote:


Hi all

I try to read an xml file using
from xml.dom.minidom import parseString

It works fine but when I push the reload button raise these error

Error Type: ExpatError
Error Value: no element found: line 1, column 0

These error is intermittence

These is the trace back any idea?

Traceback (innermost last):

Module ZPublisher.Publish, line 113, in publish
111 |  missing_name,
112 |  dont_publish_class,
113|  request, bind=1)
114 |
115 |if result is not response:

Module ZPublisher.mapply, line 88, in mapply
086 |
087 |args=tuple(args)
088|if debug is not None: return debug(object,args,context)
089 |else: return object(*args)

Module ZPublisher.Publish, line 40, in call_object
038 |
039 |def call_object(object, args, request):
040|result=apply(object,args) # Type scr to step into 
published object.

041 |return result
042 |

Module Shared.DC.Scripts.Bindings, line 311, in __call__
309 |def __call__(self, *args, **kw):
310 |'''Calls the script.'''
311|return self._bindAndExec(args, kw, None)
312 |
313 |def __render_with_namespace__(self, namespace):

Module Shared.DC.Scripts.Bindings, line 348, in _bindAndExec
346 |exec bindcode
347 |bound_data = bound_data[0]
348|return self._exec(bound_data, args, kw)
349 |finally:
350 |security.removeContext(self)

Module Products.PythonScripts.PythonScript, line 323, in _exec
321 |f = new.function(fcode, g, None, fadefs)
322 |
323|result = f(*args, **kw)
324 |if keyset is not None:
325 |# Store the result in the cache.

Module None, line 9, in Lanzar
  - ComandoYanged at /SitiosYanged/Huete/Web/Lanzar   - Line 9
006 |if 'Camino' not in args: args['Camino'] = traverse_subpath
007 |if 'Usuario' not in args: args['Usuario'] = 
str(context.Dame('usuario'))

008|args = context.ObtenerNodo(args)
009 |
010 |if args is None: Module Products.Yanged.SitioYanged, line 268, 
in ObtenerNodo

266 |   267 |if 'NodoRaiz' not in args:
268|args['NodoRaiz'] = parseString(self.Dame({'nombre': 
self.getId() + '.mm'}).index_html(self.REQUEST, self.REQUEST.RESPONSE))
269 |if 'Nodos' not in args: args['Nodos'] = 
args['NodoRaiz'].childNodes

270 |if 'Nivel' not in args: args['Nivel'] = 0

Module xml.dom.minidom, line 1929, in parseString
1927 |if parser is None:
1928 |from xml.dom import expatbuilder
1929|return expatbuilder.parseString(string)
1930 |else:
1931 |from xml.dom import pulldom

Module xml.dom.expatbuilder, line 940, in parseString
938 |else:
939 |builder = ExpatBuilder()
940|return builder.parseString(string)
941 |
942 |

Module xml.dom.expatbuilder, line 223, in parseString
221 |parser = self.getParser()
222 |try:
223|parser.Parse(string, True)
224 |self._setup_subset(string)
225 |except ParseEscape:
ExpatError: no element found: line 1, column 0



Thanks!




Hi Chris!
Could you be a little more concrete?

Thanks!

--
Mis Cosas
http://blogs.sistes.net/Garito/


___
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] Error Type: ExpatError

2005-10-12 Thread Garito

Alan Milligan escribió:


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Garito wrote:
 


Chris Withers escribió:

   


Get a packet sniffer going, looks like something is missing from the
request when you hit reload!

cheers,

Chris

Garito wrote:

 


Hi all

I try to read an xml file using
from xml.dom.minidom import parseString

It works fine but when I push the reload button raise these error

Error Type: ExpatError
Error Value: no element found: line 1, column 0

These error is intermittence

These is the trace back any idea?

Traceback (innermost last):

Module ZPublisher.Publish, line 113, in publish
111 |  missing_name,
112 |  dont_publish_class,
113|  request, bind=1)
114 |
115 |if result is not response:

Module ZPublisher.mapply, line 88, in mapply
086 |
087 |args=tuple(args)
088|if debug is not None: return debug(object,args,context)
089 |else: return object(*args)

Module ZPublisher.Publish, line 40, in call_object
038 |
039 |def call_object(object, args, request):
040|result=apply(object,args) # Type scr to step into
published object.
041 |return result
042 |

Module Shared.DC.Scripts.Bindings, line 311, in __call__
309 |def __call__(self, *args, **kw):
310 |'''Calls the script.'''
311|return self._bindAndExec(args, kw, None)
312 |
313 |def __render_with_namespace__(self, namespace):

Module Shared.DC.Scripts.Bindings, line 348, in _bindAndExec
346 |exec bindcode
347 |bound_data = bound_data[0]
348|return self._exec(bound_data, args, kw)
349 |finally:
350 |security.removeContext(self)

Module Products.PythonScripts.PythonScript, line 323, in _exec
321 |f = new.function(fcode, g, None, fadefs)
322 |
323|result = f(*args, **kw)
324 |if keyset is not None:
325 |# Store the result in the cache.

Module None, line 9, in Lanzar
 - ComandoYanged at /SitiosYanged/Huete/Web/Lanzar   - Line 9
006 |if 'Camino' not in args: args['Camino'] = traverse_subpath
007 |if 'Usuario' not in args: args['Usuario'] =
str(context.Dame('usuario'))
008|args = context.ObtenerNodo(args)
009 |
010 |if args is None: Module Products.Yanged.SitioYanged, line 268,
in ObtenerNodo
266 |   267 |if 'NodoRaiz' not in args:
268|args['NodoRaiz'] = parseString(self.Dame({'nombre':
self.getId() + '.mm'}).index_html(self.REQUEST, self.REQUEST.RESPONSE))
269 |if 'Nodos' not in args: args['Nodos'] =
args['NodoRaiz'].childNodes
270 |if 'Nivel' not in args: args['Nivel'] = 0

Module xml.dom.minidom, line 1929, in parseString
1927 |if parser is None:
1928 |from xml.dom import expatbuilder
1929|return expatbuilder.parseString(string)
1930 |else:
1931 |from xml.dom import pulldom

Module xml.dom.expatbuilder, line 940, in parseString
938 |else:
939 |builder = ExpatBuilder()
940|return builder.parseString(string)
941 |
942 |

Module xml.dom.expatbuilder, line 223, in parseString
221 |parser = self.getParser()
222 |try:
223|parser.Parse(string, True)
224 |self._setup_subset(string)
225 |except ParseEscape:
ExpatError: no element found: line 1, column 0



Thanks!

   


Hi Chris!
Could you be a little more concrete?

Thanks!

   


You do realise that pyexpat has a limitation of 8192 bytes between xml
tags - if your parse string is longer than this, it will fail.  You can
recompile your expat parser to accept larger sizes, but this drastically
affects performance.

ALan

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.6 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iD8DBQFDTQhkCfroLk4EZpkRAjklAJ9VBl9jjzKvRBr9gN3mcGYePpxYSACgtZkZ
h/hu5V2gGxxKSp8JUk1WpIw=
=b7+S
-END PGP SIGNATURE-
 


Buff! Complicate

There are any out-of-the-box solution on Zope?

I mean: there are any other xml library on a standard Zope installation?

Thanks!

--
Mis Cosas
http://blogs.sistes.net/Garito/


___
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.conf read-only settings

2005-10-12 Thread Steven Hayles


AFAICS the directives zserver-read-only-mode and read-only-database just 
set the environment value ZOPE_READ_ONLY and no change in ZOPE's 
operation results. Am I right? This is ZOPE 2.7.7


Setting read-only in the database storage does make a difference (in my 
configuration, Formulator 1.6.2 throws an exception, but that's not a 
ZOPE issue).


Steven

___
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] Error Type: ExpatError

2005-10-12 Thread Fred Drake
On 10/12/05, Garito [EMAIL PROTECTED] wrote:
 Alan Milligan escribió:
...
 You do realise that pyexpat has a limitation of 8192 bytes between xml
 tags - if your parse string is longer than this, it will fail.  You can
 recompile your expat parser to accept larger sizes, but this drastically
 affects performance.

I certainly wasn't aware of any such limitation.  I'll construct a
test case to verify or refute this, and post the results.


  -Fred

--
Fred L. Drake, Jr.fdrake at gmail.com
Society attacks early, when the individual is helpless. --B.F. Skinner
___
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] Error Type: ExpatError

2005-10-12 Thread Fred Drake
On 10/12/05, Garito [EMAIL PROTECTED] wrote:
 Alan Milligan escribió:
 You do realise that pyexpat has a limitation of 8192 bytes between xml
 tags - if your parse string is longer than this, it will fail.  You can
 recompile your expat parser to accept larger sizes, but this drastically
 affects performance.

Ok, I don't know just where this assertion comes from; I can't
reproduce this at all with the pyexpat in Python 2.3.5 or 2.4.2.  I've
attached a short test program that verifies pyexpat's behavior.


  -Fred

--
Fred L. Drake, Jr.fdrake at gmail.com
Society attacks early, when the individual is helpless. --B.F. Skinner
Test asserted size limitation of text between tags for pyexpat.


__docformat__ = reStructuredText

from xml.parsers import expat

COUNT = 8192 * 10
SAMPLE_TEXT = docabc + (- * COUNT) + xyz/doc


buffer = []

def characters(text):
buffer.append(text)

p = expat.ParserCreate()
p.CharacterDataHandler = characters
p.Parse(SAMPLE_TEXT, True)

text = u.join(buffer)

assert len(text) == (COUNT + 6)
assert text.startswith(uabc---)
assert text.endswith(u---xyz)

# This is expected to print abc--- ---xyz
print text[:6], text[-6:]
___
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] Error Type: ExpatError

2005-10-12 Thread Fred Drake
On 10/12/05, Alan Milligan [EMAIL PROTECTED] wrote:
 I discovered this a couple of years ago wondering why RedHat's up2date
 XML-RPC client didn't wrap download files in base64 tags.  They've
 actually done some strange stuff in this client to use normal http calls
 to download RPM packages.

Silly RedHat.  Imagine using HTTP to transfer files...

 - From memory, the c expat library news up an 8192 char buffer to unpack
 *every* tag contents.  If you extend this size, performance seems to
 degrade massively...

Expat does have a buffer that provides some context for the current
event being reported, and the size of that buffer is defined by a
compile-time definition.  It should not be made too large, certainly. 
But it's not the way to retrieve normal document data from the parser,
either.  It's really only intended to do things like allow an
application to retrieve character references when character data is
reported, or to see what a tag actually looks like (we use this for
page templates to help make minimal changes when we don't actually
need to process TAL/METAL/I18N attributes on an element).

Retrieving document text should always be done using the character
data handler and a buffer to ensure the entire data within an element
is collected, since multiple callbacks will be made quite often.


  -Fred

--
Fred L. Drake, Jr.fdrake at gmail.com
Society attacks early, when the individual is helpless. --B.F. Skinner
___
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] Error Type: ExpatError

2005-10-12 Thread Tino Wildenhain

Fred Drake schrieb:

On 10/12/05, Alan Milligan [EMAIL PROTECTED] wrote:


I discovered this a couple of years ago wondering why RedHat's up2date
XML-RPC client didn't wrap download files in base64 tags.  They've
actually done some strange stuff in this client to use normal http calls
to download RPM packages.



Silly RedHat.  Imagine using HTTP to transfer files...


Err. Whats wrong with HTTP to transfer files?
(Provided its not XML-RPC ;)
___
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] Error Type: ExpatError

2005-10-12 Thread Fred Drake
On 10/12/05, Tino Wildenhain [EMAIL PROTECTED] wrote:
 Err. Whats wrong with HTTP to transfer files?
 (Provided its not XML-RPC ;)

Sorry; I was being facetious.


  -Fred

--
Fred L. Drake, Jr.fdrake at gmail.com
Society attacks early, when the individual is helpless. --B.F. Skinner
___
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] Error Type: ExpatError

2005-10-12 Thread Fred Drake
On 10/12/05, Alan Milligan [EMAIL PROTECTED] wrote:
 And you are allowed to be.   It is a bit strange in an XML-RPC dialog to
 drop out to http occasionally ...

Actually, I'd expect large files over XML-RPC to be handled by sending
a URL, and have the client GET the file separately.  But then, I have
weird ideas sometimes.

 This has absolutely nothing on them actually implementing a lot of their
 XML-RPC using HTTP GET, when the protocol clearly states it must be an
 HTTP POST ...

 (I imagine this is a performance enhancement in that you needn't
 xml-parse the payload ...)

Unless you can make the server a simple front-end to a pile-o-files on
disk, I don't see any benefit.  There's no issue for the client, only
the server, since they want to limit the number of machines they stick
behind the load-balancer.

Ok, I think we've agreed this isn't an Expat issue, but a bug in
RedHat code that's unrelated to using XML in Zope.  The Expat-based
minidom-builder in recent versions of Python is pretty well tested in
practice.


  -Fred

--
Fred L. Drake, Jr.fdrake at gmail.com
Society attacks early, when the individual is helpless. --B.F. Skinner
___
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] INSTALLING gcc (and ZOPE) on DEBIAN

2005-10-12 Thread Andreas Pakulat
On 12.10.05 12:15:33, [EMAIL PROTECTED] wrote:
 
  It's probably not going to be enough anyway.
 Oh.But is it possible to install a later DEBIAN PACKAGE VERSION because 
 installing DEBIAN PACKAGES does work?
 Whenever I try to install ZOPE via apt-get, it is just the 2.6 version that 
 is installed but I need a 2.7 ZOPE version. 

This should better be addressed on a debian mailing list. However, the
Pacakge for Zope 2.7 is called zope2.7 and IIRC is only available in
Sarge (or newer) Debian releases, not in Woody (aka Debian 3.0).

Andreas

-- 
You single-handedly fought your way into this hopeless mess.
___
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] How can i call a pyhton module's function from with in Page Temmplates?

2005-10-12 Thread Thomas Apostolou
Hello,

i saw that from within a DTML Method one is able to
call a fuction of a python module in the file system.

Now i want to get the funtion's results from within a
Page Template.
Is the right way to make a Script(Python) that calls
this module's function and then call this
Script(Python) from within my Page Template?
Is there any other less nifty way to do this?

Thanks in advance.






___ 
Χρησιμοποιείτε Yahoo!; 
Βαρεθήκατε τα ενοχλητικά μηνύματα (spam); Το Yahoo! Mail 
διαθέτει την καλύτερη δυνατή προστασία κατά των ενοχλητικών 
μηνυμάτων http://login.yahoo.com/config/mail?.intl=gr 

___
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] How can i call a pyhton module's function from with in Page Temmplates?

2005-10-12 Thread Peter Bengtsson
If you already know DTML but need to learn ZPTs I suggest you have a
look at this old document
http://www.zope.org/Members/peterbe/DTML2ZPT

2005/10/12, Thomas Apostolou [EMAIL PROTECTED]:
 Hello,

 i saw that from within a DTML Method one is able to
 call a fuction of a python module in the file system.

 Now i want to get the funtion's results from within a
 Page Template.
 Is the right way to make a Script(Python) that calls
 this module's function and then call this
 Script(Python) from within my Page Template?
 Is there any other less nifty way to do this?

 Thanks in advance.






 ___
 Χρησιμοποιείτε Yahoo!;
 Βαρεθήκατε τα ενοχλητικά μηνύματα (spam); Το Yahoo! Mail
 διαθέτει την καλύτερη δυνατή προστασία κατά των ενοχλητικών
 μηνυμάτων http://login.yahoo.com/config/mail?.intl=gr

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



--
Peter Bengtsson,
work www.fry-it.com
home www.peterbe.com
hobby www.issuetrackerproduct.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] Error Type: ExpatError

2005-10-12 Thread Garito

Fred Drake escribió:


On 10/12/05, Alan Milligan [EMAIL PROTECTED] wrote:
 


And you are allowed to be.   It is a bit strange in an XML-RPC dialog to
drop out to http occasionally ...
   



Actually, I'd expect large files over XML-RPC to be handled by sending
a URL, and have the client GET the file separately.  But then, I have
weird ideas sometimes.

 


This has absolutely nothing on them actually implementing a lot of their
XML-RPC using HTTP GET, when the protocol clearly states it must be an
HTTP POST ...

(I imagine this is a performance enhancement in that you needn't
xml-parse the payload ...)
   



Unless you can make the server a simple front-end to a pile-o-files on
disk, I don't see any benefit.  There's no issue for the client, only
the server, since they want to limit the number of machines they stick
behind the load-balancer.

Ok, I think we've agreed this isn't an Expat issue, but a bug in
RedHat code that's unrelated to using XML in Zope.  The Expat-based
minidom-builder in recent versions of Python is pretty well tested in
practice.


 -Fred

--
Fred L. Drake, Jr.fdrake at gmail.com
Society attacks early, when the individual is helpless. --B.F. Skinner
___
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 )
 


Hi all!
I use an XML file because I like to use freemind like editor
I think perhaps could be better if I could transform it to a good Zope 
object instead of XML but I don't know how to make zope ftp server serve 
this file like a method


I know how to read the file (PUT_factory method) but I want freemind to 
read a created file


Some idea?

Thanks!

--
Mis Cosas
http://blogs.sistes.net/Garito/


___
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] Determining user from session object - who is logged in?

2005-10-12 Thread Gaute Amundsen

I thought the place to start wold be:  /temp_folder/session_data/

I have built a small little thing to play with the contents of that.
External method and script below.

However I have not been able to figure out a way to connect these sessions 
with logged in users. 

I suppose I could make some add/remove actions to log the data somewhere, and 
then get it from there, but there has to be some more direct way...

Any ideas anyone?

Gaute.

--
def CurrentSessions(self):
root = self.getPhysicalRoot()
session_data =  root.restrictedTraverse('/temp_folder/session_data')
return session_data.items()


## Script (Python) view_sessions
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##


def timeSpan(secs):
# seconds - hours, minutes og seconds
hours = int(secs/3600)
secs = secs % 3600
minutes =  int(secs/60)
secs = int(secs % 60)
return %02d:%02d:%02d % (hours, minutes, secs)

print 'View session data'

# flush expired objects...?
session = context.session_data_manager.getSessionData()
session.set('This is','me')

data = container.CurrentSessions()

print str(len(data)) + ' objects'

for i in data: 
last = i[1].getLastAccessed()
made = i[1].getCreated()
now = DateTime().timeTime()

print i[1].items()
print 'Made: '+DateTime(made).strftime('%Y-%m-%d %H:%M:%S')
#print 'Last: '+DateTime(last).strftime('%Y-%m-%d %H:%M:%S')
#print 'Now:  '+DateTime(now).strftime('%Y-%m-%d %H:%M:%S')
print 'Used: ' + timeSpan(last - made)
print 'Idle: ' + timeSpan(now - last)
print ''

return printed
--
___
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] Error Type: ExpatError

2005-10-12 Thread Garito

Fred Drake escribió:


On 10/12/05, Garito [EMAIL PROTECTED] wrote:
 


Alan Milligan escribió:
   


You do realise that pyexpat has a limitation of 8192 bytes between xml
tags - if your parse string is longer than this, it will fail.  You can
recompile your expat parser to accept larger sizes, but this drastically
affects performance.
 



Ok, I don't know just where this assertion comes from; I can't
reproduce this at all with the pyexpat in Python 2.3.5 or 2.4.2.  I've
attached a short test program that verifies pyexpat's behavior.


 -Fred

--
Fred L. Drake, Jr.fdrake at gmail.com
Society attacks early, when the individual is helpless. --B.F. Skinner
 




Test asserted size limitation of text between tags for pyexpat.


__docformat__ = reStructuredText

from xml.parsers import expat

COUNT = 8192 * 10
SAMPLE_TEXT = docabc + (- * COUNT) + xyz/doc


buffer = []

def characters(text):
   buffer.append(text)

p = expat.ParserCreate()
p.CharacterDataHandler = characters
p.Parse(SAMPLE_TEXT, True)

text = u.join(buffer)

assert len(text) == (COUNT + 6)
assert text.startswith(uabc---)
assert text.endswith(u---xyz)

# This is expected to print abc--- ---xyz
print text[:6], text[-6:]
 


I run your test but no error was raised

I attach an xml file like I use and who raise the error, perhaps these 
could help to reproduce the error


This file is generated by freemind 
(http://freemind.sourceforge.net/wiki/index.php/Main_Page)


Thank you very much for your help

--
Mis Cosas
http://blogs.sistes.net/Garito/

map version=0.8.0
!-- To view this file, download free mind mapping software FreeMind from 
http://freemind.sourceforge.net --
node CREATED=1127700855755 ID=Freemind_Link_1311124656 
MODIFIED=1129138598866 TEXT=Test
node CREATED=1127700855755 ID=Freemind_Link_1056252011 
MODIFIED=1129138606557 POSITION=right TEXT=Node1
node CREATED=1127700855755 ID=Freemind_Link_1585447361 
MODIFIED=1129138629570 TEXT=Node1.1
node CREATED=1127700855755 ID=Freemind_Link_1321508146 
MODIFIED=1129138650650 TEXT=Node1.1.1
node CREATED=1127700855755 ID=Freemind_Link_1478499906 
MODIFIED=1129138667264 TEXT=Node1.1.1.1/
node CREATED=1127700855755 ID=Freemind_Link_1451771679 
MODIFIED=1129138674545 TEXT=Node1.1.1.2/
node CREATED=1127700855755 ID=Freemind_Link_13209311 
MODIFIED=1129138681425 TEXT=Node1.1.1.3/
node CREATED=1127700855755 ID=Freemind_Link_784046441 
MODIFIED=1129138688174 TEXT=Node1.1.1.4/
node CREATED=1127700855755 ID=Freemind_Link_595413957 
MODIFIED=1129138699571 TEXT=Node1.1.1.5/
/node
node CREATED=1127700855755 ID=Freemind_Link_1923488184 
MODIFIED=1129138656489 TEXT=Node1.1.2
node CREATED=1127700855755 ID=Freemind_Link_582825078 
MODIFIED=1129138662127 TEXT=Node1.1.2.1/
/node
/node
node CREATED=1127700855755 ID=Freemind_Link_1828131178 
MODIFIED=1129138635298 TEXT=Node1.2
node CREATED=1127700855755 ID=_Freemind_Link_420363894 
MODIFIED=1129138707943 TEXT=Node1.2.1
node CREATED=1127700855755 ID=Freemind_Link_707858988 
MODIFIED=1129138713451 TEXT=Node1.2.1.1
node CREATED=1127700855755 ID=Freemind_Link_1900443373 
MODIFIED=1129138718748 TEXT=Node1.2.1.1.1
node CREATED=1127700855755 ID=Freemind_Link_1378528701 
MODIFIED=1129138726009 TEXT=Node1.2.1.1.1.1
node CREATED=1127700855755 ID=Freemind_Link_363886592 
MODIFIED=1129138732638 TEXT=Node1.2.1.1.1.1.1/
/node
node CREATED=1127700855755 ID=Freemind_Link_321491817 
MODIFIED=1129138744676 TEXT=Node1.2.1.1.1.2
node CREATED=1127700855755 ID=Freemind_Link_1267999854 
MODIFIED=1129138754279 TEXT=Node1.2.1.1.1.2.1/
/node
/node
/node
/node
/node
node CREATED=1127700855755 ID=Freemind_Link_1592123298 
MODIFIED=1129138638793 TEXT=Node1.3
node CREATED=1127700855755 ID=Freemind_Link_1263544703 
MODIFIED=1129138759637 TEXT=Node1.3.1/
node CREATED=1127700855755 ID=_Freemind_Link_1840865317 
MODIFIED=1129138763353 TEXT=Node1.3.2
node CREATED=1127700855755 ID=Freemind_Link_676620919 
MODIFIED=1129138776261 TEXT=Node1.3.2.1
node CREATED=1127700855755 ID=Freemind_Link_1963460314 
MODIFIED=1129138784303 TEXT=Node1.3.2.1.1/
node CREATED=1127700855755 ID=Freemind_Link_373718992 
MODIFIED=1129138790361 TEXT=Node1.3.2.1.2/
/node
/node
/node
node CREATED=1127700855755 ID=_Freemind_Link_1084655594 
MODIFIED=1129138642999 TEXT=Node1.4
node CREATED=1127700855755 ID=Freemind_Link_134129536 
MODIFIED=1129138799595 TEXT=Node1.4.1
node CREATED=1127700855755 ID=Freemind_Link_1320959236 
MODIFIED=1129138813084 TEXT=Node1.4.1.1
node CREATED=1127700855755 ID=Freemind_Link_207980543 
MODIFIED=1129138818402 TEXT=Node1.4.1.1.1
node CREATED=1127700855755 ID=Freemind_Link_1524296389 
MODIFIED=1129138823028 TEXT=Node1.4.1.1.1/
/node
/node
/node
node CREATED=1127700855755 ID=Freemind_Link_1434191936 
MODIFIED=1129138805423 TEXT=Node1.4.2
node CREATED=1127700855755 ID=Freemind_Link_1227127130 
MODIFIED=1129138831110 TEXT=Node1.4.2.1/
/node
/node
/node
node CREATED=1127700855755 ID=Freemind_Link_587511489 

Re: [Zope] Error Type: ExpatError

2005-10-12 Thread Garito

Alan Milligan escribió:


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Garito wrote:
 


Fred Drake escribió:

   


On 10/12/05, Alan Milligan [EMAIL PROTECTED] wrote:


 


And you are allowed to be.   It is a bit strange in an XML-RPC dialog to
drop out to http occasionally ...
 
   


Actually, I'd expect large files over XML-RPC to be handled by sending
a URL, and have the client GET the file separately.  But then, I have
weird ideas sometimes.



 


This has absolutely nothing on them actually implementing a lot of their
XML-RPC using HTTP GET, when the protocol clearly states it must be an
HTTP POST ...

(I imagine this is a performance enhancement in that you needn't
xml-parse the payload ...)
 
   


Unless you can make the server a simple front-end to a pile-o-files on
disk, I don't see any benefit.  There's no issue for the client, only
the server, since they want to limit the number of machines they stick
behind the load-balancer.

Ok, I think we've agreed this isn't an Expat issue, but a bug in
RedHat code that's unrelated to using XML in Zope.  The Expat-based
minidom-builder in recent versions of Python is pretty well tested in
practice.


-Fred

--
Fred L. Drake, Jr.fdrake at gmail.com
Society attacks early, when the individual is helpless. --B.F. Skinner
___
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 )


 


Hi all!
I use an XML file because I like to use freemind like editor
I think perhaps could be better if I could transform it to a good Zope
object instead of XML but I don't know how to make zope ftp server serve
this file like a method

I know how to read the file (PUT_factory method) but I want freemind to
read a created file

Some idea?

Thanks!

   


I've no idea what freemind is, but have you installed ExternalEditor??
With this you should be able to connect any editor you require.  It
works by overriding the PUT method, popularised with both ftp and web-dav.

Alan
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.6 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iD8DBQFDTUosCfroLk4EZpkRAnfkAKC0BFcz3QFO1T/Uc2kpurKjNnKenACgv6vd
Q2rEdQfogS5EA9CE0w8sAf8=
=N+ql
-END PGP SIGNATURE-
 


Sorry for my english
I would like to create a method on my container that will be a file by FTP
With these I could transform XML to a Zope object better than XML

I will use PUT_factory to read the XML file but I don't know the write 
method


Could any one put an example (if these is possible)?

If these FTP behaviour is not possible I think the better solution is 
maintain the XML file. isn't it?


Thanks

PD: freemind link: http://freemind.sourceforge.net/wiki/index.php/Main_Page

--
Mis Cosas
http://blogs.sistes.net/Garito/


___
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] Determining user from session object - who is logged in?

2005-10-12 Thread Chris McDonough
On Wed, 2005-10-12 at 19:32 +0200, Gaute Amundsen wrote:
 I thought the place to start wold be:  /temp_folder/session_data/
 
 I have built a small little thing to play with the contents of that.
 External method and script below.
 
 However I have not been able to figure out a way to connect these sessions 
 with logged in users. 

There is no built-in connection between the two.  If you want to do
this, you need to use a user folder implementations that keeps
credentials in the session.

- 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] Error Type: ExpatError

2005-10-12 Thread Garito

Alan Milligan escribió:


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Garito wrote:
 


Alan Milligan escribió:

Garito wrote:


   


Fred Drake escribió:

 

 


On 10/12/05, Alan Milligan [EMAIL PROTECTED] wrote:


   

   


And you are allowed to be.   It is a bit strange in an XML-RPC
dialog to
drop out to http occasionally ...

 
 


Actually, I'd expect large files over XML-RPC to be handled by sending
a URL, and have the client GET the file separately.  But then, I have
weird ideas sometimes.



   

   


This has absolutely nothing on them actually implementing a lot of
their
XML-RPC using HTTP GET, when the protocol clearly states it must be an
HTTP POST ...

(I imagine this is a performance enhancement in that you needn't
xml-parse the payload ...)

 
 


Unless you can make the server a simple front-end to a pile-o-files on
disk, I don't see any benefit.  There's no issue for the client, only
the server, since they want to limit the number of machines they stick
behind the load-balancer.

Ok, I think we've agreed this isn't an Expat issue, but a bug in
RedHat code that's unrelated to using XML in Zope.  The Expat-based
minidom-builder in recent versions of Python is pretty well tested in
practice.


-Fred

--
Fred L. Drake, Jr.fdrake at gmail.com
Society attacks early, when the individual is helpless. --B.F.
Skinner
___
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 )


   
   


Hi all!
I use an XML file because I like to use freemind like editor
I think perhaps could be better if I could transform it to a good Zope
object instead of XML but I don't know how to make zope ftp server serve
this file like a method

I know how to read the file (PUT_factory method) but I want freemind to
read a created file

Some idea?

Thanks!

 
 


I've no idea what freemind is, but have you installed ExternalEditor??
With this you should be able to connect any editor you require.  It
works by overriding the PUT method, popularised with both ftp and
web-dav.

Alan
   



 


Sorry for my english
   


Heh, I still don't quite understand what you want ...
 


I would like to create a method on my container that will be a file by FTP
With these I could transform XML to a Zope object better than XML
   



You are aware that you can save arbitrary XML as ZPT with a content-type
of 'text/xml' ...
If you install ExternalEditor, you can edit it with whatever tool you want.

 


I will use PUT_factory to read the XML file but I don't know the write
method
   


Don't you mean GET here - PUT is the write method.

Alan

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.6 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iD8DBQFDTVTUCfroLk4EZpkRAnzkAJ4ofhPS1vCRwInPdMtMoNZbW55xeQCfYRqW
K0F3qROSptQ9EE8u9aws2/Q=
=dMcF
-END PGP SIGNATURE-
 

Can you put here an example about how to do what I need to do with the 
PUT method?


Thanks!

--
Mis Cosas
http://blogs.sistes.net/Garito/


___
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] Error Type: ExpatError

2005-10-12 Thread Fred Drake
On 10/12/05, Garito [EMAIL PROTECTED] wrote:
 I run your test but no error was raised

Right.

 I attach an xml file like I use and who raise the error, perhaps these
 could help to reproduce the error

If you replaced SAMPLE_TEXT in the test script with this data, an
error would indeed be raised, because it's testing that it got the
data from the sample text.  The test was intended to demonstrate that
pyexpat can handle more than 8192 characters of data between tags, and
does so.

I was able to verify well-formedness of your document, and load it
into minidom from a file without problems, using Python 2.3.5 and
2.4.2.  I need more information about what went wrong for you before I
can help with that; the error you received suggests that there was no
input at all.


  -Fred

--
Fred L. Drake, Jr.fdrake at gmail.com
Society attacks early, when the individual is helpless. --B.F. Skinner
___
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] selected in select lists

2005-10-12 Thread Garry Saddington


I have a variable called 'groupabbrev' in the REQUEST. I am trying to 
automatically select an option in a select list based on this variable.
I have tried this code and many others, and many googles but have not 
found anything that works. Can anyone see what I am doing wrong?



select name=groupabbrev
dtml-in getpastoralgroups
option value=dtml-var groupabbrev dtml-if 
expr='groupabbrev'==_['sequence-item'] selected/dtml-if dtml-var 
groupabbrev/option

/dtml-in
/select

regards
Garry

___
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] selected in select lists

2005-10-12 Thread J Cameron Cooper

Garry Saddington wrote:


I have a variable called 'groupabbrev' in the REQUEST. I am trying to 
automatically select an option in a select list based on this variable.
I have tried this code and many others, and many googles but have not 
found anything that works. Can anyone see what I am doing wrong?



select name=groupabbrev
dtml-in getpastoralgroups
option value=dtml-var groupabbrev dtml-if 
expr='groupabbrev'==_['sequence-item'] selected/dtml-if dtml-var 
groupabbrev/option

/dtml-in
/select


Why have you put 'groupabbrev' in quotes? That makes it a string, and 
the condition will only be true when the current item is equal to 
groupabbrev.


Presumably you want the value of the variable named that, rather than a 
string of that name.


Also, watch the values of what 'getpastoralgroups' returns. The 
condition will never be true if they are not strings or converted into such.


--jcc
--
Building Websites with Plone
http://plonebook.packtpub.com/

Enfold Systems, LLC
http://www.enfoldsystems.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] selected in select lists

2005-10-12 Thread Garry Saddington

J Cameron Cooper wrote:


Garry Saddington wrote:



I have a variable called 'groupabbrev' in the REQUEST. I am trying to 
automatically select an option in a select list based on this variable.
I have tried this code and many others, and many googles but have not 
found anything that works. Can anyone see what I am doing wrong?



select name=groupabbrev
dtml-in getpastoralgroups
option value=dtml-var groupabbrev dtml-if 
expr='groupabbrev'==_['sequence-item'] selected/dtml-if 
dtml-var groupabbrev/option

/dtml-in
/select



Why have you put 'groupabbrev' in quotes? 


I am fishing in the dark

That makes it a string, and the condition will only be true when the 
current item is equal to groupabbrev.


Presumably you want the value of the variable named that, rather than 
a string of that name.


Also, watch the values of what 'getpastoralgroups' returns. The 
condition will never be true if they are not strings or converted into 
such.


--jcc


Now I have tried both of the following with no result:
dtml-if expr=groupabbrev==_.str(_['sequence-item'])

dtml-if expr=groupabbrev==_['sequence-item']

Are there any other ways I could try?
regards
Garry

___
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] Determining user from session object - who is logged in?

2005-10-12 Thread Chris McDonough


On Oct 12, 2005, at 4:50 PM, Gaute Amundsen wrote:


On Wednesday 12 October 2005 20:19, Chris McDonough wrote:


On Wed, 2005-10-12 at 19:32 +0200, Gaute Amundsen wrote:


I thought the place to start wold be:  /temp_folder/session_data/

I have built a small little thing to play with the contents of that.
External method and script below.

However I have not been able to figure out a way to connect these
sessions with logged in users.



There is no built-in connection between the two.  If you want to do
this, you need to use a user folder implementations that keeps
credentials in the session.



Hm.. ok.

So what strategy would you chose?

1) Tweak ExuserFolder to put credentials in the session.

2) Use an addScript on session_data to put credentials in the session.

3) Use 1 or 2 to put credentials somewhere else?

And thanks :)


Probably 1, because it's possible for a session to be created without  
someone being logged in, and exUserFolder is probably really the only  
thing that knows when someone logs in and out.


- 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] selected in select lists

2005-10-12 Thread Garry Saddington

Nicolas Gouzy wrote:


I think this code works :

select name=groupabbrev
dtml-in getpastoralgroups
option value=dtml-var expr=_['sequence-item'] dtml-if
expr=groupabbrev==_['sequence-item'] selected/dtml-if dtml-var
expr=_['sequence-item']/option
/dtml-in
/select

--
Nicolas Gouzy
[EMAIL PROTECTED]


 


This producing the following result, is this what it should do?
select name=groupabbrev
  option value=Shared.DC.ZRDB.Results.r object at 
0x43aa7c0cShared.DC.ZRDB.Results.r object at 0x43aa7c0c/option
  option value=Shared.DC.ZRDB.Results.r object at 
0x43f95824Shared.DC.ZRDB.Results.r object at 0x43f95824/option
  option value=Shared.DC.ZRDB.Results.r object at 
0x43aa7c0cShared.DC.ZRDB.Results.r object at 0x43aa7c0c/option
  option value=Shared.DC.ZRDB.Results.r object at 
0x43f95824Shared.DC.ZRDB.Results.r object at 0x43f95824/option

/select
regards
Garry

___
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] selected in select lists

2005-10-12 Thread J Cameron Cooper

Garry Saddington wrote:

J Cameron Cooper wrote:


Garry Saddington wrote:



I have a variable called 'groupabbrev' in the REQUEST. I am trying to 
automatically select an option in a select list based on this variable.
I have tried this code and many others, and many googles but have not 
found anything that works. Can anyone see what I am doing wrong?



select name=groupabbrev
dtml-in getpastoralgroups
option value=dtml-var groupabbrev dtml-if 
expr='groupabbrev'==_['sequence-item'] selected/dtml-if 
dtml-var groupabbrev/option

/dtml-in
/select




Why have you put 'groupabbrev' in quotes? 



I am fishing in the dark

That makes it a string, and the condition will only be true when the 
current item is equal to groupabbrev.


Presumably you want the value of the variable named that, rather than 
a string of that name.


Also, watch the values of what 'getpastoralgroups' returns. The 
condition will never be true if they are not strings or converted into 
such.


--jcc



Now I have tried both of the following with no result:
dtml-if expr=groupabbrev==_.str(_['sequence-item'])

dtml-if expr=groupabbrev==_['sequence-item']

Are there any other ways I could try?


What does groupabbrev look like? What does _['sequence-item'] look like? 
Can they ever be equal?


--jcc

--
Building Websites with Plone
http://plonebook.packtpub.com/

Enfold Systems, LLC
http://www.enfoldsystems.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] selected in select lists

2005-10-12 Thread J Cameron Cooper

Garry Saddington wrote:

Nicolas Gouzy wrote:


I think this code works :

select name=groupabbrev
dtml-in getpastoralgroups
option value=dtml-var expr=_['sequence-item'] dtml-if
expr=groupabbrev==_['sequence-item'] selected/dtml-if dtml-var
expr=_['sequence-item']/option
/dtml-in
/select

--
Nicolas Gouzy
[EMAIL PROTECTED]


 


This producing the following result, is this what it should do?
select name=groupabbrev
  option value=Shared.DC.ZRDB.Results.r object at 
0x43aa7c0cShared.DC.ZRDB.Results.r object at 0x43aa7c0c/option
  option value=Shared.DC.ZRDB.Results.r object at 
0x43f95824Shared.DC.ZRDB.Results.r object at 0x43f95824/option
  option value=Shared.DC.ZRDB.Results.r object at 
0x43aa7c0cShared.DC.ZRDB.Results.r object at 0x43aa7c0c/option
  option value=Shared.DC.ZRDB.Results.r object at 
0x43f95824Shared.DC.ZRDB.Results.r object at 0x43f95824/option

/select


Like I said: be careful about what comes out of getpastoralgroups.

These are Result objects, not strings. Like any result objects, they 
store data in attributes with the same name as the row that came out of 
the SQL results.


You must use a row in your comparison: a Result object can never be 
equal to a string.


--jcc
--
Building Websites with Plone
http://plonebook.packtpub.com/

Enfold Systems, LLC
http://www.enfoldsystems.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] selected in select lists

2005-10-12 Thread Garry Saddington

J Cameron Cooper wrote:


Garry Saddington wrote:


Nicolas Gouzy wrote:


I think this code works :

select name=groupabbrev
dtml-in getpastoralgroups
option value=dtml-var expr=_['sequence-item'] dtml-if
expr=groupabbrev==_['sequence-item'] selected/dtml-if dtml-var
expr=_['sequence-item']/option
/dtml-in
/select

--
Nicolas Gouzy
[EMAIL PROTECTED]


 


This producing the following result, is this what it should do?
select name=groupabbrev
  option value=Shared.DC.ZRDB.Results.r object at 
0x43aa7c0cShared.DC.ZRDB.Results.r object at 0x43aa7c0c/option
  option value=Shared.DC.ZRDB.Results.r object at 
0x43f95824Shared.DC.ZRDB.Results.r object at 0x43f95824/option
  option value=Shared.DC.ZRDB.Results.r object at 
0x43aa7c0cShared.DC.ZRDB.Results.r object at 0x43aa7c0c/option
  option value=Shared.DC.ZRDB.Results.r object at 
0x43f95824Shared.DC.ZRDB.Results.r object at 0x43f95824/option

/select



Like I said: be careful about what comes out of getpastoralgroups.

These are Result objects, not strings. Like any result objects, they 
store data in attributes with the same name as the row that came out 
of the SQL results.


You must use a row in your comparison: a Result object can never be 
equal to a string.


--jcc


I have solved this with the following, I hope it may be of help to others:
ZSQL:
select groupabbrev as thisgroupabbrev from pastoralgroup

DTML:
select name=groupabbrev
dtml-in getpastoralgroups
option value=dtml-var thisgroupabbrev dtml-if 
expr=groupabbrev==_.str(thisgroupabbrev) selected/dtml-if 
dtml-var thisgroupabbrev/option

/dtml-in
/select
Thanks for all your help
Garry

___
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] Determining user from session object - who is logged in?

2005-10-12 Thread Gaute Amundsen
On Wednesday 12 October 2005 22:58, Chris McDonough wrote:
 On Oct 12, 2005, at 4:50 PM, Gaute Amundsen wrote:
  On Wednesday 12 October 2005 20:19, Chris McDonough wrote:
  On Wed, 2005-10-12 at 19:32 +0200, Gaute Amundsen wrote:
  I thought the place to start wold be:  /temp_folder/session_data/
 
  I have built a small little thing to play with the contents of that.
  External method and script below.
 
  However I have not been able to figure out a way to connect these
  sessions with logged in users.
 
  There is no built-in connection between the two.  If you want to do
  this, you need to use a user folder implementations that keeps
  credentials in the session.
 
  Hm.. ok.
 
  So what strategy would you chose?
 
  1) Tweak ExuserFolder to put credentials in the session.
 
  2) Use an addScript on session_data to put credentials in the session.
 
  3) Use 1 or 2 to put credentials somewhere else?
 
  And thanks :)

 Probably 1, because it's possible for a session to be created without
 someone being logged in, and exUserFolder is probably really the only
 thing that knows when someone logs in and out.


Well, I know that ther might easily be login less sessions, 
but, is it possible to log have session less logins?

The first case would not be a problem. I expect one could easily detect the 
lack of userdata, and skip altering the session, and in that case would not 
an addScript let me solve this without resort to external methods, or product 
code?

Gaute
___
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] Error Type: ExpatError

2005-10-12 Thread Garito

Fred Drake escribió:


On 10/12/05, Garito [EMAIL PROTECTED] wrote:
 


I run your test but no error was raised
   



Right.

 


I attach an xml file like I use and who raise the error, perhaps these
could help to reproduce the error
   



If you replaced SAMPLE_TEXT in the test script with this data, an
error would indeed be raised, because it's testing that it got the
data from the sample text.  The test was intended to demonstrate that
pyexpat can handle more than 8192 characters of data between tags, and
does so.

I was able to verify well-formedness of your document, and load it
into minidom from a file without problems, using Python 2.3.5 and
2.4.2.  I need more information about what went wrong for you before I
can help with that; the error you received suggests that there was no
input at all.


 -Fred

--
Fred L. Drake, Jr.fdrake at gmail.com
Society attacks early, when the individual is helpless. --B.F. Skinner
 



Hi again Fred!

What do you need?

Thanks!

--
Mis Cosas
http://blogs.sistes.net/Garito/


___
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] Re: Zope Hotfix 2005-10-09 broke my zope 2.7.5

2005-10-12 Thread John Schinnerer
Aloha,

Well, according to a comment on the hotfix page on problems with
applying it to 2.7.0, which was posted after I had already killed my
2.7.5 by applying it, there are some issues which might break it
on/during startup, such as config file items expected but not present
for at least one of the affected products, perms issues, etc.

JohnS.

--- Andreas Jung [EMAIL PROTECTED] wrote:

 --On 10. Oktober 2005 20:21:10 -0700 John Schinnerer 
 [EMAIL PROTECTED] wrote:
 
  Aloha,
 
  I just applied the below hotfix as directed to a zope 2.7.5
  installation on my development machine.
 
  It broke something bad, now the browser just says
 
  The connection was refused when attempting to contact
 localhost:9673
 
  I cannot access the ZMI nor any site pages, not on localhost:9673
 nor
  on 127.0.0.1:9673
 
  That is the port it was installed and had been working on.
  I did nothing but install the hotfix as directed on the linked page
  below.
 
  I have completely restarted the machine.
  At boot time the messages indicate that zope started fine, as
 usual.
 
 When Zope does not respond to requests as stated then there has been 
 something during the startup phase of phase. I do not believe that
 the patch
 causes a startup problem. If it does then you applied it the wrong
 way or 
 you are not telling us all details in terms of error messages
 happening 
 during startup.
 
 -aj
 
 
  ___
 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 )
 





__ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.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] Error Type: ExpatError

2005-10-12 Thread Fred Drake
On 10/12/05, Garito [EMAIL PROTECTED] wrote:
 What do you need?

In this bit of code:

Module Products.Yanged.SitioYanged, line 268, in ObtenerNodo
266 |
267 |   if 'NodoRaiz' not in args:
268|   args['NodoRaiz'] =
parseString(self.Dame({'nombre': self.getId() +
'.mm'}).index_html(self.REQUEST, self.REQUEST.RESPONSE))
269 |   if 'Nodos' not in args: args['Nodos'] =
args['NodoRaiz'].childNodes
270 |   if 'Nivel' not in args: args['Nivel'] = 0

The expression

self.Dame({'nombre': self.getId() + '.mm'})

is providing something that's being passed to the XML parser (the
parseString() function).  That string is the data that's in question;
if you can get that string and send it to me (as a file attachment,
preferably), I'll try to figure out what's happening.  The Yanged
product I've never heard of, and don't know anything about its code. 
But I know something about the XML parser being used.  :-)


  -Fred

--
Fred L. Drake, Jr.fdrake at gmail.com
Society attacks early, when the individual is helpless. --B.F. Skinner
___
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 )