[Zope] How to get the download window option for file widget field?

2005-07-19 Thread praveen kumar nagle
Dear All,

I have created one ARCHETYPE having few fields for
FileWidget, to
upload the file.

Problem::In the base view page i want to get the
download window
option(same like when u try to download a file) while
clicking on link
to download those file contents

*Code which I have given in archetype for
FILE**
FileField('reserveform',
  searchable=1,
  required=0,
  schemata='DetailedInfo3',
  widget=FileWidget(label='Reservation
Form'))

FileField('enquiry',
  searchable=1,
  required=0,
  schemata='DetailedInfo5',
  widget=FileWidget(label='Enquiry Form'))






Start your day with Yahoo! - make it your home page 
http://www.yahoo.com/r/hs 
 
___
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] Cool monkey patch to make tracebacks more useful :-)

2005-07-19 Thread Chris Withers

Dieter Maurer wrote:


Do you get a traceback by "pdb"?


I meant when I type "w" in a pdb session.


   I only get information of the form
   "*** TypeError: "

This is even more stupid than Microsoft error messages.

Today, I have been so annoyed by this that I decided to
improve "pdb" in this respect and donate the patch
as a feature for the Python core...


Indeed, if you could post any patches you make here, I'd be happy to 
include them in my little patch product.


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] Zope Foundation Update

2005-07-19 Thread Andreas Jung



--On 19. Juli 2005 19:07:25 -0400 Rob Page <[EMAIL PROTECTED]> wrote:


During my stay at EuroPython I learned that eighteen
months ago (and without Zope Corporation's knowledge or
consent) Zope Europe Association (ZEA) registered a
trademark consisting of the Cirlce-Z (the stylized Z
surrounded by a circle) followed by the word ZOPE
(hereinafter "Circle-Z-Zope").  The mark they
registered is identical to the corporate logo used by
Zope Corporation.

In the three weeks since learning of ZEA's illegitimate
registration of our marks we have tried diligently (but
unsuccessfully) to get ZEA to unconditionally transfer
the rights of the registration.



Isn't this really strange? How can ZEA register any ZC trademark?!
Either ZC is the owner of the trademarks including Europe or it isn't?!
So either ZEA is violating the ZC trademark rights knowingly or ZC maybe 
never had any registered trademarks in Europeyou someone please clarify 
this (Paul?).


-aj

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


Re: [Zope] performance of textindexng2 vs. zctextindex

2005-07-19 Thread Andreas Jung



--On 19. Juli 2005 17:15:25 -0700 Francis Kelly <[EMAIL PROTECTED]> wrote:


I recently installed TextIndexNG2 2.1.1


which is *pretty old*. Take a look at the v 2.2.0 which has been optimized 
over the time in different ways. Consider using StupidStorage as documented 
in the release notes.




I've been struck that if the number of search hits is high, TextIndexNG2
is much slower than ZCTextIndex. For example, if I do a search on
'podcast' (our site deals w/ podcasting) I get about 14,000 hits.
ZCTextIndex returns the results in about 0.1 seconds; TextIndexNG2 takes
31 seconds or 300 times longer. In general, the more hits there are, the
bigger the difference between the two search indexes.


Query speed depends on different things: the query, the implementation, the 
operations needed to be performed during the query. Because of some 
functionality TXNG needs to store much more information than ZCTextIndex.

It did this as said above sometimes in a not so efficient way (see above).
You might also look at TextIndexNG V3.

-aj


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


[Zope] Zope Foundation Update

2005-07-19 Thread Rob Page

Foundation Update


This note updates progress on forming of the Zope
Foundation. To remain transparent as possible, we are
communicating in as timely a manner as possible.

First, we have contacted the Software Freedom Law
Center (SFLC) which specializes in the formation and
maintenance of the legal structures that support open
source software. From our first conference call with
our primary POC there (who also helped with the Plone
Foundation), we took away some homework items
including:

   (1) draft trademark license agreement between Zope
   Corporation and the Zope Foundation

   (2) draft/initial set of ByLaws and related formation
   documents that capture the spirit of what we've
   been discussing for a while now (i.e., Eclipse
   Foundation-inspired membership and Apache
   Software Foundation-inspired operations).

We have made progress on (2) but stopped when we
discovered a trademark violation that needs to be
addressed before Zope Corporation can properly license
the trademarks to the Zope Foundation.

During my stay at EuroPython I learned that eighteen
months ago (and without Zope Corporation's knowledge or
consent) Zope Europe Association (ZEA) registered a
trademark consisting of the Cirlce-Z (the stylized Z
surrounded by a circle) followed by the word ZOPE
(hereinafter "Circle-Z-Zope").  The mark they
registered is identical to the corporate logo used by
Zope Corporation.

