[Zope] zdb (was: error with simple python script loop)

2006-11-29 Thread Maurits van Rees
Chris Withers, on 2006-11-28:
 Paul Winkler wrote:
 I still prefer zdb, because you can actually see and step through the
 script code.
 http://www.simplistix.co.uk/software/zope/zdb

Do you mean you can put this in a .cpy file:

  from Products.zdb import set_trace
  set_trace()

and then you can see the script code in the debugger?

When I try that I end up in the debugger, but I don't see anything
different from the normal pdb.set_trace().  When I press 'l' I just
see [EOF] like always.  Is there a trick I am missing?

It *would* be neat! :)

 It also includes the security declarations necessary to import it from 
 untrusted code :-)

Those security declarations are actually the only thing that
svn://svn.zope.org/repos/main/Products.enablesettrace itself does.

-- 
Maurits van Rees | http://maurits.vanrees.org/ [NL]
Work | http://zestsoftware.nl/
Do not worry about your difficulties in computers,
 I can assure you mine are still greater.

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

2006-11-29 Thread Chris Withers

Maurits van Rees wrote:

Chris Withers, on 2006-11-28:

Paul Winkler wrote:

I still prefer zdb, because you can actually see and step through the
script code.
http://www.simplistix.co.uk/software/zope/zdb


Do you mean you can put this in a .cpy file:


If you go back in the thread, you'll see I explicitly stated that .cpy's 
are not covered because they choose to do their own silly thing.



  from Products.zdb import set_trace
  set_trace()

and then you can see the script code in the debugger?


For normal python skin scripts, yes :-)


When I try that I end up in the debugger, but I don't see anything
different from the normal pdb.set_trace().  When I press 'l' I just
see [EOF] like always.  Is there a trick I am missing?


Yeah, don't use .cpy's ;-)


It *would* be neat! :)


It would indeed, it'd just require more monkeypatching of the same style 
that zdb does already. Reading zdb's code, particular the bits that 
cover skin .py's should give you a good start.


I'd happilly accept patches to zdb and am keen to roll a new release if 
someone does provide such a patch.



Those security declarations are actually the only thing that
svn://svn.zope.org/repos/main/Products.enablesettrace itself does.


I noticed ;-)

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 )


[Zope] Re: a question about aq_base

2006-11-29 Thread Max M

Dieter Maurer skrev:

Yuri wrote at 2006-11-28 14:23 +0100:

here: http://docs.neuroinf.de/programming-plone/ate we can read:

   obj = brain.getObject().aq_base

why .aq_base and not only brain.getObject()? :)


Usually, it is a bad idea to use aq_base in Zope applications

You should carefully examine the context of the code fragment above.
Maybe, the context is one of the rare situations where aq_base
is called for...


Why is it rare?

I often need to check if an object has a certain attribute. Getting 
aquisition into the mix is a bad idea there.::


name = getattr(obj, 'name')

Is a lot different than

name = getattr(obj.aq_base, 'name')

In the first example you don't know if the name attribute is an aquired 
object or an attribute on the actual object. Which can make for 
uncontrollable results.


--

hilsen/regards Max M, Denmark

http://www.mxm.dk/
IT's Mad Science

___
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/Plone Form Question

2006-11-29 Thread Christopher A. Nethery
Hello all,

 

I have created:

 

-  a Controller Page Template

-  a Controller Validator script and,

-  a Controller Python script

 

I am trying to create a form whose values are used by a script to:

 

- query a separate reporting system

- generate a .pdf document with the resulting report and,

- post the contents of the .pdf to a results page

 


 

I cannot seem to figure out how to generate the results page.  Could
anyone shed some light on this?

 

You will note some poor python code practices (especially in the
validator script) which I apologize for (too hurried), so please be
forgiving...

 

 

Thanking you in advance,

 

Chris Nethery

 

My code is below.  So far, I have the following:

 

--

PMA (Controller Page Template)

--

 

html

  head

 

title tal:content=template/titleThe title/title

 

  /head

 

  body tal:define=errors options/state/getErrors

 

  h2 tal:content=template/title_or_idPortfolio Manager
Assignment/h2

 

form method=POST tal:attributes=action
string:${here/absolute_url}/${template/id};

 

  p class=error_message tal:define=err errors/n|nothing
tal:condition=errb tal:content=err //p

  pEnter query parameters:/pbr

 

table

 

trthPortfolio/th

  tdinput name=portfolio size=10 value=/td

/tr

 

trthGroup Name/th

  tdinput name=group_name size=10 value=/td

/tr

 

trthRun Date (mmddyy)/th

  tdinput name=run_date size=10 value=/td

/tr

 

trthFrom Date (mmddyy)/th

  tdinput name=from_date size=10 value=/td

/tr

 

trthTo Date (mmddyy)/th

  tdinput name=to_date size=10 value=/td

/tr

 

tr

  td colspan=2 align=centerinput type=SUBMIT
name=form.button.submit value=OK/td

  input type=hidden name=form.submitted value=1 /

/tr

 

/table

/form

  /body

/html

 

 

---

PMAValidators (Controller Validator Script)

---

 

portfolio = context.REQUEST.get('portfolio', None)

run_date = context.REQUEST.get('run_date', None)

from_date = context.REQUEST.get('from_date', None)

to_date = context.REQUEST.get('to_date', None)

 

if not portfolio:

  state.setError('portfolio', 'Please enter a portfolio')

 

