Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Zope: CMF

Member preferences

 

 

First page Previous page 1 2 Next page Last page  View All Zope cmf RSS feed   Index | Next | Previous | View Threaded


charlie.clark at clark-consulting

Jun 30, 2010, 2:32 AM

Post #1 of 26 (2001 views)
Permalink
Member preferences

Hi,

as you may have noticed, I've been doing some work on the browser views.
Unfortunately in my eagerness I've trashed a couple of histories and
properties. If possible I'd like to restore them but my svn knowledge is
still fairly rudimentary so if I could be pointed in the right direction.
I think Products.CMFDefault/browser/utils.py is the main victim.

I'm currently working on a view for member preferences. One of the
advantages of views over PythonScript is the support for unit testing and
how that gives you the chance to think carefully about what you want your
view to do and while, like most of the CMF code, the scripts are easy
enough to understand it's noticeable how important some kind of narrative
is for a reimplementation. I guess what we're missing at the moment would
be functional testing of the various PythonScript combinations. In the
absence of either I have a couple of questions:

* the preferences form points the user in the direction of the password
change form. Shouldn't this also be a user action?

* where are the user folder security settings? local_roles for a user's
home folder?

Charlie
--
Charlie Clark
Managing Director
Clark Consulting & Research
German Office
Helmholtzstr. 20
Düsseldorf
D- 40215
Tel: +49-211-600-3657
Mobile: +49-178-782-6226
_______________________________________________
Zope-CMF maillist - Zope-CMF [at] zope
https://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


y.2010 at wcm-solutions

Jun 30, 2010, 3:26 AM

Post #2 of 26 (1950 views)
Permalink
Re: Member preferences [In reply to]

Hi!


Charlie Clark wrote:
> as you may have noticed, I've been doing some work on the browser views.
> Unfortunately in my eagerness I've trashed a couple of histories and
> properties. If possible I'd like to restore them but my svn knowledge is
> still fairly rudimentary so if I could be pointed in the right direction.
> I think Products.CMFDefault/browser/utils.py is the main victim.

In general the svn history is quite useful for understanding old and
complex code. But browser/utils.py isn't that old and that complex so I
think it would be fine if you just add the correct svn properties.

> I'm currently working on a view for member preferences. One of the
> advantages of views over PythonScript is the support for unit testing and
> how that gives you the chance to think carefully about what you want your
> view to do and while, like most of the CMF code, the scripts are easy
> enough to understand it's noticeable how important some kind of narrative
> is for a reimplementation. I guess what we're missing at the moment would
> be functional testing of the various PythonScript combinations. In the
> absence of either I have a couple of questions:
>
> * the preferences form points the user in the direction of the password
> change form. Shouldn't this also be a user action?

I usually disable the preferences action completely and use
change_password and change_email actions instead. But I was never in the
mood to start a discussion about the CMFDefault policy.

> * where are the user folder security settings? local_roles for a user's
> home folder?

Don't understand these questions. First you talk about the user folder
and than about user's home folders. What kind of security settings are
you looking for?


Cheers,

Yuppie
_______________________________________________
Zope-CMF maillist - Zope-CMF [at] zope
https://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


charlie.clark at clark-consulting

Jun 30, 2010, 3:52 AM

Post #3 of 26 (1954 views)
Permalink
Re: Member preferences [In reply to]

Am 30.06.2010, 12:26 Uhr, schrieb yuppie <y.2010 [at] wcm-solutions>:

Hi yuppie,

> In general the svn history is quite useful for understanding old and
> complex code. But browser/utils.py isn't that old and that complex so I
> think it would be fine if you just add the correct svn properties.

On my checkout (CMF.buildout) the properties are set:

fuchsia:browser charlieclark$ svn propget svn:eol-style utils.py
native
fuchsia:browser charlieclark$ svn propget svn:keywords utils.py
Id

>> * the preferences form points the user in the direction of the password
>> change form. Shouldn't this also be a user action?
> I usually disable the preferences action completely and use
> change_password and change_email actions instead. But I was never in the
> mood to start a discussion about the CMFDefault policy.

I don't see this as policy but a necessity for proper skin support. If the
join form has an action for the preferences, then change_password should
be an action. I'm thinking of this in removing hard-coded urls from
templates where possible. The _setRedirect() method you wrote for forms is
a good example of the power of actions.

From a policy point of view: changing passwords is probably of greater use
than changing the other settings. But you're right, there's little to be
gained from a discussion of this. FWIW I never really understood the
"portal" mania and I disable joining on all my sites. But I will add
change_password to user actions.

>> * where are the user folder security settings? local_roles for a user's
>> home folder?
> Don't understand these questions. First you talk about the user folder
> and than about user's home folders. What kind of security settings are
> you looking for?

Sorry: "Your Member folder will still be publicly accessible unless you
change its security settings."

If we're linking to other forms like change_password then we should do the
same here. This has to be local_roles form for the member's folder, hasn't
it? Although I don't see how you can hide your folder there.

