Re: [Zope] Choosing printer in client computer

2008-03-19 Thread Peter Bengtsson
You've seen Andreas response already so I'm not going to repeat that.
I don't think the browser will ever have access to these settings.
Imagine if it did, it could open up a world of security risks for just
using a normal web page.

On 18/03/2008, rieh25 <[EMAIL PROTECTED]> wrote:
>
>  I need an application to choose a specific printer in a client computer (not
>  the server) for printing reports. Internet explorer uses register entries to
>  configure the default printer, but the problem is that an external script
>  would do this changes in the server, not the local computer. Or should I
>  just give up trying to use Zope and use an external utility (MS Access
>  perhaps) to manage the printing part of the application?
>  --
>  View this message in context: 
> http://www.nabble.com/Choosing-printer-in-client-computer-tp16130952p16130952.html
>  Sent from the Zope - General mailing list archive at Nabble.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 )
>


-- 
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] Re: zip files corrupted with IE when opened, fine when downloaded

2008-03-19 Thread Maurits van Rees
robert rottermann, on 2008-03-17:
> Hi there,
> we have a problem with an intranet that runs using plone 2.5.3
>
> when users using IE want to open a zip file from the intranet by using
> the "open" option from the download dialog they get winzip complaining
> that the file is corrupted.
> if they select "save" from the same dialog they can open the zip archive
> without problem.
>
> does anyone know a solution for this or give me an idea where to look
> for one?

The INSTALL.txt of CMFPlone says this about WinZip:

* Unpacking the Plone archive with WinZip will not work: WinZip will truncate
  filenames without warning you. 7-Zip is a good open source alternative for
  Windows that you can use instead: http://www.7-zip.org

That does not look like the same error you are getting, so the other
answers are probably better, but still using 7-zip might solve this.

My 2 cents.

-- 
Maurits van Rees | http://maurits.vanrees.org/
Work | http://zestsoftware.nl/
"This is your day, don't let them take it away." [Barlow Girl]

___
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] Upgrading a Product from Zope 2.7 to Zope 2.10

2008-03-19 Thread Peter Bengtsson
I'm not an expert at these kind of things but 3 tips:

* Don't bother with trying to run off the old Data.fs until you get
your product working in the new Zope.

* Inspect your code and what kind of objects (and most likely more
importantly) and attributes you're attaching to classes that are
persistent. I've forgotten my case now but I remember that I had a
problem when I was trying to set an attribute that turned out to be a
uncalled class method of another class.

* Get familiar with this: 'import pdb; pdb.set_trace()'

On 19/03/2008, Mark Hellewell <[EMAIL PROTECTED]> wrote:
> Hello,
>
>  I'm in the middle of trying to upgrade a Product written for Zope 2.7
>  so that it runs on Zope 2.10!
>
>  The product appears in the newer ZMI's list of available products but
>  whenever I try to add an object of the products type through the ZMI I
>  get the following error in the event.log and nothing is added to the
>  site:
>
>  Traceback (innermost last):
>Module ZPublisher.Publish, line 125, in publish
>Module Zope2.App.startup, line 238, in commit
>Module transaction._manager, line 96, in commit
>Module transaction._transaction, line 395, in commit
>Module transaction._transaction, line 495, in _commitResources
>Module ZODB.Connection, line 502, in commit
>Module ZODB.Connection, line 1046, in savepoint
>Module ZODB.Connection, line 555, in _commit
>Module ZODB.Connection, line 582, in _store_objects
>Module ZODB.serialize, line 407, in serialize
>  TypeError: Can't pickle objects in acquisition wrappers.
>
>  additionally, if I take a Data.fs from my Zope 2.7 instance and try
>  running with it in place on a 2.10 instance the various objects of the
>  product already created simply don't show up (no broken icon, nothing)
>
>  Running Zope 2.10.5 and Python 2.4.4 and the Product in question was
>  written using CMF 1.4.2 (but now upgraded to CMF 1.6.4, I've made
>  several changes already to accomodate this upgrade)
>
>  I'd be grateful for any insight anyone might have or any hints at what
>  to do next!
>
>  Thanks,
>  Mark
>  ___
>  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] Re: zip files corrupted with IE when opened, fine when downloaded