if state.getErrors():

   state.setStatus('failure')

   return state.set(portal_status_message='Please correct the errors
shown')

 

if not run_date:

  state.setError('run_date', 'Please enter a run date')

 

if state.getErrors():

   state.setStatus('failure')

   return state.set(portal_status_message='Please correct the errors
shown')

 

if not from_date:

  state.setError('from_date', 'Please enter a from date')

 

if state.getErrors():

   state.setStatus('failure')

   return state.set(portal_status_message='Please correct the errors
shown')

 

if not to_date:

  state.setError('to_date', 'Please enter a to date')

 

if state.getErrors():

   state.setStatus('failure')

   return state.set(portal_status_message='Please correct the errors
shown')

 

return state

 

 



PMAScript (Controller Python script)



 

import os

import string

import sys 

 

# Get value(s) from the REQUEST

portfolio = context.REQUEST.get('portfolio')

run_date = context.REQUEST.get('run_date')

from_date = context.REQUEST.get('from_date')

to_date = context.REQUEST.get('to_date')

 

#Create .pdf

 

y = stuff

x = os.system(y)

 

### What now? ### 

### state.setNextAction ? ###

 

return state

 

___
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] Nuked Installations! Problem w/ Rebuild!

2006-11-29 Thread Nancy Donnelly
102Hi;
I just went to copy my main HD on my server to my new 1/2 teraflop HD and it 
wiped out the zopecltsockets and the var directories! Luckly I have backups of 
the Data.fs that are recent. So, I'm rebuilding with Z29, but when I go to 
crank up an instance with runzope, I get this:

Traceback (most recent call last):
  File /usr/local/src/Zope-2.9.6-final/lib/python/Zope2/Startup/run.py, line 
56, in ?
run()
  File /usr/local/src/Zope-2.9.6-final/lib/python/Zope2/Startup/run.py, line 
19, in run
opts = _setconfig()
  File /usr/local/src/Zope-2.9.6-final/lib/python/Zope2/Startup/run.py, line 
48, in _setconfig
opts.realize(doc=Sorry, no option docs yet.)
  File /usr/local/src/Zope-2.9.6-final/lib/python/zdaemon/zdoptions.py, line 
273, in realize
self.load_schema()
  File /usr/local/src/Zope-2.9.6-final/lib/python/zdaemon/zdoptions.py, line 
321, in load_schema
self.schema = ZConfig.loadSchema(self.schemafile)
  File /usr/local/src/Zope-2.9.6-final/lib/python/ZConfig/loader.py, line 31, 
in loadSchema
return SchemaLoader().loadURL(url)
  File /usr/local/src/Zope-2.9.6-final/lib/python/ZConfig/loader.py, line 65, 
in loadURL
return self.loadResource(r)
  File /usr/local/src/Zope-2.9.6-final/lib/python/ZConfig/loader.py, line 
159, in loadResource
schema = ZConfig.schema.parseResource(resource, self)
  File /usr/local/src/Zope-2.9.6-final/lib/python/ZConfig/schema.py, line 27, 
in parseResource
xml.sax.parse(resource.file, parser)
  File /usr/local/lib/python2.4/xml/sax/__init__.py, line 33, in parse
parser.parse(source)
  File /usr/local/lib/python2.4/xml/sax/expatreader.py, line 107, in parse
xmlreader.IncrementalParser.parse(self, source)
  File /usr/local/lib/python2.4/xml/sax/xmlreader.py, line 123, in parse
self.feed(buffer)
  File /usr/local/lib/python2.4/xml/sax/expatreader.py, line 207, in feed
self._parser.Parse(data, isFinal)
  File /usr/local/lib/python2.4/xml/sax/expatreader.py, line 300, in 
start_element
self._cont_handler.startElement(name, AttributesImpl(attrs))
  File /usr/local/src/Zope-2.9.6-final/lib/python/ZConfig/schema.py, line 99, 
in startElement
getattr(self, start_ + name)(attrs)
  File /usr/local/src/Zope-2.9.6-final/lib/python/ZConfig/schema.py, line 
475, in start_schema
keytype, valuetype, datatype = self.get_sect_typeinfo(attrs)
  File /usr/local/src/Zope-2.9.6-final/lib/python/ZConfig/schema.py, line 
201, in get_sect_typeinfo
datatype = self.get_datatype(attrs, datatype, null, base)
  File /usr/local/src/Zope-2.9.6-final/lib/python/ZConfig/schema.py, line 
194, in get_datatype
return self._registry.get(dtname)
  File /usr/local/src/Zope-2.9.6-final/lib/python/ZConfig/datatypes.py, line 
398, in get
t = self.search(name)
  File /usr/local/src/Zope-2.9.6-final/lib/python/ZConfig/datatypes.py, line 
423, in search
package = __import__(n, g, g, component)
  File /usr/local/src/Zope-2.9.6-final/lib/python/Zope2/Startup/datatypes.py, 
line 20, in ?
from ZODB.config import ZODBDatabase
  File /usr/local/src/Zope-2.9.6-final/lib/python/ZODB/__init__.py, line 20, 
in ?
from persistent import TimeStamp
  File /usr/local/src/Zope-2.9.6-final/lib/python/persistent/__init__.py, 
line 19, in ?
from cPersistence import Persistent, GHOST, UPTODATE, CHANGED, STICKY
ImportError: No module named cPersistence

What do I do? Please help...under pressure.
Nancy



___
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] Permission Denied...New Build

2006-11-29 Thread Nancy Donnelly
79797975Hi;
After nuking my Zope instances by trying to copy my main HD over to my new one, 
I'm rebuilding with backups. But I'm having a problem. I built Z29 from source. 
I created an instance, specified the path, nancy as the user and a p/w. When 
I go to runzope, as root or as nancy, I get this error:

[EMAIL PROTECTED]:local/zope/2012 (108) ./bin/runzope
Traceback (most recent call last):
  File /usr/local/src/Zope-2.9.6-final/lib/python/Zope2/Startup/run.py, line 
56, in ?
run()
  File /usr/local/src/Zope-2.9.6-final/lib/python/Zope2/Startup/run.py, line 
21, in run
starter.prepare()
  File /usr/local/src/Zope-2.9.6-final/lib/python/Zope2/Startup/__init__.py, 
line 98, in prepare
self.startZope()
  File /usr/local/src/Zope-2.9.6-final/lib/python/Zope2/Startup/__init__.py, 
line 257, in startZope
Zope2.startup()
  File /usr/local/src/Zope-2.9.6-final/lib/python/Zope2/__init__.py, line 47, 
in startup
_startup()
  File /usr/local/src/Zope-2.9.6-final/lib/python/Zope2/App/startup.py, line 
60, in startup
DB = dbtab.getDatabase('/', is_root=1)
  File /usr/local/src/Zope-2.9.6-final/lib/python/Zope2/Startup/datatypes.py, 
line 280, in getDatabase
db = factory.open(name, self.databases)
  File /usr/local/src/Zope-2.9.6-final/lib/python/Zope2/Startup/datatypes.py, 
line 178, in open
DB = self.createDB(database_name, databases)
  File /usr/local/src/Zope-2.9.6-final/lib/python/Zope2/Startup/datatypes.py, 
line 175, in createDB
return ZODBDatabase.open(self, databases)
  File /usr/local/src/Zope-2.9.6-final/lib/python/ZODB/config.py, line 97, in 
open
storage = section.storage.open()
  File /usr/local/src/Zope-2.9.6-final/lib/python/ZODB/config.py, line 135, 
in open
quota=self.config.quota)
  File 
/usr/local/src/Zope-2.9.6-final/lib/python/ZODB/FileStorage/FileStorage.py, 
line 112, in __init__
self._lock_file = LockFile(file_name + '.lock')
  File /usr/local/src/Zope-2.9.6-final/lib/python/ZODB/lock_file.py, line 60, 
in __init__
self._fp = open(path, 'w+')
IOError: [Errno 13] Permission denied: '/usr/local/zope/2012/var/Data.fs.lock'

What do?
TIA,
Nancy




 

Do you Yahoo!?
Everyone is raving about the all-new Yahoo! Mail beta.
http://new.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 )


[Zope] invalid id items

2006-11-29 Thread Jens-Erik Hansen
Hi! 

I would like to use boa constructor for zope (zope 2.9.4-final) debugging. In 
boa you can define a zope connection to inteact with the zope server. 
Starting a boa zope connection boa creates a zoa folder in the zope root 
containing a couple of objects. Apparently boa also tries to create an object 
with the id items but this fails. Zope tells me that The id items is 
invalid - it is already in use..

I tried to find the already existing object with id items but without 
success.

Please can anyone give me a hint where I can find this object or how I can 
solve this problem?

Thank you very much. 
Jens
___
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] invalid id items

2006-11-29 Thread Andreas Jung
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1



- --On 29. November 2006 18:28:39 +0100 Jens-Erik Hansen [EMAIL PROTECTED] 
wrote:

 Hi!

 I would like to use boa constructor for zope (zope 2.9.4-final)
 debugging. In  boa you can define a zope connection to inteact with the
 zope server.  Starting a boa zope connection boa creates a zoa folder in
 the zope root  containing a couple of objects. Apparently boa also tries
 to create an object  with the id items but this fails. Zope tells me
 that The id items is  invalid - it is already in use..

 I tried to find the already existing object with id items but without
 success.