Charlie
--
Charlie Clark
Managing Director
Clark Consulting & Research
German Office
Helmholtzstr. 20
Düsseldorf
D- 40215
Tel: +49-211-600-3657
Mobile: +49-178-782-6226
_______________________________________________
Zope-CMF maillist - Zope-CMF [at] zope
https://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


y.2010 at wcm-solutions

Jun 30, 2010, 5:12 AM

Post #4 of 26 (1938 views)
Permalink
Re: Member preferences [In reply to]

Hi!


Charlie Clark wrote:
> Am 30.06.2010, 12:26 Uhr, schrieb yuppie<y.2010 [at] wcm-solutions>:
>> In general the svn history is quite useful for understanding old and
>> complex code. But browser/utils.py isn't that old and that complex so I
>> think it would be fine if you just add the correct svn properties.
>
> On my checkout (CMF.buildout) the properties are set:
>
> fuchsia:browser charlieclark$ svn propget svn:eol-style utils.py
> native
> fuchsia:browser charlieclark$ svn propget svn:keywords utils.py
> Id

??? I just did a brand-new checkout and still can't see any properties.

>>> * the preferences form points the user in the direction of the password
>>> change form. Shouldn't this also be a user action?
>> I usually disable the preferences action completely and use
>> change_password and change_email actions instead. But I was never in the
>> mood to start a discussion about the CMFDefault policy.
>
> I don't see this as policy but a necessity for proper skin support. If the
> join form has an action for the preferences, then change_password should
> be an action. I'm thinking of this in removing hard-coded urls from
> templates where possible. The _setRedirect() method you wrote for forms is
> a good example of the power of actions.
>
> From a policy point of view: changing passwords is probably of greater use
> than changing the other settings. But you're right, there's little to be
> gained from a discussion of this. FWIW I never really understood the
> "portal" mania and I disable joining on all my sites. But I will add
> change_password to user actions.

I had *visible* actions in mind, but you didn't say that you want to add
a *visible* action.

+1 for an invisible change_password action

>>> * where are the user folder security settings? local_roles for a user's
>>> home folder?
>> Don't understand these questions. First you talk about the user folder
>> and than about user's home folders. What kind of security settings are
>> you looking for?
>
> Sorry: "Your Member folder will still be publicly accessible unless you
> change its security settings."
>
> If we're linking to other forms like change_password then we should do the
> same here. This has to be local_roles form for the member's folder, hasn't
> it? Although I don't see how you can hide your folder there.

Now I see what you mean. And I also have no idea how a normal member
could make his home folder inaccessible.


Cheers,

Yuppie
_______________________________________________
Zope-CMF maillist - Zope-CMF [at] zope
https://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


charlie.clark at clark-consulting

Jun 30, 2010, 5:32 AM

Post #5 of 26 (1936 views)
Permalink
Re: Member preferences [In reply to]

Am 30.06.2010, 14:12 Uhr, schrieb yuppie <y.2010 [at] wcm-solutions>:

> ??? I just did a brand-new checkout and still can't see any properties.

Double ???

Those properties get set automatically when I create new files. I can see
them on my system and svn status reports nothing fishy:

fuchsia:~ charlieclark$ cd
Sites/cmf-svn/CMF.buildout/trunk/src/Products.CMFDefault/Products/CMFDefault/browser/
fuchsia:browser charlieclark$ svn status utils.py
fuchsia:browser charlieclark$

Doesn't seem to matter whether I delete and add them again.

>>>> * the preferences form points the user in the direction of the
>>>> password
>>>> change form. Shouldn't this also be a user action?
>>> I usually disable the preferences action completely and use
>>> change_password and change_email actions instead. But I was never in
>>> the
>>> mood to start a discussion about the CMFDefault policy.
>>

> I had *visible* actions in mind, but you didn't say that you want to add
> a *visible* action.

Me, too.

> +1 for an invisible change_password action

Why do you think it should be kept invisible? To avoid clutter? Or
minimise the effect on the existing layout?

>> If we're linking to other forms like change_password then we should do
>> the
>> same here. This has to be local_roles form for the member's folder,
>> hasn't
>> it? Although I don't see how you can hide your folder there.
> Now I see what you mean. And I also have no idea how a normal member
> could make his home folder inaccessible.

Right. I'll ignore this for the view and remove it from the PythonScript.
Was struggling with an elegant way of getting a "object/localroles" action
for a member's home folder anyway!

Charlie
--
Charlie Clark
Managing Director
Clark Consulting & Research
German Office
Helmholtzstr. 20
Düsseldorf
D- 40215
Tel: +49-211-600-3657
Mobile: +49-178-782-6226
_______________________________________________
Zope-CMF maillist - Zope-CMF [at] zope
https://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


tseaver at palladion

Jun 30, 2010, 5:52 AM