In the three weeks since learning of ZEA's illegitimate
registration of our marks we have tried diligently (but
unsuccessfully) to get ZEA to unconditionally transfer
the rights of the registration.

We have offered to reimburse the registration fees paid
by the ZEA to the WIPO (World Intellectual Property
Organization) in order to facilitate the transfer. We
have further offered to preserve their license to use
the Zope mark in the conduct of their business as an
association of Zope companies.

ZEA's registration represents an abuse of registration
and management of international trademarks and the
misappropriation of a mark that is clearly the property
of Zope Corporation.  We are sorely disappointed that
ZEA is unwilling to transfer the marks quickly and
quietly so that we can proceed swiftly toward the
formation of the Zope Foundation.

We know that the establishment of a fair trademark
license for the entire Zope community is an _essential_
component of the Zope Foundation. It is possible that
we will come to a conclusion with the ZEA prior to the
conclusion of a trademark dispute process.

However, as a result (and unfortunately), until this
matter is resolved using the established
legal/trademark management processes, we are not able
to proceed with the Zope Foundation. We will keep the
community updated as milestones are reached, so that
you know what the new target dates are for the
formation of the Foundation at the same time that we
do.

We recognize that there are lingering questions about
the trademark and our management thereof.  We have
captured our position on these marks in an open letter
to the Zope Community.  You can find this letter at:

o http://www.zope.com/about_us/legal/ 
ZopeCorpTrademarkManagement_OpenLetter.html


As an aside, the ZEA has also registered the Plone logo
as a trademark.  It is not our business, but came as a
surprise to us, that the Plone Foundation is not the
owner of the Plone trademark.

--
Rob Page   V: 540 361 1710
Zope Corporation   F: 703 995 0412

___
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] ZTUtils.Iterator value in ZPT

2005-07-19 Thread David Pratt
Hi Peter. Thanks for your reply.  I think I am getting closer with this 
but still not quite right.
It appears I am calling Iterator right, because it gets an Iterator 
instance and now getting number 1

but that doesn't tell me much.





.. html form contents
   .. a field
   meant next, meaning you are asking the iterator for the next value. 
What am I missing?


Regards,
David

On Tuesday, July 19, 2005, at 07:18 PM, Peter Bengtsson wrote:


On 7/19/05, David Pratt <[EMAIL PROTECTED]> wrote:

I want to intialize the value of ZTUtils.Iterator and use the value
to increment tabindex attribute  in my ZPT for forms in CMF

Something like:





Don't you need to create it with a sequence like
python:modules['ZTUtils'].Iterator(range(100)); >

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


[Zope] performance of textindexng2 vs. zctextindex

2005-07-19 Thread Francis Kelly
I recently installed TextIndexNG2 2.1.1 on a system running Zope 2.7.6 
on Fedora Core 3. I've been running some comparison tests with 
ZCTextIndex, which is what our site currently uses. We're indexing 
around 50,000 objects at the moment. For TextIndexNG2, this is the 
configuration:


Indexed attributes   keywordSearchSource
Default encodingutf-8
Storage StandardStorage
Stemmer english
Splitter: casefolding   enabled
Splitter: index single characters   disabled
Splitter: max. length of splitted words 64
Splitter: separator characters  .+-_@
Default query parserPyQueryParser
Autoexpansion   disabled
Stopwords   english
Normalizer  European
Use converters  disabled
Near distance   
Left truncation disabled



I've been struck that if the number of search hits is high, TextIndexNG2 
is much slower than ZCTextIndex. For example, if I do a search on 
'podcast' (our site deals w/ podcasting) I get about 14,000 hits. 
ZCTextIndex returns the results in about 0.1 seconds; TextIndexNG2 takes 
31 seconds or 300 times longer. In general, the more hits there are, the 
bigger the difference between the two search indexes.


TextIndexNG2 is great: it has many features that we really want and 
perhaps the cost of those features is performance vis-a-vis ZCTextIndex. 
But I'm hoping that maybe I've overlooked an obvious or not-so-obvious 
configuration issue that will enable me to speed up TextIndexNG2.


Thanks for any advice.

Francis Kelly
www.loomia.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] ZTUtils.Iterator value in ZPT

2005-07-19 Thread Peter Bengtsson
On 7/19/05, David Pratt <[EMAIL PROTECTED]> wrote:
> I want to intialize the value of ZTUtils.Iterator and use the value
> to increment tabindex attribute  in my ZPT for forms in CMF
> 
> Something like:
> 
> 
> 