'items' is likely an attribute of a persistent object.

- -aj
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.5 (Darwin)

iD8DBQFFbcRLCJIWIbr9KYwRAsKyAKDnViakyFt+pAnRKJqDugLWQo/mtQCgw5d+
X79qc9qT3yrDwPhN3jkQj3E=
=wITo
-END PGP SIGNATURE-

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


Re: [Zope] Nuked Installations! Problem w/ Rebuild!

2006-11-29 Thread robert rottermann
you probably have to reinstall (rebuild) zope.
i *assume* that your zope is not using the python it was built with.

robert

Nancy Donnelly schrieb:
 102
 Hi;
 I just went to copy my main HD on my server to my new 1/2 teraflop HD
 and it wiped out the zopecltsockets and the var directories! Luckly I
 have backups of the Data.fs that are recent. So, I'm rebuilding with
 Z29, but when I go to crank up an instance with runzope, I get this:
 
 Traceback (most recent call last):
   File
 /usr/local/src/Zope-2.9.6-final/lib/python/Zope2/Startup/run.py, line
 56, in ?
 run()
   File
 /usr/local/src/Zope-2.9.6-final/lib/python/Zope2/Startup/run.py, line
 19, in run
 opts = _setconfig()
   File
 /usr/local/src/Zope-2.9.6-final/lib/python/Zope2/Startup/run.py, line
 48, in _setconfig
 opts.realize(doc=Sorry, no option docs yet.)
   File
 /usr/local/src/Zope-2.9.6-final/lib/python/zdaemon/zdoptions.py, line
 273, in realize
 self.load_schema()
   File
 /usr/local/src/Zope-2.9.6-final/lib/python/zdaemon/zdoptions.py, line
 321, in load_schema
 self.schema = ZConfig.loadSchema(self.schemafile)
   File /usr/local/src/Zope-2.9.6-final/lib/python/ZConfig/loader.py,
 line 31, in loadSchema
 return SchemaLoader().loadURL(url)
   File /usr/local/src/Zope-2.9.6-final/lib/python/ZConfig/loader.py,
 line 65, in loadURL
 return self.loadResource(r)
   File /usr/local/src/Zope-2.9.6-final/lib/python/ZConfig/loader.py,
 line 159, in loadResource
 schema = ZConfig.schema.parseResource(resource, self)
   File /usr/local/src/Zope-2.9.6-final/lib/python/ZConfig/schema.py,
 line 27, in parseResource
 xml.sax.parse(resource.file, parser)
   File /usr/local/lib/python2.4/xml/sax/__init__.py, line 33, in parse
 parser.parse(source)
   File /usr/local/lib/python2.4/xml/sax/expatreader.py, line 107, in parse
 xmlreader.IncrementalParser.parse(self, source)
   File /usr/local/lib/python2.4/xml/sax/xmlreader.py, line 123, in parse
 self.feed(buffer)
   File /usr/local/lib/python2.4/xml/sax/expatreader.py, line 207, in feed
 self._parser.Parse(data, isFinal)
   File /usr/local/lib/python2.4/xml/sax/expatreader.py, line 300, in
 start_element
 self._cont_handler.startElement(name, AttributesImpl(attrs))
   File /usr/local/src/Zope-2.9.6-final/lib/python/ZConfig/schema.py,
 line 99, in startElement
 getattr(self, start_ + name)(attrs)
   File /usr/local/src/Zope-2.9.6-final/lib/python/ZConfig/schema.py,
 line 475, in start_schema
 keytype, valuetype, datatype = self.get_sect_typeinfo(attrs)
   File /usr/local/src/Zope-2.9.6-final/lib/python/ZConfig/schema.py,
 line 201, in get_sect_typeinfo
 datatype = self.get_datatype(attrs, datatype, null, base)
   File /usr/local/src/Zope-2.9.6-final/lib/python/ZConfig/schema.py,
 line 194, in get_datatype
 return self._registry.get(dtname)
   File
 /usr/local/src/Zope-2.9.6-final/lib/python/ZConfig/datatypes.py, line
 398, in get
 t = self.search(name)
   File
 /usr/local/src/Zope-2.9.6-final/lib/python/ZConfig/datatypes.py, line
 423, in search
 package = __import__(n, g, g, component)
   File
 /usr/local/src/Zope-2.9.6-final/lib/python/Zope2/Startup/datatypes.py,
 line 20, in ?
 from ZODB.config import ZODBDatabase
   File /usr/local/src/Zope-2.9.6-final/lib/python/ZODB/__init__.py,
 line 20, in ?
 from persistent import TimeStamp
   File
 /usr/local/src/Zope-2.9.6-final/lib/python/persistent/__init__.py,
 line 19, in ?
 from cPersistence import Persistent, GHOST, UPTODATE, CHANGED, STICKY
 ImportError: No module named cPersistence
 
 What do I do? Please help...under pressure.
 Nancy
 
 
 
 
 ___
 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 )

begin:vcard
fn:robert  rottermann
n:rottermann;robert 
email;internet:[EMAIL PROTECTED]
tel;work:031 333 10 20
tel;fax:031 333 10 23
tel;home:031 333 36 03
x-mozilla-html:FALSE
version:2.1
end:vcard

___
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] tal loop to render table

2006-11-29 Thread Dennis Schulz
I would like to build a tal loop that renders a list of elements 
(widgets in my case) in a table.
(for example I have a list of 9 items, then it renders a table: five 
rows with 2,2,2,2,1 items)
the table has 2 columns, so i would need to open and close the table row 
every second item.
I tried to check with a condition if the row is odd or even, but 
unopened and unclosed tags are not valid.


Is there any possibiliy to do this with tal?

Dennis



___
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] tal loop to render table

2006-11-29 Thread Andreas Jung
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1



- --On 29. November 2006 19:54:34 +0100 Dennis Schulz [EMAIL PROTECTED] 
wrote:

 I would like to build a tal loop that renders a list of elements (widgets
 in my case) in a table.
 (for example I have a list of 9 items, then it renders a table: five rows
 with 2,2,2,2,1 items)
 the table has 2 columns, so i would need to open and close the table row
 every second item.
 I tried to check with a condition if the row is odd or even, but unopened
 and unclosed tags are not valid.

 Is there any possibiliy to do this with tal?


div tal:replace=structure python: 'sometag' /

But you would better check if you really can't simplify your logic.

- -aj
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.5 (Darwin)

iD8DBQFFbdkgCJIWIbr9KYwRAhisAKCl+TfjUzdlyWMDS5tEQuF+8QoRigCeLJ8q
fW77mKuOFVteXrNNkGsTMEs=
=wOrG
-END PGP SIGNATURE-

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


Re: [Zope] Permission Denied...New Build

2006-11-29 Thread robert rottermann
this lock was maybe created by root.
(when zope started from /etc/init.d)

if so you have to delete it as root.

and of course your efective user defined (in 
/usr/local/zope/2012/etc/zope.conf)
must be set to somebody that has write permission in /usr/local/zope/2012/var

robert