Post #6 of 26 (1947 views)
Permalink
Re: Member preferences [In reply to]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Charlie Clark wrote:
> Am 30.06.2010, 14:12 Uhr, schrieb yuppie <y.2010 [at] wcm-solutions>:
>
>> ??? I just did a brand-new checkout and still can't see any properties.
>
> Double ???
>
> Those properties get set automatically when I create new files. I can see
> them on my system and svn status reports nothing fishy:
>
> fuchsia:~ charlieclark$ cd
> Sites/cmf-svn/CMF.buildout/trunk/src/Products.CMFDefault/Products/CMFDefault/browser/
> fuchsia:browser charlieclark$ svn status utils.py
> fuchsia:browser charlieclark$
>
> Doesn't seem to matter whether I delete and add them again.


To check the properties as stored in the repository::

$ env | grep ZSVN
ZSVN=svn+ssh://svn.zope.org/repos/main
$ svn propget svn:eol-style \
$ZSVN/Products.CMFDefault/trunk/Products/CMFDefault/utils.py
native
$ svn propget svn:keywords \
$ZSVN/Products.CMFDefault/trunk/Products/CMFDefault/utils.py
Author Date Id Revision



Tres.
- --
===================================================================
Tres Seaver +1 540-429-0999 tseaver [at] palladion
Palladion Software "Excellence by Design" http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkwrPgQACgkQ+gerLs4ltQ5+ewCg1F18wh110G5EpRlLyrP4h5YK
Sd4AniSvc89aIFqAFhIRa5A5y+Qm1KmS
=BYMQ
-----END PGP SIGNATURE-----

_______________________________________________
Zope-CMF maillist - Zope-CMF [at] zope
https://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


charlie.clark at clark-consulting

Jun 30, 2010, 5:54 AM

Post #7 of 26 (1946 views)
Permalink
Re: Member preferences [In reply to]

Am 30.06.2010, 14:32 Uhr, schrieb Charlie Clark
<charlie.clark [at] clark-consulting>:

> Why do you think it should be kept invisible? To avoid clutter? Or
> minimise the effect on the existing layout?

Whether visible or not, it seems something needs to be done in the
upgrade_step to reflect it and I confess my complete ignorance of upgrade
steps. Do I need to add a check and handler that adds a change_password
Action instance? Similar to _singlestate_workflow in to22.py?

Thanks!

Charlie
--
Charlie Clark
Managing Director
Clark Consulting & Research
German Office
Helmholtzstr. 20
Düsseldorf
D- 40215
Tel: +49-211-600-3657
Mobile: +49-178-782-6226
_______________________________________________
Zope-CMF maillist - Zope-CMF [at] zope
https://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


charlie.clark at clark-consulting

Jun 30, 2010, 5:56 AM

Post #8 of 26 (1947 views)
Permalink
Re: Member preferences [In reply to]

Am 30.06.2010, 14:52 Uhr, schrieb Tres Seaver <tseaver [at] palladion>:

> To check the properties as stored in the repository::
> $ env | grep ZSVN
> ZSVN=svn+ssh://svn.zope.org/repos/main
> $ svn propget svn:eol-style \
> $ZSVN/Products.CMFDefault/trunk/Products/CMFDefault/utils.py
> native
> $ svn propget svn:keywords \
> $ZSVN/Products.CMFDefault/trunk/Products/CMFDefault/utils.py
> Author Date Id Revision

Thanks very much, Tres. Looks like I need to make sure Author, Date, Id,
and Revision are added for new files.

Charlie
--
Charlie Clark
Managing Director
Clark Consulting & Research
German Office
Helmholtzstr. 20
Düsseldorf
D- 40215
Tel: +49-211-600-3657
Mobile: +49-178-782-6226
_______________________________________________
Zope-CMF maillist - Zope-CMF [at] zope
https://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


tseaver at palladion

Jun 30, 2010, 6:09 AM

Post #9 of 26 (1947 views)
Permalink
Re: Member preferences [In reply to]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Charlie Clark wrote:
> Am 30.06.2010, 14:52 Uhr, schrieb Tres Seaver <tseaver [at] palladion>:
>
>> To check the properties as stored in the repository::
>> $ env | grep ZSVN
>> ZSVN=svn+ssh://svn.zope.org/repos/main
>> $ svn propget svn:eol-style \
>> $ZSVN/Products.CMFDefault/trunk/Products/CMFDefault/utils.py
>> native
>> $ svn propget svn:keywords \
>> $ZSVN/Products.CMFDefault/trunk/Products/CMFDefault/utils.py
>> Author Date Id Revision
>
> Thanks very much, Tres. Looks like I need to make sure Author, Date, Id,
> and Revision are added for new files.

As a general rule, I would actually prefer that we strip out the
keywords currently in the code -- they are CVS-era fossils which no
longer add any value in the SVN + eggs world.


Tres.
- --
===================================================================
Tres Seaver +1 540-429-0999 tseaver [at] palladion
Palladion Software "Excellence by Design" http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkwrQiQACgkQ+gerLs4ltQ5FfACbBiri5LH4V/n+PAP2Tf0aGa4J
RFwAoKL4jnYSguWyaYRGc0AURIqai4IL
=vRde
-----END PGP SIGNATURE-----