Don't you need to create it with a sequence like

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


[Zope] ZopeProfiler (python profiler) - strange results

2005-07-19 Thread Maciej Wisniowski

Hi!

I've just run ZopeProfiler few times to check which functions are
slowest in my site and during analysis of the results I've found
something that confuses me a bit.

When I'm showing results using "print_stats" and ordered by "time"
I get times:

calls   tottime  percall   cumtime   percallfunction

...total_x...cumulative_x   ...   X:1026(__call__)


for function X.

This seemed good till I've used "print_callees" format which
showed me that function X is calling function Y and Z and
their execution times are:

functions_time = Y_call_time + Z_call_time.


As far as I understand it "tottime" is the time without
subfunctions' call times and "cumtime" is with subfunctions'
call times, so I supposed that:

cumulative_x - functions_time = total_x

but this is not true... in almost every case I've checked it is
rather:

total_x + functions_time > cumulative_x

Why? I don't think these are concurrent threads...
but what makes this difference? It's possibly
something trivial but... ;)


--
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] ZTUtils.Iterator value in ZPT

2005-07-19 Thread David Pratt

I want to intialize the value of ZTUtils.Iterator and use the value
to increment tabindex attribute  in my ZPT for forms in CMF

Something like:



.. html form contents
   .. a field
   
 ... etc, etc.  



The first part gives me an iterator object.  How do I get its value as 
an integer?

___
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: question on python script, dtml method and options

2005-07-19 Thread Erik Myllymaki
next_state does get initialized - it is the name of the submit buttons on my 
various forms.



Josef Meile wrote:

Hi Erik,

I don't get a traceback, i just get error and message back as empty 
strings; their initiallized value.


very strange.


Looking at your python script I saw that initially you set error and
message to the empty string ''. I guess the script is not detecting a
'next_state' keyword in the request. So, it is excecuting the first if
of your code:

if not request.has_key('next_state'):
  return container['MAIN'](context, request, error=error, message=message)

Where are you initializing 'next_state'? Try printing the request
object to see if it really exists or perhaps you are doing some typo.

Regards,
Josef

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


[Zope] Re: question on python script, dtml method and options

2005-07-19 Thread Josef Meile

Hi Erik,

I don't get a traceback, i just get error and message back as empty 
strings; their initiallized value.


very strange.

Looking at your python script I saw that initially you set error and
message to the empty string ''. I guess the script is not detecting a
'next_state' keyword in the request. So, it is excecuting the first if
of your code:

if not request.has_key('next_state'):
  return container['MAIN'](context, request, error=error, message=message)

Where are you initializing 'next_state'? Try printing the request
object to see if it really exists or perhaps you are doing some typo.

Regards,
Josef

___
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] question on python script, dtml method and options

2005-07-19 Thread Peter Bengtsson
How you get to the page is irrelevant. I don't care if you redirect
there or type in the url or click a link.

On 7/19/05, Erik Myllymaki <[EMAIL PROTECTED]> wrote:
> I am using DTML only because I am using the excellent Calendar tag product.
> 
> sometimes, the links on the calendar tag get affected by from variables so as 
> a
> hack i re-write the QUERY_STRING using:
> 
> request.RESPONSE.redirect(request['URL'] + '?mode-calendar=' +
> request['mode-calendar'] + '&date-calendar=' + request['date-calendar'] +
> '&location=' + request['location'])
> 
> instead of:
> 
> return container['MAIN'](context, request, error=error, message=message)
> 
> I originally left that detail out to avoid unnecessary confusion, but I think 
> it
> might be the cause...ideas?
> 
> 
> 
> 
> 
> Peter Bengtsson wrote:
> > On 7/19/05, Erik Myllymaki <[EMAIL PROTECTED]> wrote:
> >
> >>I use the following template often. When using a page template for my MAIN 
> >>page,
> >>I access the error and message vars with:
> >>
> >>Error message
> >>Reg. Message
> >>
> >>How would I access them when I use a dtml-method for my MAIN page?
> >> and  don't seem to work.
> >>
> >
> >
> > That _should_ work.
> > In DTML, I think when you ask for something it does a options,
> > REQUEST, context, acquisition context lookup all in one loop. In TAL
> > you can't be lazy :( and you have to specify exactly where you expect
> > it to come from.
> >
> > Bare in mind that keyword arguments only span across ONE template
> > where as variables in REQUEST span across ALL templates.
> >
> > Doublecheck your template usage and/or send us your traceback.
> >
> >
> >>Python Script - index_html:
> >>
> >># Import a standard function, and get the HTML request and response objects.
> >>from Products.PythonScripts.standard import html_quote
> >>request = container.REQUEST
> >>RESPONSE =  request.RESPONSE
> >>
> >>error=''
> >>message=''
> >>
> >>if not request.has_key('next_state'):
> >>   return container['MAIN'](context, request, error=error, message=message)
> >>
> >>elif  request.get('next_state') == 'Do Something':
> >>   try:
> >> doSomething()
> >> message = message + 'We did something'
> >>   except:
> >> error = error + 'Error in doSomething()'
> >>
> >>
> >>elif  request.get('next_state') == 'Do Something Else':
> >>   try:
> >> doSomethingElse()
> >> message = message + 'We did something else'
> >>   except:
> >> error = error + 'Error in doSomethingElse()'
> >>
> >>
> >>return container['MAIN'](context, request, error=error, message=message)
> >>
> >>___
> >>Zope maillist  -  Zope@zope.org
> >>http://mail.zope.org/mailman/listinfo/zope
> >>**   No cross posts or HTML encoding!  **
> >>(Related lists -
> >> http://mail.zope.org/mailman/listinfo/zope-announce
> >> http://mail.zope.org/mailman/listinfo/zope-dev )
> >>
> >
> >
> >
> 


-- 
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] question on python script, dtml method and options