Nancy Donnelly schrieb:
 79797975
 Hi;
 After nuking my Zope instances by trying to copy my main HD over to my
 new one, I'm rebuilding with backups. But I'm having a problem. I built
 Z29 from source. I created an instance, specified the path, nancy as
 the user and a p/w. When I go to runzope, as root or as nancy, I get
 this error:
 
 [EMAIL PROTECTED]:local/zope/2012 (108) ./bin/runzope
 Traceback (most recent call last):
   File
 /usr/local/src/Zope-2.9.6-final/lib/python/Zope2/Startup/run.py, line
 56, in ?
 run()
   File
 /usr/local/src/Zope-2.9.6-final/lib/python/Zope2/Startup/run.py, line
 21, in run
 starter.prepare()
   File
 /usr/local/src/Zope-2.9.6-final/lib/python/Zope2/Startup/__init__.py,
 line 98, in prepare
 self.startZope()
   File
 /usr/local/src/Zope-2.9.6-final/lib/python/Zope2/Startup/__init__.py,
 line 257, in startZope
 Zope2.startup()
   File /usr/local/src/Zope-2.9.6-final/lib/python/Zope2/__init__.py,
 line 47, in startup
 _startup()
   File
 /usr/local/src/Zope-2.9.6-final/lib/python/Zope2/App/startup.py, line
 60, in startup
 DB = dbtab.getDatabase('/', is_root=1)
   File
 /usr/local/src/Zope-2.9.6-final/lib/python/Zope2/Startup/datatypes.py,
 line 280, in getDatabase
 db = factory.open(name, self.databases)
   File
 /usr/local/src/Zope-2.9.6-final/lib/python/Zope2/Startup/datatypes.py,
 line 178, in open
 DB = self.createDB(database_name, databases)
   File
 /usr/local/src/Zope-2.9.6-final/lib/python/Zope2/Startup/datatypes.py,
 line 175, in createDB
 return ZODBDatabase.open(self, databases)
   File /usr/local/src/Zope-2.9.6-final/lib/python/ZODB/config.py, line
 97, in open
 storage = section.storage.open()
   File /usr/local/src/Zope-2.9.6-final/lib/python/ZODB/config.py, line
 135, in open
 quota=self.config.quota)
   File
 /usr/local/src/Zope-2.9.6-final/lib/python/ZODB/FileStorage/FileStorage.py,
 line 112, in __init__
 self._lock_file = LockFile(file_name + '.lock')
   File /usr/local/src/Zope-2.9.6-final/lib/python/ZODB/lock_file.py,
 line 60, in __init__
 self._fp = open(path, 'w+')
 IOError: [Errno 13] Permission denied:
 '/usr/local/zope/2012/var/Data.fs.lock'
 
 What do?
 TIA,
 Nancy
 
 
 Cheap Talk? Check out
 http://us.rd.yahoo.com/mail_us/taglines/postman8/*http://us.rd.yahoo.com/evt=39663/*http://voice.yahoo.com
 Yahoo! Messenger's low PC-to-Phone call rates.
 
 
 
 
 ___
 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 )

begin:vcard
fn:robert  rottermann
n:rottermann;robert 
email;internet:[EMAIL PROTECTED]
tel;work:031 333 10 20
tel;fax:031 333 10 23
tel;home:031 333 36 03
x-mozilla-html:FALSE
version:2.1
end:vcard

___
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] tal loop to render table

2006-11-29 Thread Alexis Roda

En/na Dennis Schulz ha escrit:
I would like to build a tal loop that renders a list of elements 
(widgets in my case) in a table.
(for example I have a list of 9 items, then it renders a table: five 
rows with 2,2,2,2,1 items)
the table has 2 columns, so i would need to open and close the table row 
every second item.
I tried to check with a condition if the row is odd or even, but 
unopened and unclosed tags are not valid.


Is there any possibiliy to do this with tal?



Tricky and not tested from restricted code ... but you're asking for a 
tal solution:


table tal:define=lpython:the_list + [ None ];
   rows python:zip(l[0::2], l[1::2]);
  
tr tal:repeat=row rows
 td tal:repeat=cell row
 /td
/tr
/table

An example:

 the_list = [1,2,3,4,5,6,7,8,9]
 l = the_list + [ None ]
 zip(l[0::2], l[1::2])
[(1, 2), (3, 4), (5, 6), (7, 8), (9, None)]

 the_list = [1,2,3,4,5,6,7,8,9,10]
 l = the_list + [ None ]
 zip(l[0::2], l[1::2])
[(1, 2), (3, 4), (5, 6), (7, 8), (9, 10)]



Instead of the tricky use of zip and extended slices write a more 
generic python script :


convert_list_to_array(the_list, column_count=2)




HTH
___
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] My Sad Tale Of Woe

2006-11-29 Thread Nancy Donnelly
757575Hi;
Is anybody out there reading this list? Third question today, no responses, and 
boy am I in trouble. I went to backup my server's working HD on my new .5 
teraflop HD and for some reason that wiped out the /var dirs in my Zope 
instances. I have backups of the Data.fs that aren't too old, but for some 
reason I can't get a working copy of Zope installed! I follow the tar, 
configure, make, make install, make instance without throwing anything special 
at the configure, then I edit zope.conf to enter the correct effective-user, 
but when I go to runzope, it throws a cPersistence error. Well, I yahoo'd that 
and found out I had to run python setup.py build_ext -if to knock it out. But 
why should I have to do that at all? That's not standard procedure. Anyway, I 
got past that point, but now when I try runzope I get the error that follows. 
And I've tried every way I can think of to get around it. All the permissions 
are correct. Once I actually got to the point where it said Zope
 was ready to serve, could surf to the 111.222.333.444:8080 page, but try to 
get into the manage page and it won't accept my username/password. I ran 
zpasswd.py and still couldn't get in! Guys, I'm exhausted. I've been at this 
for 10 hours! Any help would really be appreciated.
Nancy

[EMAIL PROTECTED]:local/www/clients (103) ./bin/runzope
Traceback (most recent call last):
  File /usr/local/src/Zope-2.9.6-final/lib/python/Zope2/Startup/run.py, line 
56, in ?
run()
  File /usr/local/src/Zope-2.9.6-final/lib/python/Zope2/Startup/run.py, line 
21, in run
starter.prepare()
  File /usr/local/src/Zope-2.9.6-final/lib/python/Zope2/Startup/__init__.py, 
line 98, in prepare
self.startZope()
  File /usr/local/src/Zope-2.9.6-final/lib/python/Zope2/Startup/__init__.py, 
line 257, in startZope
Zope2.startup()
  File /usr/local/src/Zope-2.9.6-final/lib/python/Zope2/__init__.py, line 47, 
in startup
_startup()
  File /usr/local/src/Zope-2.9.6-final/lib/python/Zope2/App/startup.py, line 
60, in startup
DB = dbtab.getDatabase('/', is_root=1)
  File /usr/local/src/Zope-2.9.6-final/lib/python/Zope2/Startup/datatypes.py, 
line 280, in getDatabase
db = factory.open(name, self.databases)
  File /usr/local/src/Zope-2.9.6-final/lib/python/Zope2/Startup/datatypes.py, 
line 178, in open
DB = self.createDB(database_name, databases)
  File /usr/local/src/Zope-2.9.6-final/lib/python/Zope2/Startup/datatypes.py, 
line 175, in createDB
return ZODBDatabase.open(self, databases)
  File /usr/local/src/Zope-2.9.6-final/lib/python/ZODB/config.py, line 97, in 
open
storage = section.storage.open()
  File /usr/local/src/Zope-2.9.6-final/lib/python/ZODB/config.py, line 135, 
in open
quota=self.config.quota)
  File 
