Re: [Zope] Products have incorrect home attribute

2006-01-18 Thread Martijn Pieters
On 1/18/06, Andreas Jung [EMAIL PROTECTED] wrote:
 What and where is the 'home' attribute?

In lib/python/App/Product.py line 549:

  product.home=home

'home' is the product path as determined by
OFS.Application.install_product; it looks, from a cursory glance, that
this should be reset every time Zope is restart.

It should be perfectly safe to delete the Products from your Control
Panel Products folder and restart Zope to have them recreated though.
If you don't trust this procedure, back up the ZODB, but from my
reading this should happen every time you start Zope anyway.

--
Martijn Pieters
___
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] Products have incorrect home attribute

2006-01-18 Thread Luca Olivetti

En/na Andreas Jung ha escrit:



--On 18. Januar 2006 08:19:25 +0100 Martijn Pieters [EMAIL PROTECTED] 
wrote:



On 1/18/06, Andreas Jung [EMAIL PROTECTED] wrote:

What and where is the 'home' attribute?


In lib/python/App/Product.py line 549:

  product.home=home

'home' is the product path as determined by
OFS.Application.install_product; it looks, from a cursory glance, that
this should be reset every time Zope is restart.


I asked the same question a couple of days ago (see wrong directoy in 
Control_Panel.Products..home) and no, they aren't reset at zope 
restart, and deleting the pyc files doesn't help either.




huuh...never seen that...looks like a culprit...who actually uses that 
information?


CMFQuickInstaller does (and breaks if you move your zope instance)


Isn't package_home() doing the same?


funny that you ask since I just noticed that CMFQuickInstaller imports 
the function then never uses it.


Bye

--
Luca Olivetti
Wetron Automatización S.A. http://www.wetron.es/
Tel. +34 93 5883004  Fax +34 93 5883007
___
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] Products have incorrect home attribute

2006-01-18 Thread Martijn Pieters
On 1/18/06, Luca Olivetti [EMAIL PROTECTED] wrote:
 I asked the same question a couple of days ago (see wrong directoy in
 Control_Panel.Products..home) and no, they aren't reset at zope
 restart, and deleting the pyc files doesn't help either.

Strange. If you are comfortable with the pdb debugger, you can debug
the code in OFS.Application.install_products by adding a 'import pdb;
pdb.set_trace()' before line 615 and see what get_products and
install_product do, focussing on the product_dir variable, and how it
eventually makes its way to the home property.

--
Martijn Pieters
___
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] Products have incorrect home attribute

2006-01-18 Thread Martijn Pieters
On 1/18/06, Andreas Jung [EMAIL PROTECTED] wrote:
 huuh...never seen that...looks like a culprit...who actually uses that
 information? Isn't package_home() doing the same?

package_home serves a different use-case, I think; you use it within a
Product to determine paths to templates and such.

As for users of Product.home; QuickInstaller uses it, and the product
object itself uses it to find the README.txt file for the ZMI tab.

--
Martijn Pieters
___
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] Products have incorrect home attribute

2006-01-18 Thread Dieter Maurer
Martijn Pieters wrote at 2006-1-18 08:19 +0100:
 ...
It should be perfectly safe to delete the Products from your Control
Panel Products folder and restart Zope to have them recreated though.
If you don't trust this procedure, back up the ZODB, but from my
reading this should happen every time you start Zope anyway.

Please don't: it would make running from a read only storage
much more difficult

Up to now only a few products (such as Formulator) try to
write into the ZODB on any startup. I would not like to see
all products doing that.


-- 
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] Products have incorrect home attribute

2006-01-18 Thread Martijn Pieters
On 1/18/06, Dieter Maurer [EMAIL PROTECTED] wrote:
 If you don't trust this procedure, back up the ZODB, but from my
 reading this should happen every time you start Zope anyway.

 Please don't: it would make running from a read only storage
 much more difficult

Indeed. Had I the time, I certainly would be diving deeper into this;
a quick scan of the code doesn't quite build the required
understanding, especially when you take read-only situations into
account.

--
Martijn Pieters
___
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] Products have incorrect home attribute

2006-01-17 Thread George Lee
After migrating to a new server, several of my Zope products have an
incorrect home attribute that specifies where they live on the
filesystem. However, when I try to change these attributes using an
external method, the attributes do not change. Any help?

Peace,
George
___
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] Products have incorrect home attribute

2006-01-17 Thread Andreas Jung



--On 18. Januar 2006 01:24:34 -0500 George Lee [EMAIL PROTECTED] 
wrote:



After migrating to a new server, several of my Zope products have an
incorrect home attribute that specifies where they live on the
filesystem.


What and where is the 'home' attribute?

-aj

pgpnG4zLUkZ1u.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] Products have incorrect home attribute

2006-01-17 Thread Dario Lopez-Kästen

George Lee wrote:

After migrating to a new server, several of my Zope products have an
incorrect home attribute that specifies where they live on the
filesystem. However, when I try to change these attributes using an
external method, the attributes do not change. Any help?

Peace,
George


I dunno if this relates to your specific case (and apologies for perhaps 
stating the obvious). Did you delete the *.pyc files after moving the 
products?


pyc files contain information about their paths, and they do not get 
recompiled if their source file is unchanged.


hth,
/dario

--
-- ---
Dario Lopez-Kästen, IT Systems  Services Chalmers University of Tech.
Lyrics applied to programming  application design:
emancipate yourself from mental slavery - redemption song, b. marley

___
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] Products have incorrect home attribute

2006-01-17 Thread Andreas Jung



--On 18. Januar 2006 08:19:25 +0100 Martijn Pieters [EMAIL PROTECTED] 
wrote:



On 1/18/06, Andreas Jung [EMAIL PROTECTED] wrote:

What and where is the 'home' attribute?


In lib/python/App/Product.py line 549:

  product.home=home

'home' is the product path as determined by
OFS.Application.install_product; it looks, from a cursory glance, that
this should be reset every time Zope is restart.



huuh...never seen that...looks like a culprit...who actually uses that 
information? Isn't package_home() doing the same?


-aj

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