2008-03-19 Thread robert rottermann
Maurits van Rees schrieb:
> robert rottermann, on 2008-03-17:
>> Hi there,
>> we have a problem with an intranet that runs using plone 2.5.3
>>
>> when users using IE want to open a zip file from the intranet by using
>> the "open" option from the download dialog they get winzip complaining
>> that the file is corrupted.
>> if they select "save" from the same dialog they can open the zip archive
>> without problem.
>>
>> does anyone know a solution for this or give me an idea where to look
>> for one?
> 
> The INSTALL.txt of CMFPlone says this about WinZip:
> 
> * Unpacking the Plone archive with WinZip will not work: WinZip will truncate
>   filenames without warning you. 7-Zip is a good open source alternative for
>   Windows that you can use instead: http://www.7-zip.org
> 
> That does not look like the same error you are getting, so the other
> answers are probably better, but still using 7-zip might solve this.
> 
> My 2 cents.
> 
thanks maurits
it would be enough to use Firefox ..
but it's an intranet users spread all over europe and company policy is
IE only ..
robert
___
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] zip files corrupted with IE when opened, fine when downloaded

2008-03-19 Thread robert rottermann
Chris Withers schrieb:
> robert rottermann wrote:
>> Hi there,
>> when users using IE want to open a zip file from the intranet by using
>> the "open" option from the download dialog they get winzip complaining
>> that the file is corrupted.
>> if they select "save" from the same dialog they can open the zip archive
>> without problem.
> 
> Sounds like you have a .tar.gz being served with an incorrect content
> type such that IE stupidly saves it as a .tar which then gets passed to
> WinZip, which doesn't look at the content of the file and so tries to
> open the .tar.gz as if it was a .tar and so barfs...
> 
> cheers,
> 
> Chris
> 
thanks,
but its a *.zip file. and it is when opening in the window that springs
up at the end of the download.
when it is saved and then opened all is fine

robert
___
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 utf-8 problem using MySQL

2008-03-19 Thread Hugo Ramos
Yellow ppl,

I'm using Zope 2.10.5 + MySQL 5.0.51a + MySQL-python-1.2.2.

Everything is set to utf-8.
In MySQL server and client is set to utf-8 and utf8_general_ci
In Zope zpublisher is set to utf-8
I even created the (in)famous sitecustomize.py in Python 2.4.4 site-packages

The problem is that when retrieving data from a table the
international chars become alien symbols...

The only way I get the right symbols is using SET NAMES 'utf8'
 on top of each sql method.

What am I missing?


Thanks

-- 
Hugo Ramos
http://www.hugoramos.eu/
[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] For the record

2008-03-19 Thread Dieter Maurer
Peter Bengtsson wrote at 2008-3-18 17:38 +:
>I wanted to see how much faster brain.getObject() would be if the
>returned object was located in a BTreeFolder versus a normal folder so
>I wrote a benchmark that created about 10,000 light simple objects in
>two distinctly different containers and each with a ZCatalog that has
>a PathIndex.
>
>I would expect the BTreeFolder parenting calls of brain.getObject() to
>be much faster but I found that there was NO DIFFERENCE. wtf?!

If you access many (most) objects, these accesses may be even
more expensive with a "BTreeFolder" than with a standard folder.
This is not that difficult to explain:

  When you access a normal folder, with the folder all child
  references are loaded. When you later access the folder
  again (and it has not yet been flushed from the ZODB cache),
  no loading is necessary.

  When you access a "BTreeFolder", no child references are loaded.
  Thus, elementary access to a "BTreeFolder" is much more
  efficient.
  When you access a child in a "BTreeFolder", then all child
  references are loaded that are in the same bucket as the
  access child. In addition, all nodes on the path
  from the "BTreeFolder" to this bucket are loaded.
  When you access many children, you have a good chance,
  that you have accessed at least on child in each bucket.
  In this case, you have loaded all child references (as
  in the standard folder case). In addition, you have
  loaded the complete access structure.

To summarize: an isolated access to a child of a large "BTreeFolder"
is usually much more efficient than an isolated access to a standard
folder with the same children. However, the advantage of the
"BTreeFolder" decreases when lots of children are accessed.



-- 
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] content headers wrong after upload

2008-03-19 Thread Dieter Maurer
Michael Shulman wrote at 2008-3-18 13:03 -0500:
>I just noticed that when I submit a form to a zope script(python) that
>includes a file upload, the content-type and content-length headers of
>the response are incorrectly set to those of the uploaded file, rather
>than those of what the script actually returns.  Any ideas why this
>could be happening?  I'm running zope 2.9.6 on Debian etch.