/usr/local/src/Zope-2.9.6-final/lib/python/ZODB/FileStorage/FileStorage.py, 
line 112, in __init__
self._lock_file = LockFile(file_name + '.lock')
  File /usr/local/src/Zope-2.9.6-final/lib/python/ZODB/lock_file.py, line 60, 
in __init__
self._fp = open(path, 'w+')
IOError: [Errno 13] Permission denied: '/usr/local/www/clients/var/Data.fs.lock'





 

Yahoo! Music Unlimited
Access over 1 million songs.
http://music.yahoo.com/unlimited___
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/Plone Form Question

2006-11-29 Thread Andreas Jung
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1



- --On 29. November 2006 09:40:40 -0500 Christopher A. Nethery 
[EMAIL PROTECTED] wrote:

 Hello all,



 I have created:



 -  a Controller Page Template

 -  a Controller Validator script and,

 -  a Controller Python script



 I am trying to create a form whose values are used by a script to:



 - query a separate reporting system

 - generate a .pdf document with the resulting report and,

 - post the contents of the .pdf to a results page


Upon successful validation you redirect to a script (see CMFFormController 
docs) that calls something like that:



pdffile = getPDFData()

R = context.REQUEST.RESPONSE

R.setHeader('content-type', 'appliction/pdf')  # check that
R.setHeader('content-length', str(len(pdffile))
R.write(pdffile)

Depending on your app you can also use a file_stream_iterator() instead of 
the last write() call. Google for details.

- -aj
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.5 (Darwin)

iD8DBQFFbefwCJIWIbr9KYwRAslzAJ9mcUb09x7aKibuZkMpMZfwEUXweACg3DBt
WCc4kyXEY3+e4M+ntD/YxA0=
=iSox
-END PGP SIGNATURE-

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


Re: [Zope] My Sad Tale Of Woe

2006-11-29 Thread Jake
Did you build the exact same type of Zope (version, python, etc) with all
the products?

Have you run the utilities on your ZODB to make sure it is ok?

Jake
___
http://www.ZopeZone.com


On Wed, November 29, 2006 2:59 pm, Nancy Donnelly said:
 757575Hi;
 Is anybody out there reading this list? Third question today, no
 responses, and boy am I in trouble. I went to backup my server's working
 HD on my new .5 teraflop HD and for some reason that wiped out the /var
 dirs in my Zope instances. I have backups of the Data.fs that aren't too
 old, but for some reason I can't get a working copy of Zope installed! I
 follow the tar, configure, make, make install, make instance without
 throwing anything special at the configure, then I edit zope.conf to enter
 the correct effective-user, but when I go to runzope, it throws a
 cPersistence error. Well, I yahoo'd that and found out I had to run
 python setup.py build_ext -if to knock it out. But why should I have to
 do that at all? That's not standard procedure. Anyway, I got past that
 point, but now when I try runzope I get the error that follows. And I've
 tried every way I can think of to get around it. All the permissions are
 correct. Once I actually got to the point where it said Zope
  was ready to serve, could surf to the 111.222.333.444:8080 page, but try
 to get into the manage page and it won't accept my username/password. I
 ran zpasswd.py and still couldn't get in! Guys, I'm exhausted. I've been
 at this for 10 hours! Any help would really be appreciated.
 Nancy

 [EMAIL PROTECTED]:local/www/clients (103) ./bin/runzope
 Traceback (most recent call last):
   File /usr/local/src/Zope-2.9.6-final/lib/python/Zope2/Startup/run.py,
 line 56, in ?
 run()
   File /usr/local/src/Zope-2.9.6-final/lib/python/Zope2/Startup/run.py,
 line 21, in run
 starter.prepare()
   File
 /usr/local/src/Zope-2.9.6-final/lib/python/Zope2/Startup/__init__.py,
 line 98, in prepare
 self.startZope()
   File
 /usr/local/src/Zope-2.9.6-final/lib/python/Zope2/Startup/__init__.py,
 line 257, in startZope
 Zope2.startup()
   File /usr/local/src/Zope-2.9.6-final/lib/python/Zope2/__init__.py,
 line 47, in startup
 _startup()
   File /usr/local/src/Zope-2.9.6-final/lib/python/Zope2/App/startup.py,
 line 60, in startup
 DB = dbtab.getDatabase('/', is_root=1)
   File
 /usr/local/src/Zope-2.9.6-final/lib/python/Zope2/Startup/datatypes.py,
 line 280, in getDatabase
 db = factory.open(name, self.databases)
   File
 /usr/local/src/Zope-2.9.6-final/lib/python/Zope2/Startup/datatypes.py,
 line 178, in open
 DB = self.createDB(database_name, databases)
   File
 /usr/local/src/Zope-2.9.6-final/lib/python/Zope2/Startup/datatypes.py,
 line 175, in createDB
 return ZODBDatabase.open(self, databases)
   File /usr/local/src/Zope-2.9.6-final/lib/python/ZODB/config.py, line
 97, in open
 storage = section.storage.open()
   File /usr/local/src/Zope-2.9.6-final/lib/python/ZODB/config.py, line
 135, in open
 quota=self.config.quota)
   File
 /usr/local/src/Zope-2.9.6-final/lib/python/ZODB/FileStorage/FileStorage.py,
 line 112, in __init__
 self._lock_file = LockFile(file_name + '.lock')
   File /usr/local/src/Zope-2.9.6-final/lib/python/ZODB/lock_file.py,
 line 60, in __init__
 self._fp = open(path, 'w+')
 IOError: [Errno 13] Permission denied:
 '/usr/local/www/clients/var/Data.fs.lock'






 
 Yahoo! Music Unlimited
 Access over 1 million songs.
 http://music.yahoo.com/unlimited___
 Zope maillist  -  Zope@zope.org
 http://mail.zope.org/mailman/listinfo/zope
 **   No cross posts or HTML encoding!  **
 (Related lists -
  http://mail.zope.org/mailman/listinfo/zope-announce
  http://mail.zope.org/mailman/listinfo/zope-dev )



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


Re: [Zope] My Sad Tale Of Woe

2006-11-29 Thread Chris McDonough

Put a file named access in your Zope instance home with the content:

emergency:123

You should be able to log in as the emergency user at that point  
and change the admin user's password.


- C


On Nov 29, 2006, at 2:59 PM, Nancy Donnelly wrote:


757575
Hi;
Is anybody out there reading this list? Third question today, no  
responses, and boy am I in trouble. I went to backup my server's  
working HD on my new .5 teraflop HD and for some reason that wiped  
out the /var dirs in my Zope instances. I have backups of the  
Data.fs that aren't too old, but for some reason I can't get a  
working copy of Zope installed! I follow the tar, configure, make,  
make install, make instance without throwing anything special at  
the configure, then I edit zope.conf to enter the correct effective- 
user, but when I go to runzope, it throws a cPersistence error.  
Well, I yahoo'd that and found out I had to run python setup.py  
build_ext -if to knock it out. But why should I have to do that at  
all? That's not standard procedure. Anyway, I got past that point,  
but now when I try runzope I get the error that follows. And I've  
tried every way I can think of to get around it. All the  
permissions are correct. Once I actually got to the point where it  
said Zope was ready to serve, could surf to the  
111.222.333.444:8080 page, but try to get into the manage page  
and it won't accept my username/password. I ran zpasswd.py and  
still couldn't get in! Guys, I'm exhausted. I've been at this for  
10 hours! Any help would really be appreciated.

Nancy

[EMAIL PROTECTED]:local/www/clients (103) ./bin/runzope
Traceback (most recent call last):
  File /usr/local/src/Zope-2.9.6-final/lib/python/Zope2/Startup/ 
run.py, line 56, in ?

run()
  File /usr/local/src/Zope-2.9.6-final/lib/python/Zope2/Startup/ 
run.py, line 21, in run

starter.prepare()
  File /usr/local/src/Zope-2.9.6-final/lib/python/Zope2/Startup/ 
__init__.py, line 98, in prepare

self.startZope()
  File /usr/local/src/Zope-2.9.6-final/lib/python/Zope2/Startup/ 
__init__.py, line 257, in startZope

Zope2.startup()
  File /usr/local/src/Zope-2.9.6-final/lib/python/Zope2/ 
__init__.py, line 47, in startup

_startup()
  File /usr/local/src/Zope-2.9.6-final/lib/python/Zope2/App/ 
startup.py, line 60, in startup

DB = dbtab.getDatabase('/', is_root=1)
  File /usr/local/src/Zope-2.9.6-final/lib/python/Zope2/Startup/ 
datatypes.py, line 280, in getDatabase

db = factory.open(name, self.databases)
  File /usr/local/src/Zope-2.9.6-final/lib/python/Zope2/Startup/ 
datatypes.py, line 178, in open

DB = self.createDB(database_name, databases)
  File /usr/local/src/Zope-2.9.6-final/lib/python/Zope2/Startup/ 
datatypes.py, line 175, in createDB

return ZODBDatabase.open(self, databases)
  File /usr/local/src/Zope-2.9.6-final/lib/python/ZODB/config.py,  
line 97, in open

storage = section.storage.open()
  File /usr/local/src/Zope-2.9.6-final/lib/python/ZODB/config.py,  
line 135, in open

quota=self.config.quota)
  File /usr/local/src/Zope-2.9.6-final/lib/python/ZODB/FileStorage/ 