_______________________________________________
Zope-CMF maillist - Zope-CMF [at] zope
https://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


y.2010 at wcm-solutions

Jun 30, 2010, 6:10 AM

Post #10 of 26 (1941 views)
Permalink
Re: Member preferences [In reply to]

Charlie Clark wrote:
> Am 30.06.2010, 14:52 Uhr, schrieb Tres Seaver<tseaver [at] palladion>:
>
>> To check the properties as stored in the repository::
>> $ env | grep ZSVN
>> ZSVN=svn+ssh://svn.zope.org/repos/main
>> $ svn propget svn:eol-style \
>> $ZSVN/Products.CMFDefault/trunk/Products/CMFDefault/utils.py
>> native
>> $ svn propget svn:keywords \
>> $ZSVN/Products.CMFDefault/trunk/Products/CMFDefault/utils.py
>> Author Date Id Revision

I can confirm this for CMFDefault/utils.py, but we were talking about
CMFDefault/browser/utils.py. And for that file I get nothing.

> Thanks very much, Tres. Looks like I need to make sure Author, Date, Id,
> and Revision are added for new files.

No. We don't use Author, Date or Revision.

Cheers, Yuppie
_______________________________________________
Zope-CMF maillist - Zope-CMF [at] zope
https://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


y.2010 at wcm-solutions

Jun 30, 2010, 6:26 AM

Post #11 of 26 (1946 views)
Permalink
Re: Member preferences [In reply to]

Charlie Clark wrote:
> Am 30.06.2010, 14:32 Uhr, schrieb Charlie Clark
> <charlie.clark [at] clark-consulting>:
>
>> Why do you think it should be kept invisible? To avoid clutter? Or
>> minimise the effect on the existing layout?

I don't think we need the link in preferences *and* in the menu. But
that's just a -0.5 vote, not a strong -1.

> Whether visible or not, it seems something needs to be done in the
> upgrade_step to reflect it and I confess my complete ignorance of upgrade
> steps. Do I need to add a check and handler that adds a change_password
> Action instance? Similar to _singlestate_workflow in to22.py?

See check_actions_tool/upgrade_actions_tool in to21.py.

Cheers, Yuppie
_______________________________________________
Zope-CMF maillist - Zope-CMF [at] zope
https://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


charlie.clark at clark-consulting

Jun 30, 2010, 7:03 AM

Post #12 of 26 (1934 views)
Permalink
Re: Member preferences [In reply to]

Am 30.06.2010, 15:26 Uhr, schrieb yuppie <y.2010 [at] wcm-solutions>:

> I don't think we need the link in preferences *and* in the menu. But
> that's just a -0.5 vote, not a strong -1.

I think the duplication is clumsy as well.

+1 on in the menu only.

>> Whether visible or not, it seems something needs to be done in the
>> upgrade_step to reflect it and I confess my complete ignorance of
>> upgrade
>> steps. Do I need to add a check and handler that adds a change_password
>> Action instance? Similar to _singlestate_workflow in to22.py?
> See check_actions_tool/upgrade_actions_tool in to21.py.

Cheers!

Charlie
--
Charlie Clark
Managing Director
Clark Consulting & Research
German Office
Helmholtzstr. 20
Düsseldorf
D- 40215
Tel: +49-211-600-3657
Mobile: +49-178-782-6226
_______________________________________________
Zope-CMF maillist - Zope-CMF [at] zope
https://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


charlie.clark at clark-consulting

Jun 30, 2010, 7:07 AM

Post #13 of 26 (1940 views)
Permalink
Re: Member preferences [In reply to]

Am 30.06.2010, 15:09 Uhr, schrieb Tres Seaver <tseaver [at] palladion>:

> As a general rule, I would actually prefer that we strip out the
> keywords currently in the code -- they are CVS-era fossils which no
> longer add any value in the SVN + eggs world.

Does this relate to the (rather soliloquisitc) thread from Justin Ryan on
zope-dev?

No more

"$Id: to22.py 110420 2010-04-01 17:12:56Z tseaver $

in the code? svn:keywords themselves get kept

I guess I'm +0 on this. I've always found it interesting to see who and
when was the last to tinker but I guess it is redundant.

Charlie
--
Charlie Clark
Managing Director
Clark Consulting & Research
German Office
Helmholtzstr. 20
Düsseldorf
D- 40215
Tel: +49-211-600-3657
Mobile: +49-178-782-6226
_______________________________________________
Zope-CMF maillist - Zope-CMF [at] zope
https://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


wichert at wiggy

Jun 30, 2010, 7:25 AM

Post #14 of 26 (1943 views)
Permalink
Re: Member preferences [In reply to]