2005-07-19 Thread Erik Myllymaki

I am using DTML only because I am using the excellent Calendar tag product.

sometimes, the links on the calendar tag get affected by from variables so as a 
hack i re-write the QUERY_STRING using:


request.RESPONSE.redirect(request['URL'] + '?mode-calendar=' + 
request['mode-calendar'] + '&date-calendar=' + request['date-calendar'] + 
'&location=' + request['location'])


instead of:

return container['MAIN'](context, request, error=error, message=message)

I originally left that detail out to avoid unnecessary confusion, but I think it 
might be the cause...ideas?






Peter Bengtsson wrote:

On 7/19/05, Erik Myllymaki <[EMAIL PROTECTED]> wrote:


I use the following template often. When using a page template for my MAIN page,
I access the error and message vars with:

Error message
Reg. Message

How would I access them when I use a dtml-method for my MAIN page?
 and  don't seem to work.




That _should_ work. 
In DTML, I think when you ask for something it does a options,

REQUEST, context, acquisition context lookup all in one loop. In TAL
you can't be lazy :( and you have to specify exactly where you expect
it to come from.

Bare in mind that keyword arguments only span across ONE template
where as variables in REQUEST span across ALL templates.

Doublecheck your template usage and/or send us your traceback.



Python Script - index_html:

# Import a standard function, and get the HTML request and response objects.
from Products.PythonScripts.standard import html_quote
request = container.REQUEST
RESPONSE =  request.RESPONSE

error=''
message=''

if not request.has_key('next_state'):
  return container['MAIN'](context, request, error=error, message=message)

elif  request.get('next_state') == 'Do Something':
  try:
doSomething()
message = message + 'We did something'
  except:
error = error + 'Error in doSomething()'


elif  request.get('next_state') == 'Do Something Else':
  try:
doSomethingElse()
message = message + 'We did something else'
  except:
error = error + 'Error in doSomethingElse()'


return container['MAIN'](context, request, error=error, message=message)

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






___
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] question on python script, dtml method and options

2005-07-19 Thread Peter Bengtsson
On 7/19/05, Erik Myllymaki <[EMAIL PROTECTED]> wrote:
> I don't get a traceback, i just get error and message back as empty strings;
> their initiallized value.
> 

So you're not getting an error. 
What is the initialized value? Is 'error' and 'message' set in REQUEST?
(that you can find out from doing )


