Re: [Zope-dev] Remove zmi_views menus from zope.file?

2012-05-29 Thread Uli Fouquet
Hi Christopher,

On Tue, 29 May 2012 06:05:57 -0500 Christopher Lozinski wrote:

> On 5/28/12 7:22 AM, Uli Fouquet wrote:
>> It's at least interesting to find other non-zope.app packages that
> register zmi_views components. I think these could/should be fixed as
> well. I would do that, if people tell me what packages there are.
> 
> Here you go.
> 
> zope.app.dtmlpage-3.5.0-py2.6.egg

I'm afraid, this _is_ a zope.app package and IIRC correctly, they can
expect the regular ZMI to exist/be registered.

Unfortunately you can't expect zope.app packages to work out-of-the-box
with newer non-zope.app packages.

To make this package work (i.e. to get the zmi_views menu) you might
include zope.app.zcmlfiles in the files required by your project.

This, however, pulls in a huge bunch of other zope.app-packages often
not compatible with more recent non-zope.app packages (and often not
wanted anyway).

A workaround (avoiding zope.app.zcmlfiles) might be to register such a
'zmi_view' menu in your own project/package's configure.zcml:

  
  
  
  

This would avoid the ImportError concerning 'zmi_views' but not
neccessarily add a menu in your ztfy framework (because it looks like
ztfy comes with its own set of menus). I think it would be best to ask
the ztfy author about this.

Beside this I might ask on zope-dev about 'fixing' also zope.app packages.

Best regards,

-- 
Uli



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


Re: [Zope-dev] Remove zmi_views menus from zope.file?

2012-05-29 Thread Christopher Lozinski
On 5/28/12 7:22 AM, Uli Fouquet wrote:
> It's at least interesting to find other non-zope.app packages that
register zmi_views components. I think these could/should be fixed as
well. I would do that, if people tell me what packages there are.

Here you go.

zope.app.dtmlpage-3.5.0-py2.6.egg

Thank you.

-- 
Regards
Christopher Lozinski

Check out my iPhone apps TextFaster and EmailFaster
http://textfaster.com

Expect a paradigm shift.
http://MyHDLClass.com:8080

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


Re: [Zope-dev] Remove zmi_views menus from zope.file?

2012-05-28 Thread Uli Fouquet
Hi Christopher,

On Sun, 27 May 2012 20:28:49 -0500 Christopher Lozinski wrote:

> Well this has been bothering me as well, so I am delighted to see this
> thread.
> 
> I started off with the release of ZTFY that includes a ZMI.
> 
> I added in DTML.

What package did you add?

> It could not find the zmi_views.   When I remove those
> lines from ZCML all is happy, except the menu items are not there.

I guess this is a similar issue. There might be other (non-zope.app)
packages around that register stuff for zmi_views menus. These might be
fixed as well.


> I thought maybe zmi_views was renamed.  Guess not based on this thread.

Don't know anything about ztfy, sorry.

> I am stumped.  There is some reason to believe  that ZTFY implemented
> its own ZMI, sure looks the same.  In which case I have to poke around
> in that package to figure out what the menu is called.

Hastily browsing over the sources there seems to be some 'zmi_views'
component registered, but I am not sure it is the menu normally
registered by zope.app.zcmlfiles. You might ask the author.

> But if that is not the case, I have no idea why it cannot find
> zmi_views.  Maybe next I will try adding zope.file to see what happens. 

If you have no zope.app.zcmlfiles installed with ztfy, then you won't
get any additional menu entries installed with a fixed zope.file (when
it is released). But depending on zope.file should not choke your
complete project anymore.

Something bothering me is this cryptic import error that normally shows
up if 'zmi_views' is not available. I then get some 'Could not import
zmi_views from zope.app.menus' message (hope, I remember correctly).
This 'zope.app.menus' seems to be not an egg or similar but an
artificial package (created by zope.browsermenu?). This is confusing.

> I have other things I am working on so I put this on the back burner,
> but interesting to see this thread. 

It's at least interesting to find other non-zope.app packages that
register zmi_views components. I think these could/should be fixed as
well. I would do that, if people tell me what packages there are.

Best regards,

-- 
Uli



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


Re: [Zope-dev] Remove zmi_views menus from zope.file?

2012-05-27 Thread Christopher Lozinski
Well this has been bothering me as well, so I am delighted to see this
thread.

I started off with the release of ZTFY that includes a ZMI.

I added in DTML.  It could not find the zmi_views.   When I remove those
lines from ZCML all is happy, except the menu items are not there.