This sounds difficult to believe.
An upload definitely does not modify response headers



-- 
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] Upgrading a Product from Zope 2.7 to Zope 2.10

2008-03-19 Thread Dieter Maurer
Mark Hellewell wrote at 2008-3-19 15:57 +1100:
>I'm in the middle of trying to upgrade a Product written for Zope 2.7  
>so that it runs on Zope 2.10!
>
>The product appears in the newer ZMI's list of available products but  
>whenever I try to add an object of the products type through the ZMI I  
>get the following error in the event.log and nothing is added to the  
>site:
>
>Traceback (innermost last):
>   Module ZPublisher.Publish, line 125, in publish
>   Module Zope2.App.startup, line 238, in commit
>   Module transaction._manager, line 96, in commit
>   Module transaction._transaction, line 395, in commit
>   Module transaction._transaction, line 495, in _commitResources
>   Module ZODB.Connection, line 502, in commit
>   Module ZODB.Connection, line 1046, in savepoint
>   Module ZODB.Connection, line 555, in _commit
>   Module ZODB.Connection, line 582, in _store_objects
>   Module ZODB.serialize, line 407, in serialize
>TypeError: Can't pickle objects in acquisition wrappers.

Try to reproduce this problem in an interactive Python session
("bin/zopectl debug" under *nix). Use "pdb.pm()" to analyse the
post mortem traceback. Look at the object that causes the problem.
If you are lucky, the object gives you hints where the error
has been introduced.


-- 
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] For the record

2008-03-19 Thread Peter Bengtsson
On 19/03/2008, Dieter Maurer <[EMAIL PROTECTED]> wrote:
> Peter Bengtsson wrote at 2008-3-18 17:38 +:
>
> >I wanted to see how much faster brain.getObject() would be if the
>  >returned object was located in a BTreeFolder versus a normal folder so
>  >I wrote a benchmark that created about 10,000 light simple objects in
>  >two distinctly different containers and each with a ZCatalog that has
>  >a PathIndex.
>  >
>  >I would expect the BTreeFolder parenting calls of brain.getObject() to
>  >be much faster but I found that there was NO DIFFERENCE. wtf?!
>
>
> If you access many (most) objects, these accesses may be even
>  more expensive with a "BTreeFolder" than with a standard folder.
>  This is not that difficult to explain:
>
>   When you access a normal folder, with the folder all child
>   references are loaded. When you later access the folder
>   again (and it has not yet been flushed from the ZODB cache),
>   no loading is necessary.
>
>   When you access a "BTreeFolder", no child references are loaded.
>   Thus, elementary access to a "BTreeFolder" is much more
>   efficient.
>   When you access a child in a "BTreeFolder", then all child
>   references are loaded that are in the same bucket as the
>   access child. In addition, all nodes on the path
>   from the "BTreeFolder" to this bucket are loaded.
>   When you access many children, you have a good chance,
>   that you have accessed at least on child in each bucket.
>   In this case, you have loaded all child references (as
>   in the standard folder case). In addition, you have
>   loaded the complete access structure.
>
>  To summarize: an isolated access to a child of a large "BTreeFolder"
>  is usually much more efficient than an isolated access to a standard
>  folder with the same children. However, the advantage of the
>  "BTreeFolder" decreases when lots of children are accessed.
>
...because they're cached in the normal folder.

So, to rewrite my benchmark I'd have to flush the cache between each fetch?
I don't mind because the app itself has little traffic but individual
pages are slow.

>
>
>  --
>
> Dieter
>


-- 
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] content headers wrong after upload

2008-03-19 Thread Michael Shulman
I wrote:
> I just noticed that when I submit a form to a zope script(python) that
> includes a file upload, the content-type and content-length headers of
> the response are incorrectly set to those of the uploaded file, rather
> than those of what the script actually returns.  Any ideas why this
> could be happening?  I'm running zope 2.9.6 on Debian etch.

Okay, I managed to reproduce it; apparently it depended on saving
the uploaded file with ExtFile.  I also noticed that my version of
ExtFile was out of date, and upgrading to ExtFile v1.5 appears to
have fixed the problem.  Still not sure what was causing it though.
Sorry to bother y'all.

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