On 6/30/10 16:07 , Charlie Clark wrote:
> Am 30.06.2010, 15:09 Uhr, schrieb Tres Seaver<tseaver [at] palladion>:
>
>> As a general rule, I would actually prefer that we strip out the
>> keywords currently in the code -- they are CVS-era fossils which no
>> longer add any value in the SVN + eggs world.
>
> Does this relate to the (rather soliloquisitc) thread from Justin Ryan on
> zope-dev?
>
> No more
>
> "$Id: to22.py 110420 2010-04-01 17:12:56Z tseaver $
>
> in the code? svn:keywords themselves get kept
>
> I guess I'm +0 on this. I've always found it interesting to see who and
> when was the last to tinker but I guess it is redundant.

svn info will tell you that and more.

Wichert.
_______________________________________________
Zope-CMF maillist - Zope-CMF [at] zope
https://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


charlie.clark at clark-consulting

Jun 30, 2010, 9:11 AM

Post #15 of 26 (1949 views)
Permalink
Re: Member preferences [In reply to]

Am 30.06.2010, 15:26 Uhr, schrieb yuppie <y.2010 [at] wcm-solutions>:

> See check_actions_tool/upgrade_actions_tool in to21.py.

I'm afraid I haven't quite got the hang of this. I've added the check and
upgrade:


_ACTIONS_XML = """\
<?xml version="1.0"?>
<object name="portal_actions" meta_type="CMF Actions Tool"
xmlns:i18n="http://xml.zope.org/namespaces/i18n">
<object name="user" meta_type="CMF Action Category">
<property name="title"></property>
<object name="change_password" meta_type="CMF Action"
i18n:domain="cmf_default">
<property name="title" i18n:translate="">Change password</property>
<property name="description"
i18n:translate="">Change your password</property>
<property name="url_expr">string:${portal_url}/password_form</property>
<property name="link_target"></property>
<property
name="icon_expr">string:${portal_url}/preferences_icon.png</property>
<property name="available_expr">member</property>
<property name="permissions">
<element value="Set own password"/>
</property>
<property name="visible">True</property>
</object>
</object>
</object>

def check_actions_tool(tool):
"""2.2.x to 2.3.0 upgrade step checker
"""
atool = getToolByName(tool, 'portal_actions')
try:
atool.user.change_password
except AttributeError:
return True
return False

def upgrade_actions_tool(tool):
"""2.2.x to 2.3.0 upgrade step handler
"""
logger = logging.getLogger('GenericSetup.upgrade')
atool = getToolByName(tool, 'portal_actions')
environ = SetupEnviron()
environ._should_purge = False
getMultiAdapter((atool, environ), IBody).body = _ACTIONS_XML
logger.info("'change_password' action added.")

But if change the actions.xml I still get the error when I run the tests.
Do I need to tell the upgrade to do the insert before preferences?

Charlie
--
Charlie Clark
Managing Director
Clark Consulting & Research
German Office
Helmholtzstr. 20
Düsseldorf
D- 40215
Tel: +49-211-600-3657
Mobile: +49-178-782-6226
_______________________________________________
Zope-CMF maillist - Zope-CMF [at] zope
https://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


tseaver at palladion

Jun 30, 2010, 9:14 AM

Post #16 of 26 (1940 views)
Permalink
Re: Member preferences [In reply to]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Charlie Clark wrote:
> Am 30.06.2010, 15:09 Uhr, schrieb Tres Seaver <tseaver [at] palladion>:
>
>> As a general rule, I would actually prefer that we strip out the
>> keywords currently in the code -- they are CVS-era fossils which no
>> longer add any value in the SVN + eggs world.
>
> Does this relate to the (rather soliloquisitc) thread from Justin Ryan on
> zope-dev?
>
> No more
>
> "$Id: to22.py 110420 2010-04-01 17:12:56Z tseaver $
>
> in the code? svn:keywords themselves get kept
>
> I guess I'm +0 on this. I've always found it interesting to see who and
> when was the last to tinker but I guess it is redundant.

Not only redundant to the data available in 'svn log' / 'svn info', but
actively harmful: keyword expansion makes merging branches / applying
patches harder. I would say that we should be removing the keywords
themselves from source code opportunistically; I don't really care
about the property itself.


Tres.
- --
===================================================================
Tres Seaver +1 540-429-0999 tseaver [at] palladion
Palladion Software "Excellence by Design" http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkwrbWcACgkQ+gerLs4ltQ6dagCgl7JvFTjPMSxr+kQrRkJlj4em
hGYAniXhe0mx9e78042bpkfy1OUm+5sX
=TH5/
-----END PGP SIGNATURE-----

_______________________________________________
Zope-CMF maillist - Zope-CMF [at] zope
https://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


y.2010 at wcm-solutions

Jul 1, 2010, 12:33 AM

Post #17 of 26 (1936 views)
Permalink
Re: Member preferences [In reply to]

Hi!


Charlie Clark wrote:
> _ACTIONS_XML = """\
> <?xml version="1.0"?>
> <object name="portal_actions" meta_type="CMF Actions Tool"
> xmlns:i18n="http://xml.zope.org/namespaces/i18n">
> <object name="user" meta_type="CMF Action Category">
> <property name="title"></property>