> 
> 
> Peter Bengtsson wrote:
> > On 7/19/05, Erik Myllymaki <[EMAIL PROTECTED]> wrote:
> >
> >>I use the following template often. When using a page template for my MAIN 
> >>page,
> >>I access the error and message vars with:
> >>
> >>Error message
> >>Reg. Message
> >>
> >>How would I access them when I use a dtml-method for my MAIN page?
> >> and  don't seem to work.
> >>
> >
> >
> > That _should_ work.
> > In DTML, I think when you ask for something it does a options,
> > REQUEST, context, acquisition context lookup all in one loop. In TAL
> > you can't be lazy :( and you have to specify exactly where you expect
> > it to come from.
> >
> > Bare in mind that keyword arguments only span across ONE template
> > where as variables in REQUEST span across ALL templates.
> >
> > Doublecheck your template usage and/or send us your traceback.
> >
> >
> >>Python Script - index_html:
> >>
> >># Import a standard function, and get the HTML request and response objects.
> >>from Products.PythonScripts.standard import html_quote
> >>request = container.REQUEST
> >>RESPONSE =  request.RESPONSE
> >>
> >>error=''
> >>message=''
> >>
> >>if not request.has_key('next_state'):
> >>   return container['MAIN'](context, request, error=error, message=message)
> >>
> >>elif  request.get('next_state') == 'Do Something':
> >>   try:
> >> doSomething()
> >> message = message + 'We did something'
> >>   except:
> >> error = error + 'Error in doSomething()'
> >>
> >>
> >>elif  request.get('next_state') == 'Do Something Else':
> >>   try:
> >> doSomethingElse()
> >> message = message + 'We did something else'
> >>   except:
> >> error = error + 'Error in doSomethingElse()'
> >>
> >>
> >>return container['MAIN'](context, request, error=error, message=message)
> >>
> >>___
> >>Zope maillist  -  Zope@zope.org
> >>http://mail.zope.org/mailman/listinfo/zope
> >>**   No cross posts or HTML encoding!  **
> >>(Related lists -
> >> http://mail.zope.org/mailman/listinfo/zope-announce
> >> http://mail.zope.org/mailman/listinfo/zope-dev )
> >>
> >
> >
> >
> 


-- 
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] question on python script, dtml method and options

2005-07-19 Thread Erik Myllymaki
I don't get a traceback, i just get error and message back as empty strings; 
their initiallized value.


very strange.



Peter Bengtsson wrote:

On 7/19/05, Erik Myllymaki <[EMAIL PROTECTED]> wrote:


I use the following template often. When using a page template for my MAIN page,
I access the error and message vars with:

Error message
Reg. Message

How would I access them when I use a dtml-method for my MAIN page?
 and  don't seem to work.




That _should_ work. 
In DTML, I think when you ask for something it does a options,

REQUEST, context, acquisition context lookup all in one loop. In TAL
you can't be lazy :( and you have to specify exactly where you expect
it to come from.

Bare in mind that keyword arguments only span across ONE template
where as variables in REQUEST span across ALL templates.

Doublecheck your template usage and/or send us your traceback.



Python Script - index_html:

# Import a standard function, and get the HTML request and response objects.
from Products.PythonScripts.standard import html_quote
request = container.REQUEST
RESPONSE =  request.RESPONSE

error=''
message=''

if not request.has_key('next_state'):
  return container['MAIN'](context, request, error=error, message=message)

elif  request.get('next_state') == 'Do Something':
  try:
doSomething()
message = message + 'We did something'
  except:
error = error + 'Error in doSomething()'


elif  request.get('next_state') == 'Do Something Else':
  try:
doSomethingElse()
message = message + 'We did something else'
  except:
error = error + 'Error in doSomethingElse()'


return container['MAIN'](context, request, error=error, message=message)

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






___
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] question on python script, dtml method and options

2005-07-19 Thread Peter Bengtsson
On 7/19/05, Erik Myllymaki <[EMAIL PROTECTED]> wrote:
> I use the following template often. When using a page template for my MAIN 
> page,
> I access the error and message vars with:
> 
> Error message
> Reg. Message
> 
> How would I access them when I use a dtml-method for my MAIN page?
>  and  don't seem to work.
> 

That _should_ work. 
In DTML, I think when you ask for something it does a options,
REQUEST, context, acquisition context lookup all in one loop. In TAL
you can't be lazy :( and you have to specify exactly where you expect
it to come from.

Bare in mind that keyword arguments only span across ONE template
where as variables in REQUEST span across ALL templates.

Doublecheck your template usage and/or send us your traceback.

> Python Script - index_html:
> 
> # Import a standard function, and get the HTML request and response objects.
> from Products.PythonScripts.standard import html_quote
> request = container.REQUEST
> RESPONSE =  request.RESPONSE
> 
> error=''
> message=''
> 
> if not request.has_key('next_state'):
>return container['MAIN'](context, request, error=error, message=message)
> 
> elif  request.get('next_state') == 'Do Something':
>try:
>  doSomething()
>  message = message + 'We did something'
>except:
>  error = error + 'Error in doSomething()'
> 
> 
> elif  request.get('next_state') == 'Do Something Else':
>try:
>  doSomethingElse()
>  message = message + 'We did something else'
>except:
>  error = error + 'Error in doSomethingElse()'
> 
> 
> return container['MAIN'](context, request, error=error, message=message)
> 
> ___
> Zope maillist  -  Zope@zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )
> 


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