FileStorage.py, line 112, in __init__

self._lock_file = LockFile(file_name + '.lock')
  File /usr/local/src/Zope-2.9.6-final/lib/python/ZODB/ 
lock_file.py, line 60, in __init__

self._fp = open(path, 'w+')
IOError: [Errno 13] Permission denied: '/usr/local/www/clients/var/ 
Data.fs.lock'



Cheap Talk? Check out Yahoo! Messenger's low PC-to-Phone call rates.
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


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

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


Re: [Zope] My Sad Tale Of Woe

2006-11-29 Thread Jonathan
The permission on the Data.fs file does not allow it to be accessed by zope.  
You need to chown/chgrp Data.fs so that zope can access it (or chmod it).

hth

Jonathan


  - Original Message - 
  From: Nancy Donnelly 
  To: zope@zope.org 
  Sent: Wednesday, November 29, 2006 2:59 PM
  Subject: [Zope] My Sad Tale Of Woe


  757575Hi;
  Is anybody out there reading this list? Third question today, no responses, 
and boy am I in trouble. I went to backup my server's working HD on my new .5 
teraflop HD and for some reason that wiped out the /var dirs in my Zope 
instances. I have backups of the Data.fs that aren't too old, but for some 
reason I can't get a working copy of Zope installed! I follow the tar, 
configure, make, make install, make instance without throwing anything special 
at the configure, then I edit zope.conf to enter the correct effective-user, 
but when I go to runzope, it throws a cPersistence error. Well, I yahoo'd that 
and found out I had to run python setup.py build_ext -if to knock it out. But 
why should I have to do that at all? That's not standard procedure. Anyway, I 
got past that point, but now when I try runzope I get the error that follows. 
And I've tried every way I can think of to get around it. All the permissions 
are correct. Once I actually got to the point where it said Zope was ready to 
serve, could surf to the 111.222.333.444:8080 page, but try to get into the 
manage page and it won't accept my username/password. I ran zpasswd.py and 
still couldn't get in! Guys, I'm exhausted. I've been at this for 10 hours! Any 
help would really be appreciated.
  Nancy

  [EMAIL PROTECTED]:local/www/clients (103) ./bin/runzope
  Traceback (most recent call last):
File /usr/local/src/Zope-2.9.6-final/lib/python/Zope2/Startup/run.py, 
line 56, in ?
  run()
File /usr/local/src/Zope-2.9.6-final/lib/python/Zope2/Startup/run.py, 
line 21, in run
  starter.prepare()
File 
/usr/local/src/Zope-2.9.6-final/lib/python/Zope2/Startup/__init__.py, line 
98, in prepare
  self.startZope()
File 
/usr/local/src/Zope-2.9.6-final/lib/python/Zope2/Startup/__init__.py, line 
257, in startZope
  Zope2.startup()
File /usr/local/src/Zope-2.9.6-final/lib/python/Zope2/__init__.py, line 
47, in startup
  _startup()
File /usr/local/src/Zope-2.9.6-final/lib/python/Zope2/App/startup.py, 
line 60, in startup
  DB = dbtab.getDatabase('/', is_root=1)
File 
/usr/local/src/Zope-2.9.6-final/lib/python/Zope2/Startup/datatypes.py, line 
280, in getDatabase
  db = factory.open(name, self.databases)
File 
/usr/local/src/Zope-2.9.6-final/lib/python/Zope2/Startup/datatypes.py, line 
178, in open
  DB = self.createDB(database_name, databases)
File 
/usr/local/src/Zope-2.9.6-final/lib/python/Zope2/Startup/datatypes.py, line 
175, in createDB
  return ZODBDatabase.open(self, databases)
File /usr/local/src/Zope-2.9.6-final/lib/python/ZODB/config.py, line 97, 
in open
  storage = section.storage.open()
File /usr/local/src/Zope-2.9.6-final/lib/python/ZODB/config.py, line 135, 
in open
  quota=self.config.quota)
File 
/usr/local/src/Zope-2.9.6-final/lib/python/ZODB/FileStorage/FileStorage.py, 
line 112, in __init__
  self._lock_file = LockFile(file_name + '.lock')
File /usr/local/src/Zope-2.9.6-final/lib/python/ZODB/lock_file.py, line 
60, in __init__
  self._fp = open(path, 'w+')
  IOError: [Errno 13] Permission denied: 
'/usr/local/www/clients/var/Data.fs.lock'




--
  Cheap Talk? Check out Yahoo! Messenger's low PC-to-Phone call rates.


--


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


Re: [Zope] My Sad Tale Of Woe

2006-11-29 Thread Andreas Jung
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1



- --On 29. November 2006 14:59:19 -0500 Nancy Donnelly 
[EMAIL PROTECTED] wrote:

 757575Hi;
 Is anybody out there reading this list? Third question today, no
 responses, and boy am I in trouble.

There is no reason to create three new threads for this issue.

- -aj
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.5 (Darwin)

iD8DBQFFbeiwCJIWIbr9KYwRAjS/AJ4gfT2FQa9qJ3TZXlz9GWNVIawxWQCgpPgs
8HTJ2ZzmMdDZbZZH0s+Uodw=
=iw9F
-END PGP SIGNATURE-

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


Re: [Zope] tal loop to render table

2006-11-29 Thread Tino Wildenhain