I thought maybe zmi_views was renamed.  Guess not based on this thread.

I am stumped.  There is some reason to believe  that ZTFY implemented
its own ZMI, sure looks the same.  In which case I have to poke around
in that package to figure out what the menu is called.

But if that is not the case, I have no idea why it cannot find
zmi_views.  Maybe next I will try adding zope.file to see what happens. 

I have other things I am working on so I put this on the back burner,
but interesting to see this thread. 

-- 
Regards
Christopher Lozinski

Check out my iPhone apps TextFaster and EmailFaster
http://textfaster.com

Expect a paradigm shift.
http://MyHDLClass.com:8080

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


Re: [Zope-dev] Remove zmi_views menus from zope.file?

2012-05-27 Thread Marius Gedminas
On Sun, May 27, 2012 at 07:14:31PM +0200, Leonardo Rochael Almeida wrote:
> > Oh, and I haven't found out yet, which package exactly normally provides
> > the zmi_views menu. Do you know it by any chance?
> 
> I tried to locate it as well, but failed. What I could discover is
> that whichever distribution provides this will likely include a  id="zmi_views" ...> directive somewhere.

That would be zope.app.zcmlfiles, in menus.zcml.

Regards,
Marius Gedminas
-- 
http://pov.lt/ -- Zope 3/BlueBream consulting and development


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


Re: [Zope-dev] Remove zmi_views menus from zope.file?

2012-05-27 Thread Uli Fouquet
Hi Leo,

On Sun, 27 May 2012 19:14:31 +0200 Leonardo Rochael Almeida wrote:

> Hi Uli,
> 
> Not sure if you wanted to remove zope-dev from copy on purpose, but
> what we talk about below is probably of general interest...

Sorry, that wasn't intentional.

> On Sun, May 27, 2012 at 4:38 PM, Uli Fouquet  wrote:
>> Hi Leo,
>>
>> nice to hear from you, I hope you are well :-)
> 
> I'm fine, thanks for asking! :-) Hope you're doing fine as well...
> 
>> On Sun, 27 May 2012 16:16:43 +0200 Leonardo Rochael Almeida wrote:
>>
>>> IMHO:
>>>
>>> Move to a conditional include of a menu.zcml that (or include a
>>> menu.zcml file that conditionally) registers the browser menus for
>>> zmi_views and release a new minor version, declaring an extra
>>> dependency on the packages that provides zmi_views. With this, release
>>> a new minor version that will be backward compatible, due to the
>>> conditional.
>>>
>>> Then release a new major version that removes the include and the
>>> conditional. Add to README the instructions for manually including
>>> menu.zcml if this functionality is needed.
>>>
>>> If you get tired, do just one of the above :-)
>>
>> Yep, I planned in the same direction. The problem, however, is the
>> condition. The 'condition:zcml' directive, AFAICS, only asks for
>> existence of packages or features. But in the zope.file (or zmi_views)
>> case I'd have to ask for zope.app.menus.zmi_views (which wouldn't be a
>> package nor a feature).
>>
>> Furthermore if one asks for a package as condition, that could be wrong
>> as people could define a zmi_views menu elsewhere and then the
>> registrations should be included (okay, on the other hand one could tell
>> them to include the menus.zcml manually then).
> 
> 
> I guess we could argue that whoever provides the zmi_views menu should
> provide a respective feature.
> 
>> Oh, and I haven't found out yet, which package exactly normally provides
>> the zmi_views menu. Do you know it by any chance?
> 
> I tried to locate it as well, but failed. What I could discover is
> that whichever distribution provides this will likely include a  id="zmi_views" ...> directive somewhere.
> 
> Since you mentioned on the grok list that previous versions of grok
> could work with zope.file, then perhaps you can search the eggs/
> directory for this directive.
> 
> Good hunting, and please keep us informed.

I think it's zope.app.zcmlfiles.

Overall, I think putting the menu-related stuff into a separate
menus.zcml which is conditionally parsed if zope.app.zcmlfiles is
available should give a reasonable backwards-compatibility and could
help people that don't want the whole zope.app-dependencies as well.

In the long run it might be nice to have zmi_views-availability as a
feature, but for now we might go with that short-term solution.

Thanks for the input! I'll prepare a branch for review.

Best regards,

-- 
Uli



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


Re: [Zope-dev] Remove zmi_views menus from zope.file?

2012-05-27 Thread Leonardo Rochael Almeida
Hi Uli,

Not sure if you wanted to remove zope-dev from copy on purpose, but
what we talk about below is probably of general interest...