[Zope] question on python script, dtml method and options

2005-07-19 Thread Erik Myllymaki
I use the following template often. When using a page template for my MAIN page, 
I access the error and message vars with:


Error message
Reg. Message

How would I access them when I use a dtml-method for my MAIN page?
 and  don't seem to work.

Python Script - index_html:

# Import a standard function, and get the HTML request and response objects.
from Products.PythonScripts.standard import html_quote
request = container.REQUEST
RESPONSE =  request.RESPONSE

error=''
message=''

if not request.has_key('next_state'):
  return container['MAIN'](context, request, error=error, message=message)

elif  request.get('next_state') == 'Do Something':
  try:
doSomething()
message = message + 'We did something'
  except:
error = error + 'Error in doSomething()'


elif  request.get('next_state') == 'Do Something Else':
  try:
doSomethingElse()
message = message + 'We did something else'
  except:
error = error + 'Error in doSomethingElse()'


return container['MAIN'](context, request, error=error, message=message)

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

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


Re: [Zope] Reg Zope Installation Problem

2005-07-19 Thread Florent Guillaume
praba kar  <[EMAIL PROTECTED]> wrote:
> I try to install zope 2.7.0.

Stop right here. Zope 2.7.0 is hopelessly outdated. Use Zope 2.7.6.

Florent

-- 
Florent Guillaume, Nuxeo (Paris, France)   CTO, Director of R&D
+33 1 40 33 71 59   http://nuxeo.com   [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] Reg Zope Installation Problem

2005-07-19 Thread Andreas Jung



--On 19. Juli 2005 14:42:01 +0100 praba kar <[EMAIL PROTECTED]> wrote:


Dear All,

I try to install zope 2.7.0.  After the
installation. I have create zope installation
directory using mkzopeinstance.py.  From that
zope installation directory I try to run
bin/runzope command.  But It will give


2.7.0 is *ancient*. Try 2.7.7.

-aj



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


[Zope] Reg Zope Installation Problem

2005-07-19 Thread praba kar
Dear All,

I try to install zope 2.7.0.  After the
installation. I have create zope installation
directory using mkzopeinstance.py.  From that
zope installation directory I try to run
bin/runzope command.  But It will give
below type error.
***

--
2005-07-19T19:00:04 INFO(0) ZServer HTTP server
started at Tue Jul 19 19:00:04 2005
Hostname: localhost.localdomain
Port: 8080
--
2005-07-19T19:00:04 INFO(0) ZServer FTP server started
at Tue Jul 19 19:00:04 2005
Hostname: prabahar
Port: 8021
--
2005-07-19T19:00:04 INFO(0) Zope Set effective user to
"enmail"
Traceback (most recent call last):
  File
"/Programs/Zope/2.7.0/lib/python/Zope/Startup/run.py",
line 49, in ?
run()
  File
"/Programs/Zope/2.7.0/lib/python/Zope/Startup/run.py",
line 19, in run
start_zope(opts.configroot)
  File
"/Programs/Zope/2.7.0/lib/python/Zope/Startup/__init__.py",
line 51, in start_zope
starter.startZope()
  File
"/Programs/Zope/2.7.0/lib/python/Zope/Startup/__init__.py",
line 230, in startZope
Zope.startup()
  File
"/Programs/Zope/2.7.0/lib/python/Zope/__init__.py",
line 45, in startup
from Zope.App.startup import startup as _startup
  File
"/Programs/Zope/2.7.0/lib/python/Zope/App/startup.py",
line 30, in ?
import OFS.Application
  File
"/Programs/Zope/2.7.0/lib/python/OFS/Application.py",
line 18, in ?
import Globals,Folder,os,sys,App.Product,
App.ProductRegistry, misc_
  File
"/Programs/Zope/2.7.0/lib/python/App/Product.py", line
44, in ?
from HelpSys.HelpSys import ProductHelp
  File
"/Programs/Zope/2.7.0/lib/python/HelpSys/__init__.py",
line 15, in ?
import HelpSys
  File
"/Programs/Zope/2.7.0/lib/python/HelpSys/HelpSys.py",
line 18, in ?
from Products.ZCatalog.ZCatalog import ZCatalog
  File
"/Programs/Zope/2.7.0/lib/python/Products/ZCatalog/__init__.py",
line 16, in ?
import ZCatalog, Catalog, CatalogAwareness,
CatalogPathAwareness, ZClasses
  File
"/Programs/Zope/2.7.0/lib/python/Products/ZCatalog/ZCatalog.py",
line 39, in ?
from IZCatalog import IZCatalog
  File