Dennis Schulz schrieb:
I would like to build a tal loop that renders a list of elements 
(widgets in my case) in a table.
(for example I have a list of 9 items, then it renders a table: five 
rows with 2,2,2,2,1 items)
the table has 2 columns, so i would need to open and close the table row 
every second item.
I tried to check with a condition if the row is odd or even, but 
unopened and unclosed tags are not valid.


Is there any possibiliy to do this with tal?


Well, you just dont want to do this in TAL, really ;)
You have to choices: either not using a table but
a couple of carefully CSS-crafted div tags
(See alistapart.com or so for hints on tableless floating
designs)

Or you go the easy path and have a data preparing script
(Script (Python) - Object) which does something along the lines
of:

data=your_nine_items

rowlength=2

return [data[i:i+rowlength] for i in range(0,len(data),rowlength)]


I think you get the idea :-)

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 )


Re: [Zope] My Sad Tale Of Woe

2006-11-29 Thread Maciej Wisniowski

 I have backups of the Data.fs that aren't too old, but for some reason I 
 can't get a working copy of Zope installed! 
What Zope version you used before?
As I see now you're installing 2.9.6.

 I follow the tar, configure, make, make install, make instance
 without throwing anything special at the configure,
I prefer:
as root: configure --prefix=/opt/Zope/2.9.6, make, make install
as zope: /opt/Zope/2.9.6/mkzopeinstance (there you'll create new user
and new instance)
as zope: ./zopectl start (from instance/bin)

If this works and you're able to login to ZMI, try to copy your
old data.fs to instance/var.

To add new user, stop your Zope instance and go to instance/bin/zopectl
write:
 useradd user passwd  (or adduser, I don't remember)

-- 
Maciej Wisniowski
___
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 newbie.... unicode problem

2006-11-29 Thread Tyler Nally
Greetings all,

I'm 100% new to Zope. A complete Zope newbie.  I've done web
Work for more than a dozen years... just never with Zope.

When serving a web page, we get an error that involves the 
fetching and display of a document to the browser. Evidently, 
it's choking on some unicode bytes when it's expecting plain 
ascii.  

I'm assuming it's
/usr/lib/zope2.7/lib/python/Products/PageTemplates/PageTemplate.py
that's causing the problem as the data isn't somehow massaged correctly
before processing arrives at /usr/lib/python2.3/StringIO.py line 203.

I don't know if the bad byte is in a zope template, document, or
a database record that it's fetching.  I do believe this installation
of Zope uses Plone... but I've no idea whether Plone is somewhere
used in the error stream of all the different calls.

Do I need to post more information?  Tell me .. and I'll get it.

If this comes down to a patch, I've no idea how-to apply a patch 
once I get my grubby mits upon the patch. So, I'll need a bit of 
help with that as well.

If I've posted this in the wrong place.. please forgive me and point 
me to the right place that I might ask the proper folk to help me.

Thanks a lot .. and thanks in advance

Tyler

TRACEBACK===

2006-11-29T11:03:37 ERROR(200) SiteError
http://www.teamhancock.com/help/bb-install
Traceback (most recent call last):
  File /usr/lib/zope2.7/lib/python/ZPublisher/Publish.py, line 101, in
publish
request, bind=1)
  File /usr/lib/zope2.7/lib/python/ZPublisher/mapply.py, line 88, in
mapply
if debug is not None: return debug(object,args,context)
  File /usr/lib/zope2.7/lib/python/ZPublisher/Publish.py, line 39, in
call_object
result=apply(object,args) # Type scr to step into published
object.
  File
/var/lib/zope2.7/instance/zeo/Products/CMFDefault/SkinnedFolder.py,
line 80, in __call__
return view()
  File /usr/lib/zope2.7/lib/python/Shared/DC/Scripts/Bindings.py, line
306, in __call__
return self._bindAndExec(args, kw, None)
  File /usr/lib/zope2.7/lib/python/Shared/DC/Scripts/Bindings.py, line
343, in _bindAndExec
return self._exec(bound_data, args, kw)
  File
/var/lib/zope2.7/instance/zeo/Products/CMFCore/FSPageTemplate.py, line
191, in _exec
result = self.pt_render(extra_context=bound_names)
  File
/var/lib/zope2.7/instance/zeo/Products/CMFCore/FSPageTemplate.py, line
124, in pt_render
result = FSPageTemplate.inheritedAttribute('pt_render')(
  File
/usr/lib/zope2.7/lib/python/Products/PageTemplates/PageTemplate.py,
line 97, in pt_render
return output.getvalue()
  File /usr/lib/python2.3/StringIO.py, line 203, in getvalue
self.buf += ''.join(self.buflist)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position
501: ordinal not in range(128)

--
Tyler Nally
[EMAIL PROTECTED]


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


Re: [Zope] tal loop to render table

2006-11-29 Thread Tino Wildenhain

Tino Wildenhain schrieb:

Dennis Schulz schrieb:
I would like to build a tal loop that renders a list of elements 
(widgets in my case) in a table.
(for example I have a list of 9 items, then it renders a table: five 
rows with 2,2,2,2,1 items)
the table has 2 columns, so i would need to open and close the table 
row every second item.
I tried to check with a condition if the row is odd or even, but 
unopened and unclosed tags are not valid.


Is there any possibiliy to do this with tal?


Well, you just dont want to do this in TAL, really ;)
You have to choices: either not using a table but

two


a couple of carefully CSS-crafted div tags
(See alistapart.com or so for hints on tableless floating
designs)

Or you go the easy path and have a data preparing script
(Script (Python) - Object) which does something along the lines
of:

data=your_nine_items

rowlength=2

return [data[i:i+rowlength] for i in range(0,len(data),rowlength)]


I think you get the idea :-)


ah yes, and I forgot the TAL:

table ..
 thead ...  /
 tbody
   tr tal:repeat=row here/thescript or options/prepareddata
 td tal:repeat=col row tal:content=col123/td
   /tr
 /tbody
/table


I guess you know what values you really want to put in :-)

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 )


Re: [Zope] Re: a question about aq_base

2006-11-29 Thread Dieter Maurer
Max M wrote at 2006-11-29 12:53 +0100:
Dieter Maurer skrev:
 Yuri wrote at 2006-11-28 14:23 +0100:
 here: http://docs.neuroinf.de/programming-plone/ate we can read:

obj = brain.getObject().aq_base

 why .aq_base and not only brain.getObject()? :)
 
 Usually, it is a bad idea to use aq_base in Zope applications
 
 You should carefully examine the context of the code fragment above.
 Maybe, the context is one of the rare situations where aq_base
 is called for...

Why is it rare?

I often need to check if an object has a certain attribute. Getting 
aquisition into the mix is a bad idea there.::

 name = getattr(obj, 'name')

Is a lot different than

 name = getattr(obj.aq_base, 'name')

In the first example you don't know if the name attribute is an aquired 
object or an attribute on the actual object. Which can make for 
uncontrollable results.

You may use it often -- but you may then work suboptimally :-)

  You are right that getattr(obj, 'name') and getattr(obj.aq_base, 'name')
  are quite different -- in that the first acquires name if obj does
  not have such an attribute. On the other hand getattr(obj.aq_base, 'name')
  is adequate only for simple result object types -- those that do not
  support acquisition. If the result supports acquisition,
  then the result is only partially acquisition wrapped.
  Partially acquisition wrapped objects tend to produce interesting
  surprises: they get e.g. 'getPhysicalPath' and 'absolute_url'
  wrong and cannot access 'REQUEST'.

  For your use case above, I have therefore proposed
  an hasattr_unacquired standard function ages ago (the Zope
  tracker will show you when exactly). Here, the name explicitly
  spells out what the function is used for -- such that
  even a newbie can understand what is happening (which might
  not be the case with an obj.aq_base use).

  Such an hasattr_unacquired drastically reduces the need
  to use aq_base (or the even more horrible aq_inner.aq_explicit
  variant for untrusted code).