No need to reset the title of the 'user' category. That's not the
purpose of your upgrade step.

The tests just make sure an unmodified site is upgraded correctly. But
usually sites are customized. And if someone uses category titles he
would not expect that your step deletes them.

[...]
> def upgrade_actions_tool(tool):
> """2.2.x to 2.3.0 upgrade step handler
> """
> logger = logging.getLogger('GenericSetup.upgrade')
> atool = getToolByName(tool, 'portal_actions')
> environ = SetupEnviron()
> environ._should_purge = False
> getMultiAdapter((atool, environ), IBody).body = _ACTIONS_XML
> logger.info("'change_password' action added.")
>
> But if change the actions.xml I still get the error when I run the tests.

And that error shows you a nice diff that tells you that the
change_password action is added, but in the wrong position. Right? Or
did you forget to register the upgrade step?

> Do I need to tell the upgrade to do the insert before preferences?

Yes. "environ._should_purge = False" gives you the extension profile
behavior. By default new objects are added to the end of the container.
If you want them in a different place, you have to specify that using an
update directive ('insert-before' or 'insert-after').


Cheers,

Yuppie
_______________________________________________
Zope-CMF maillist - Zope-CMF [at] zope
https://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


y.2010 at wcm-solutions

Jul 1, 2010, 2:37 AM

Post #18 of 26 (1932 views)
Permalink
Re: Member preferences [In reply to]

Hi Tres!


Tres Seaver wrote:
>> Am 30.06.2010, 15:09 Uhr, schrieb Tres Seaver<tseaver-npLdOuuzvjyaMJb+Lgu22Q [at] public>:
>>
>>> As a general rule, I would actually prefer that we strip out the
>>> keywords currently in the code -- they are CVS-era fossils which no
>>> longer add any value in the SVN + eggs world.

Why are they "CVS-era fossils"? What special value did they add in the
CVS world?

I always thought we use the Id keyword because CVS or SVN metadata is
not always available. In tarball or egg releases that kind of metadata
is missing.

> Not only redundant to the data available in 'svn log' / 'svn info',

'svn log' and 'svn info' are not available inside released eggs.

> but
> actively harmful: keyword expansion makes merging branches / applying
> patches harder.

I guess the reason this causes problems for you is related to your
attempts to use Bazaar instead of Subversion.

I'm fine with removing the Id keywords if it makes the transition to
Bazaar easier, but I don't think this is related to the the transition
from CVS to Subversion.

> I would say that we should be removing the keywords
> themselves from source code opportunistically; I don't really care
> about the property itself.

I would prefer if you would propose that on the zope-dev list. It
doesn't make sense to remove them in CMF and to keep them in ZTK or Zope
headers. And it doesn't make sense if just a few people remove them in a
few places and other people follow the old policy.


Cheers,

Yuppie
_______________________________________________
Zope-CMF maillist - Zope-CMF [at] zope
https://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


charlie.clark at clark-consulting

Jul 1, 2010, 2:49 AM

Post #19 of 26 (1942 views)
Permalink
Re: Member preferences [In reply to]

Am 01.07.2010, 11:37 Uhr, schrieb yuppie <y.2010 [at] wcm-solutions>:

> I would prefer if you would propose that on the zope-dev list. It
> doesn't make sense to remove them in CMF and to keep them in ZTK or Zope
> headers. And it doesn't make sense if just a few people remove them in a
> few places and other people follow the old policy.

I agree that I don't remember a policy statement on this - it might be in
the coding guidelines. But it did come up in my aforementioned thread:

"""
Recently, I worked with Tres to remove the funky old "$Id$" type lines
from all the files in ZTK packages, and while touching every file in
every package, roughly, I came up with some other thoughts on how to
improve consistency, which are detailed in this launchpad bug:
"""

https://mail.zope.org/pipermail/zope-dev/2010-June/040802.html

If necessary I'll make sure this is on the agenda of next week's IRC
meeting.

Charlie
--
Charlie Clark
Managing Director
Clark Consulting & Research
German Office
Helmholtzstr. 20
Düsseldorf
D- 40215
Tel: +49-211-600-3657
Mobile: +49-178-782-6226
_______________________________________________
Zope-CMF maillist - Zope-CMF [at] zope
https://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


wichert at wiggy

Jul 1, 2010, 2:52 AM

Post #20 of 26 (1940 views)
Permalink
Re: Member preferences [In reply to]

On 7/1/10 11:37 , yuppie wrote:
> Hi Tres!
>
>
> Tres Seaver wrote:
>>> Am 30.06.2010, 15:09 Uhr, schrieb Tres Seaver<tseaver-npLdOuuzvjyaMJb+Lgu22Q [at] public>:
>>>
>>>> As a general rule, I would actually prefer that we strip out the
>>>> keywords currently in the code -- they are CVS-era fossils which no
>>>> longer add any value in the SVN + eggs world.
>
> Why are they "CVS-era fossils"? What special value did they add in the
> CVS world?
>
> I always thought we use the Id keyword because CVS or SVN metadata is
> not always available. In tarball or egg releases that kind of metadata
> is missing.