"/Programs/Zope/2.7.0/lib/python/Products/ZCatalog/IZCatalog.py",
line 236, in ?
__doc__ = IZCatalog.__doc__ + __doc__
TypeError: unsupported operand type(s) for +:
'NoneType' and 'NoneType'
*
Kindly let me know what is the problem ? I didn't know
how to update zope.conf file.  Kindly guide
me how to start zope service

regards
Prabahar.








__
Free antispam, antivirus and 1GB to save all your messages
Only in Yahoo! Mail: http://in.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] ZPyIRC and Zope 2.7

2005-07-19 Thread Andreas Jung



--On 19. Juli 2005 09:57:27 +0100 David <[EMAIL PROTECTED]> wrote:


Hi

I installed ZPyIRC version 0.1.3 in Zope 2.7.5 and I get Zope  Template
Errors on two of the frames when trying to start a chat  client. I don't
know ZTP very well. (Python is 2.3.5)

I was hoping that maybe somebody has fixed the templates for 2.7.


You could fix the templates yourself or ask the author of the product :-)

-aj




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


[Zope] ZPyIRC and Zope 2.7

2005-07-19 Thread David

Hi

I installed ZPyIRC version 0.1.3 in Zope 2.7.5 and I get Zope  
Template Errors on two of the frames when trying to start a chat  
client. I don't know ZTP very well. (Python is 2.3.5)


I was hoping that maybe somebody has fixed the templates for 2.7.

Any help very welcome!

DR

Here a traceback from cwindowlist:

Traceback (innermost last):

Module ZPublisher.Publish, line 101, in publish
Module ZPublisher.mapply, line 88, in mapply
Module ZPublisher.Publish, line 39, in call_object
Module Shared.DC.Scripts.Bindings, line 306, in __call__
Module Shared.DC.Scripts.Bindings, line 343, in _bindAndExec
Module Products.PageTemplates.PageTemplateFile, line 106, in _exec
Module Products.PageTemplates.PageTemplate, line 88, in pt_render
4d9d10fad2a83777ee81bbbae6be3f44/cwindowlist>

Warning: Compilation failed
Warning: TAL.HTMLTALParser.NestingError: Open tags , ,  

[Zope] Error in treating custom exception

2005-07-19 Thread Marco Bizzarri

Hi all.

It looks like I've hit something which is already known (I've found this 
reference:


http://mail.zope.org/pipermail/zope-collector-monitor/2004-October/004316.html

)

I've a custom standard_error_html page, made with a Zope Page Template. 
I'm trying to provide a custom __str__ for a custom exception. This 
works, most of the time, but in some cases I encounter the following error:


TypeError: unbound method __str__() must be called with InvalidFolderId 
instance as first argument (got nothing instead)


InvalidFolderId is the custom exception, of course.

This is the code of the exception:

class InvalidFolderId(Exception):

def __init__(self, folder_id):
self.folder_id = folder_id

def __str__(self):
return "folder id %s could not be found in the database" % 
self.folder_id



folder_id is a number. What could be done to avoid this problem?

Thank you in advance for the help.

Regards
Marco
begin:vcard
fn:Marco Bizzarri
n:Bizzarri;Marco
org:Icube S.r.l.
adr:;;via Ridolfi 15;Pisa;PI;56124;Italy
email;internet:[EMAIL PROTECTED]
title:Amministratore Delegato
tel;work:+39-050-970-207
tel;fax:+39-050-3136-588
tel;cell:+39-348-640-4861
x-mozilla-html:FALSE
url:http://notenotturne.blogspot.com/
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] Forcing Zope transaction commit

2005-07-19 Thread Tino Wildenhain
Am Dienstag, den 19.07.2005, 00:35 -0700 schrieb David H:
...
> Your idea is what I thought of at first - but my Interbase Adapter
> doesn't like COMMIT statements (!)  and I didn't test it out.  But it
> seems that would not  solve the problem because both ZSQL methods are
> embedded in the *same* zope transaction stream, e.g.
> 
> .  Submit a page
> .  call ZSQL1 (part of Zope Tran 100)
> . call ZSQL2  (part of Zope Tran 100)  <--- this depends on zSqL1
> being executed but the transaction has not been executed yet, its
> pending.
> .  Display a page
> .  *now* Zope commits (executes all calls - which is too late in this
> case).
> 
> When ZSQL2 is called ZSQL1's results are not yet executed into my RDMS
> and therefore ZSQL2 cannot see whatever ZSQL1 did. (COMMITs not
> with-standing).