-- 
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] Permission Denied...New Build

2006-11-29 Thread Dieter Maurer
Nancy Donnelly wrote at 2006-11-29 08:17 -0800:
 ...
  File /usr/local/src/Zope-2.9.6-final/lib/python/ZODB/lock_file.py, line 
 60, in __init__
self._fp = open(path, 'w+')
IOError: [Errno 13] Permission denied: '/usr/local/zope/2012/var/Data.fs.lock'

Most Python/Zope error message are quite good.
So good, that it is worth to read them carefully ;-)

The error message above, for example, clearly tells you
that your operating system (IOError) denied access (Permission denied)
to the file /usr/local/zope/2012/var/Data.fs.lock.

What do?

After careful reading of the error message, you use
means of your operating system to determine what
permissions are granted for /usr/local/zope/2012/var/Data.fs.lock
or (if that does not exist) for /usr/local/zope/2012/var.



-- 
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] Permission Denied...New Build

2006-11-29 Thread Jonathan


- Original Message - 
From: Dieter Maurer [EMAIL PROTECTED]

To: Nancy Donnelly [EMAIL PROTECTED]
Cc: zope@zope.org
Sent: Wednesday, November 29, 2006 4:57 PM
Subject: Re: [Zope] Permission Denied...New Build



Nancy Donnelly wrote at 2006-11-29 08:17 -0800:

...
 File /usr/local/src/Zope-2.9.6-final/lib/python/ZODB/lock_file.py, 
line 60, in __init__

   self._fp = open(path, 'w+')
IOError: [Errno 13] Permission denied: 
'/usr/local/zope/2012/var/Data.fs.lock'


Most Python/Zope error message are quite good.
So good, that it is worth to read them carefully ;-)

The error message above, for example, clearly tells you
that your operating system (IOError) denied access (Permission denied)
to the file /usr/local/zope/2012/var/Data.fs.lock.


What do?


After careful reading of the error message, you use
means of your operating system to determine what
permissions are granted for /usr/local/zope/2012/var/Data.fs.lock
or (if that does not exist) for /usr/local/zope/2012/var.

Dieter


I'm glad you caught that Dieter!  I read Nancy's post too quickly and 
responded by telling her to check Data.fs permissions (my bad).  Sorry about 
that Nancy!


Jonathan






___
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] My Sad Tale Of Woe

2006-11-29 Thread Nancy Donnelly
108

- Original Message 
From: Maciej Wisniowski [EMAIL PROTECTED]
To: Nancy Donnelly [EMAIL PROTECTED]
Cc: zope@zope.org
Sent: Wednesday, November 29, 2006 4:38:23 PM
Subject: Re: [Zope] My Sad Tale Of Woe

 I prefer:
 as root: configure --prefix=/opt/Zope/2.9.6, make, make install
 as zope: /opt/Zope/2.9.6/mkzopeinstance (there you'll create new user
 and new instance)
 as zope: ./zopectl start (from instance/bin)



That didn't work, but it got me thinking, and I found the problem to get one of 
my instances up. Now I'm working on the other. Still can't figure out why I 
can't build new instances, though.
Thanks,
Nancy




 

Want to start your own business?
Learn how on Yahoo! Small Business.
http://smallbusiness.yahoo.com/r-index___
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 to get the type of an object by dtml

2006-11-29 Thread Allen Huang
I want to do different operation to different object groups that I created my 
adding new products. But before I could do that I need to determine what the 
object I'm working with. 

Could anyone help me.. how do I use DTML to return the type of the object I'm 
currently working with?




 

Do you Yahoo!?
Everyone is raving about the all-new Yahoo! Mail beta.
http://new.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] How to get the type of an object by dtml

2006-11-29 Thread Andreas Jung
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1



- --On 29. November 2006 23:25:35 -0800 Allen Huang [EMAIL PROTECTED] wrote:

 I want to do different operation to different object groups that I
 created my adding new products. But before I could do that I need to
 determine what the object I'm working with.

 Could anyone help me.. how do I use DTML to return the type of the object
 I'm currently working with?


obj.meta_type is usually the thing you're interested in.

- -aj
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.5 (Darwin)

iD8DBQFFboe5CJIWIbr9KYwRApHYAJ0XGIaBuV9wzolUQis+16OOX8tLsgCdFlIY
r1gJyeOsROwiVTuDcVVvw+k=
=qT6N
-END PGP SIGNATURE-

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


[Zope-dev] Zope Tests: 8 OK, 1 Failed

2006-11-29 Thread Zope Tests Summarizer
Summary of messages to the zope-tests list.
Period Tue Nov 28 12:00:00 2006 UTC to Wed Nov 29 12:00:00 2006 UTC.
There were 9 messages: 9 from Zope Unit Tests.


Test failures
-

Subject: FAILED (failures=2) : Zope-2.8 Python-2.4.4 : Linux
From: Zope Unit Tests
Date: Tue Nov 28 21:36:42 EST 2006
URL: http://mail.zope.org/pipermail/zope-tests/2006-November/006697.html


Tests passed OK
---

Subject: OK : Zope-2.6 Python-2.1.3 : Linux
From: Zope Unit Tests
Date: Tue Nov 28 21:29:11 EST 2006
URL: http://mail.zope.org/pipermail/zope-tests/2006-November/006692.html

Subject: OK : Zope-2.6 Python-2.3.6 : Linux
From: Zope Unit Tests
Date: Tue Nov 28 21:30:41 EST 2006
URL: http://mail.zope.org/pipermail/zope-tests/2006-November/006693.html

Subject: OK : Zope-2.7 Python-2.3.6 : Linux
From: Zope Unit Tests
Date: Tue Nov 28 21:32:11 EST 2006
URL: http://mail.zope.org/pipermail/zope-tests/2006-November/006694.html

Subject: OK : Zope-2.7 Python-2.4.4 : Linux
From: Zope Unit Tests
Date: Tue Nov 28 21:33:41 EST 2006
URL: http://mail.zope.org/pipermail/zope-tests/2006-November/006695.html

Subject: OK : Zope-2.8 Python-2.3.6 : Linux
From: Zope Unit Tests
Date: Tue Nov 28 21:35:11 EST 2006
URL: http://mail.zope.org/pipermail/zope-tests/2006-November/006696.html

Subject: OK : Zope-2.9 Python-2.4.4 : Linux
From: Zope Unit Tests
Date: Tue Nov 28 21:38:12 EST 2006
URL: http://mail.zope.org/pipermail/zope-tests/2006-November/006698.html

Subject: OK : Zope-2.10 Python-2.4.4 : Linux
From: Zope Unit Tests
Date: Tue Nov 28 21:39:42 EST 2006
URL: http://mail.zope.org/pipermail/zope-tests/2006-November/006699.html

Subject: OK : Zope-trunk Python-2.4.4 : Linux
From: Zope Unit Tests
Date: Tue Nov 28 21:41:12 EST 2006
URL: http://mail.zope.org/pipermail/zope-tests/2006-November/006700.html

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