On Sun, May 27, 2012 at 4:38 PM, Uli Fouquet  wrote:
> Hi Leo,
>
> nice to hear from you, I hope you are well :-)

I'm fine, thanks for asking! :-) Hope you're doing fine as well...

> On Sun, 27 May 2012 16:16:43 +0200 Leonardo Rochael Almeida wrote:
>
>> IMHO:
>>
>> Move to a conditional include of a menu.zcml that (or include a
>> menu.zcml file that conditionally) registers the browser menus for
>> zmi_views and release a new minor version, declaring an extra
>> dependency on the packages that provides zmi_views. With this, release
>> a new minor version that will be backward compatible, due to the
>> conditional.
>>
>> Then release a new major version that removes the include and the
>> conditional. Add to README the instructions for manually including
>> menu.zcml if this functionality is needed.
>>
>> If you get tired, do just one of the above :-)
>
> Yep, I planned in the same direction. The problem, however, is the
> condition. The 'condition:zcml' directive, AFAICS, only asks for
> existence of packages or features. But in the zope.file (or zmi_views)
> case I'd have to ask for zope.app.menus.zmi_views (which wouldn't be a
> package nor a feature).
>
> Furthermore if one asks for a package as condition, that could be wrong
> as people could define a zmi_views menu elsewhere and then the
> registrations should be included (okay, on the other hand one could tell
> them to include the menus.zcml manually then).


I guess we could argue that whoever provides the zmi_views menu should
provide a respective feature.

> Oh, and I haven't found out yet, which package exactly normally provides
> the zmi_views menu. Do you know it by any chance?

I tried to locate it as well, but failed. What I could discover is
that whichever distribution provides this will likely include a  directive somewhere.

Since you mentioned on the grok list that previous versions of grok
could work with zope.file, then perhaps you can search the eggs/
directory for this directive.

Good hunting, and please keep us informed.

Cheers,

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


Re: [Zope-dev] Remove zmi_views menus from zope.file?

2012-05-27 Thread Leonardo Rochael Almeida
Hi Uli,

Thanks for taking care of this.

IMHO:

Move to a conditional include of a menu.zcml that (or include a
menu.zcml file that conditionally) registers the browser menus for
zmi_views and release a new minor version, declaring an extra
dependency on the packages that provides zmi_views. With this, release
a new minor version that will be backward compatible, due to the
conditional.

Then release a new major version that removes the include and the
conditional. Add to README the instructions for manually including
menu.zcml if this functionality is needed.

If you get tired, do just one of the above :-)

Regards,

Leo

On Sun, May 27, 2012 at 3:52 PM, Uli Fouquet  wrote:
> Hi there,
>
> zope.file still registers browser menus for `zmi_views` in its
> browser.zcml. This is a problem if you don't have/want the ZMI but want
> to use zope.file otherwise (IMHO it also means an undeclared dependency,
> as none of the packages zope.file declares to depend on really provides
> this browser menu AFAICS).
>
> I see that it is easy to register such a menu yourself but it annoys and
> confuses people new to Grok/Zope.
>
> I'd therefore like to remove these registrations from zope.file, make it
> at least conditional, or move it to some `menu.zcml` or similar, not
> included automatically by z3c.autoinclude and friends.
>
> Is there a reason why that shouldn't happen? If not: what way would be
> the best in your opinion (removal/conditional/menu.zcml)?
>
> Best regards,
>
> --
> Uli
>
>
> ___
> Zope-Dev maillist  -  Zope-Dev@zope.org
> https://mail.zope.org/mailman/listinfo/zope-dev
> **  No cross posts or HTML encoding!  **
> (Related lists -
>  https://mail.zope.org/mailman/listinfo/zope-announce
>  https://mail.zope.org/mailman/listinfo/zope )
>
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Remove zmi_views menus from zope.file?

2012-05-27 Thread Uli Fouquet
Hi there,

zope.file still registers browser menus for `zmi_views` in its
browser.zcml. This is a problem if you don't have/want the ZMI but want
to use zope.file otherwise (IMHO it also means an undeclared dependency,
as none of the packages zope.file declares to depend on really provides
this browser menu AFAICS).

I see that it is easy to register such a menu yourself but it annoys and
confuses people new to Grok/Zope.

I'd therefore like to remove these registrations from zope.file, make it
at least conditional, or move it to some `menu.zcml` or similar, not
included automatically by z3c.autoinclude and friends.

Is there a reason why that shouldn't happen? If not: what way would be
the best in your opinion (removal/conditional/menu.zcml)?

Best regards,

-- 
Uli



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