Stop. Should Interbase here behave different? Its actually required
that a database makes changes visible to all queries in the _same
transaction_. It depends on Transaction Isolation Level 
if you see further changes, e.g. if your Database supports "read
committed" - this means you would see data changed by _other
transactions_ that started _after your transaction_.

> Its understandable that Zope might wait between page presentations to
> transact all changes until all succeed ( an exception aborts the
> transaction).  Its just in some cases they can't all succeed until
> some are transacted.

Thats weird. I'd like to see the model you are referring to here.
Are you perhaps playing with after-commit triggers? 

___
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] Forcing Zope transaction commit

2005-07-19 Thread m . bizzarri
It would be better if you explain what you're trying to obtain. Inside a
single *Zope* transaction, all the queries are inside the same *RDBMS*
transaction.

Therefore, the second sql method should see the effects of the first
one. If that is not the case, review what is actually happening (i.e.
the first query may be failing even though you did not detect it).

Regards
Marco




On Mon, Jul 18, 2005 at 09:14:26PM -0700, David H wrote:
> Hi list,
> 
> At times (it seems)  necessary to force a Zope transaction commit.  This 
> might occur between two zSQL calls where the second depends on the 
> first's *SQL* transaction's availability but the first has not yet been 
> commited because the *Zope* transaction that includes both zSQL calls 
> has not yet been commited.
> 
> I handled this with a call to an external script as below, eg
> 
> . zSql1()
> . pyCommit() 
> zSql2()
> Publish new page
> 
> Here's pyCommit()
> 
> # ...
> # Extenstion/pyCommit.py
> # ...
> from ZODB import FileStorage,DB
> 
> def commit( self ):
>   t = get_transaction() # ZODB builtin
>   if t:
>  t.commit()
> # ...
> 
> Thats it. And it solved my problem. Is there a reason why this is a bad 
> idea, all things being equal?  A better way to do it, when needed?
> 
> Thanks,
> David
> 
> ___
> 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 )

-- 
Marco Bizzarri - Amministratore Delegato - Icube S.r.l.
Sede:   Via Ridolfi 15 - 56124 Pisa (PI), Italia 
E-mail: [EMAIL PROTECTED]   WWW: www.icube.it   
Tel:(+39) 050 97 02 07  Fax: (+39) 050 31 36 588


signature.asc
Description: Digital 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] Forcing Zope transaction commit

2005-07-19 Thread David H




Bakhtiar A Hamid wrote:

  On 7/19/05, David H <[EMAIL PROTECTED]> wrote:
  
  
Hi list,

At times (it seems)  necessary to force a Zope transaction commit.  This
might occur between two zSQL calls where the second depends on the
first's *SQL* transaction's availability but the first has not yet been
commited because the *Zope* transaction that includes both zSQL calls
has not yet been commited.

I handled this with a call to an external script as below, eg

. zSql1()
. pyCommit()
zSql2()
Publish new page

Here's pyCommit()

# ...
# Extenstion/pyCommit.py
# ...
from ZODB import FileStorage,DB

def commit( self ):
   t = get_transaction() # ZODB builtin
   if t:
  t.commit()
# ...

Thats it. And it solved my problem. Is there a reason why this is a bad
idea, all things being equal?  A better way to do it, when needed?


  
  
you're playing with fire  ;)

let zope handle the transaction

use  to separate two or more sql calls

this way, if one of the call fails, the transaction will be aborted

gurus, correct me if i'm wrong, please

hth

  
  

Bakhtiar,

Thanks very much for responding.

Your idea is what I thought of at first - but my Interbase Adapter
doesn't like COMMIT statements (!)  and I didn't test it out.  But it
seems that would not  solve the problem because both ZSQL methods are
embedded in the *same* zope transaction stream, e.g.

.  Submit a page
.  call ZSQL1 (part of Zope Tran 100)
. call ZSQL2  (part of Zope Tran 100)  <--- this depends on zSqL1
being executed but the transaction has not been executed yet, its
pending.
.  Display a page
.  *now* Zope commits (executes all calls - which is too late in this
case).

When ZSQL2 is called ZSQL1's results are not yet executed into my RDMS
and therefore ZSQL2 cannot see whatever ZSQL1 did. (COMMITs not
with-standing).

Its understandable that Zope might wait between page presentations to
transact all changes until
all succeed ( an exception aborts the transaction).  Its just in some
cases they can't all succeed until some
are transacted.

David





(even with your recommended COMMIT) is not available at the time ZSQL2
is called.

>From what i've seen it appears that Zope commits transactions 

David





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