FWIW I have never felt a need for that information inside a tarball or
egg, and agree with Tres that they make generating diffs between trees
needlessly difficult.

> I would prefer if you would propose that on the zope-dev list. It
> doesn't make sense to remove them in CMF and to keep them in ZTK or Zope
> headers. And it doesn't make sense if just a few people remove them in a
> few places and other people follow the old policy.

I thought they already disappeared from most places by now. I'm can't
remember seeing them for newly added code either.

Wichert.
_______________________________________________
Zope-CMF maillist - Zope-CMF [at] zope
https://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


y.2010 at wcm-solutions

Jul 1, 2010, 5:37 AM

Post #21 of 26 (1932 views)
Permalink
Re: Member preferences [In reply to]

Hi!


Wichert Akkerman wrote:
> On 7/1/10 11:37 , yuppie wrote:
>> Why are they "CVS-era fossils"? What special value did they add in the
>> CVS world?
>>
>> I always thought we use the Id keyword because CVS or SVN metadata is
>> not always available. In tarball or egg releases that kind of metadata
>> is missing.
>
> FWIW I have never felt a need for that information inside a tarball or
> egg, and agree with Tres that they make generating diffs between trees
> needlessly difficult.

I don't want to discuss the pros and cons. I'm fine with changing the
policy. My point is that:

1.) We did have a policy to add Id keywords.

2.) The old policy is not obviously out-dated, and the term "CVS-era
fossil" doesn't make it more obvious.

3.) In a case like that a transparent decision and a clear announcement
are necessary to avoid discussions like this one and to make sure
everybody pulls in the same direction.

>> I would prefer if you would propose that on the zope-dev list. It
>> doesn't make sense to remove them in CMF and to keep them in ZTK or Zope
>> headers. And it doesn't make sense if just a few people remove them in a
>> few places and other people follow the old policy.
>
> I thought they already disappeared from most places by now.

Most Python files in Zope 2 and Zope 2 Products (e.g. GenericSetup, CMF,
PAS) use the Id keyword. But also z3c packages like z3c.form.

> I'm can't
> remember seeing them for newly added code either.

Recently there has not been added much new code in the Zope repository.
But here are two examples from the last few days:

http://svn.zope.org/Zope/trunk/src/Testing/ZopeTestCase/zopedoctest/testPackageAsProduct.py?rev=113940&view=markup

http://svn.zope.org/Products.CMFDefault/trunk/Products/CMFDefault/browser/content/tests/test_image.py?rev=113947&view=markup

And nobody who touches code and makes other cleanups seems to remove Id
keywords.


Cheers,

Yuppie
_______________________________________________
Zope-CMF maillist - Zope-CMF [at] zope
https://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


y.2010 at wcm-solutions

Jul 1, 2010, 5:42 AM

Post #22 of 26 (1936 views)
Permalink
Re: Member preferences [In reply to]

Charlie Clark wrote:
> Am 01.07.2010, 11:37 Uhr, schrieb yuppie<y.2010 [at] wcm-solutions>:
>
>> I would prefer if you would propose that on the zope-dev list. It
>> doesn't make sense to remove them in CMF and to keep them in ZTK or Zope
>> headers. And it doesn't make sense if just a few people remove them in a
>> few places and other people follow the old policy.
>
> I agree that I don't remember a policy statement on this - it might be in
> the coding guidelines. But it did come up in my aforementioned thread:

I don't think it is sufficient that it comes up in a thread like this
one. Or to check in a change like that:
http://svn.zope.org/?rev=113074&view=rev

> If necessary I'll make sure this is on the agenda of next week's IRC
> meeting.

I'm not in the mood to take responsibility for that. But it would be
great if someone else wants to make sure policy changes are better
communicated. And the IRC meeting would indeed be a good place for
making coding style decisions.

Cheers, Yuppie
_______________________________________________
Zope-CMF maillist - Zope-CMF [at] zope
https://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


charlie.clark at clark-consulting

Jul 1, 2010, 7:52 AM

Post #23 of 26 (1931 views)
Permalink
Re: Member preferences [In reply to]

Am 01.07.2010, 09:33 Uhr, schrieb yuppie <y.2010 [at] wcm-solutions>:

> And that error shows you a nice diff that tells you that the
> change_password action is added, but in the wrong position. Right? Or
> did you forget to register the upgrade step?
>
>> Do I need to tell the upgrade to do the insert before preferences?
> Yes. "environ._should_purge = False" gives you the extension profile
> behavior. By default new objects are added to the end of the container.
> If you want them in a different place, you have to specify that using an
> update directive ('insert-before' or 'insert-after').

Sorry, my ignorance is just shining through: I hadn't added the
registration in upgrade/configure.zcml
Not seeing errors for the missing imports should have given me the clue.

Now the registration is working and the upgrade is attempted but failing.
From the diff it looks like there is still an attempt to append the
definition at the end of actions.xml. So I assume I've not got
insert-after="join" in the right place.

<object name="change_password" meta_type="CMF Action"
i18n:domain="cmf_default" insert-after="join">

But even with the errors I've now learnt a bit more about the upgrade
steps necessary for the other changes we've made.

Charlie
--
Charlie Clark
Managing Director
Clark Consulting & Research
German Office
Helmholtzstr. 20
Düsseldorf
D- 40215
Tel: +49-211-600-3657
Mobile: +49-178-782-6226
_______________________________________________
Zope-CMF maillist - Zope-CMF [at] zope
https://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


tseaver at palladion

Jul 1, 2010, 8:29 AM

Post #24 of 26 (1926 views)
Permalink
Re: Member preferences [In reply to]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

yuppie wrote:
> Hi Tres!
>
>
> Tres Seaver wrote:
>>> Am 30.06.2010, 15:09 Uhr, schrieb Tres Seaver<tseaver-npLdOuuzvjyaMJb+Lgu22Q [at] public>:
>>>
>>>> As a general rule, I would actually prefer that we strip out the
>>>> keywords currently in the code -- they are CVS-era fossils which no
>>>> longer add any value in the SVN + eggs world.
>
> Why are they "CVS-era fossils"? What special value did they add in the
> CVS world?

"Back in the day", I would use those markers to figure out how badly a
previous developer had messed up their hacked-up Zope install: often,
Zope was running from an unreleased CVS snapshot from the trunk,
sometimes with local changes. I could use the Id tag for such a file to
reconstruct what they had hacked (CVS checkouts lacked enough metadata
about the individual files in the checkout to allow easy checking for
modifications).

svn checkouts actually have the original version of the file present,
and have a much more coherent story about revision history: the
checkout itself has a revision and log, rather than only individual
files as under CVS.

> I always thought we use the Id keyword because CVS or SVN metadata is
> not always available. In tarball or egg releases that kind of metadata
> is missing.

Egg releases carry the release metadata with them. In addition, in the
egg-based world, almost nobody is running a local checkout of Zope on a
production server any more.

>> Not only redundant to the data available in 'svn log' / 'svn info',
>
> 'svn log' and 'svn info' are not available inside released eggs.

But the version of the release is.

>> but
>> actively harmful: keyword expansion makes merging branches / applying
>> patches harder.
>
> I guess the reason this causes problems for you is related to your
> attempts to use Bazaar instead of Subversion.

No: I've noticed this most lately when trying to apply patches from bug
reports.

> I'm fine with removing the Id keywords if it makes the transition to
> Bazaar easier, but I don't think this is related to the the transition
> from CVS to Subversion.

I find the keywords pointless in our current development model.

>> I would say that we should be removing the keywords
>> themselves from source code opportunistically; I don't really care
>> about the property itself.
>
> I would prefer if you would propose that on the zope-dev list. It
> doesn't make sense to remove them in CMF and to keep them in ZTK or Zope
> headers. And it doesn't make sense if just a few people remove them in a
> few places and other people follow the old policy.

They are gone in the ZTK already.


Tres.
- --
===================================================================
Tres Seaver +1 540-429-0999 tseaver [at] palladion
Palladion Software "Excellence by Design" http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkwstDwACgkQ+gerLs4ltQ7UIQCgjwfuOAF3IRmq1UiEnPPk8UuU
Yr0AoM9ji+T4rqw0U2LBSbAJGDZFdz8a
=SROI
-----END PGP SIGNATURE-----

_______________________________________________
Zope-CMF maillist - Zope-CMF [at] zope
https://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


charlie.clark at clark-consulting

Jul 1, 2010, 8:37 AM

Post #25 of 26 (1923 views)
Permalink
Re: svn keywords in code, was Member preferences [In reply to]

Am 01.07.2010, 17:29 Uhr, schrieb Tres Seaver <tseaver [at] palladion>:

> They are gone in the ZTK already.

This will be on next week's zope-dev IRC meeting. I'm still arguing with
myself as to whether it wouldn't be better to open a dedicated discussion
on zope-dev. Either way will only be a show of hands of those who are
around or care. The arguments for pruning are reasonable so it's just
about making the policy well-known and applying ZTK policy to other
projects.

Despite numerous attempts I cannot get the properties set on the files I
screwed up. They exist locally and although svnmucc is supposed to allow
you set them in the repository it doesn't work for me.

Charlie
--
Charlie Clark
Managing Director
Clark Consulting & Research
German Office
Helmholtzstr. 20
Düsseldorf
D- 40215
Tel: +49-211-600-3657
Mobile: +49-178-782-6226
_______________________________________________
Zope-CMF maillist - Zope-CMF [at] zope
https://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests

First page Previous page 1 2 Next page Last page  View All Zope cmf RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.