Re: [Zope-CMF] Re: RestrictedPython, TALES Expressions and CMF

2005-10-19 Thread Dieter Maurer
Tres Seaver wrote at 2005-10-16 14:22 -0400:
> ...
>> Probably, because they can bind the DTML namespace...
>
>I knew that they *could* bind it;  it just don't understand why anyone
>would *want* that feature, given the availability of the other,
>non-ambiguous bindings.

I know that I used it intensively in the past (for a former
employer). Now, I almost dropped DTML and with it the DTML namespace
bindung of Python Scripts, although it works as well with
the ZPT namespace...

>I would argue that it is a misfeature, especially given the bug which it
>surfaces in 'render' / 'call_with_ns'.

I have seen this several times:

  When a bug comes to the surface, a feature is reclassified
  as a misfeature...

I do not need this feature (unlike other reclassified things)
but maybe, fixing the bug is also a solution?



>=nIvs
>-END PGP SIGNATURE-

-- 
Dieter
___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


Re: [Zope-CMF] Re: CMF and Five views: hooking up "POST"

2005-10-19 Thread Dieter Maurer
yuppie wrote at 2005-10-17 15:24 +0200:
> ...
>I don't think so:
>
>1.) If you start rendering the default view before the controller has 
>finished you need extra code to abort the rendering if necessary. E.g. a 
>tal:condition that wraps the whole template.
>
>2.) A cleaner separation of controller calls and view rendering makes 
>the code simpler and therefore easier to write and maintain.
>
>3.) Rendering useless views wastes resources.

"CMFFormController" does a nice job in this respect.

-- 
Dieter
___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


Re: Re[2]: [Zope-CMF] DCWorkflow + Acqusition

2005-10-19 Thread Dieter Maurer
Victor Safronovich wrote at 2005-10-17 13:10 +0600:
> ...
>By the way i think code:
>for w in wfs:
>w.notifySuccess(ob, action, res)
>if reindex:
>self._reindexWorkflowVariables(ob)
>in  _invokeWithNotification should be turn upside-down to:
>if reindex:
>self._reindexWorkflowVariables(ob)
>for w in wfs:
>w.notifySuccess(ob, action, res)
>am i right?

Why do you think so?

  I find the original order more natural (in case "notifySuccess"
  would change some workflow variables).

-- 
Dieter
___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


[Zope-CMF] Re: Five views / redirects

2005-10-19 Thread pete

tuesday_pt = ZopeTwoPageTemplateFile('tuesday.pt')

def __call__(self):
if self.isTuesday():
return self.tuesday_pt()
return self.index()


Thanks for this, it captures exactly what I wanted to do!  It also means 
that the ZCML provides a clear picture of what the view actually 
provides, rather than providing meaningless 'disabled' views that cloud 
things over a bit.


Should anyone be googling this, you can save yourself 30 minutes or so 
by doing


from Products.Five.pagetemplatefile import ZopeTwoPageTemplateFile

rather than importing anything from the PageTemplate package itself.

___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


[Zope-CMF] Re: Better DeprecationWarnings (was Re: SVN: CMF/trunk/CMFDefault/Portal.py - reverted Portal.py change of r39125 to fix BBB temporarily)

2005-10-19 Thread Florent Guillaume

Tres Seaver wrote:

Note that I have just figured out that we can make DeprecationWarnings
more useful by passing the 'stacklevel' argument to 'warnings.warn';
passing a value of 2 for that argument causes the warning to be reported
against the *caller* of the code issuing the warning, which makes it
possible to find and remove the deprecated use.


Yes, I've changed a number of those in Zope and CMF already. It's very 
useful for deprecation.


Note that I prefer passing the stacklevel=2 (or 3) argument by name to be 
explicit.


Florent

--
Florent Guillaume, Nuxeo (Paris, France)   CTO, Director of R&D
+33 1 40 33 71 59   http://nuxeo.com   [EMAIL PROTECTED]
___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


[Zope-CMF] Re: Help with Frostbite

2005-10-19 Thread sureshvv

Tres Seaver wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

robert rottermann wrote:




I would first try removing SpeedPack and redoing the Frostbite
generation.  Then, if the extracted templates in the generated file are
incorrect, you can bug me, with examples, drawn from stock Plone, which
are not being exported directly.


Got rid of SpeedPack and things have improved considerably :)

1. Got an error about "same_type" being undefined. So I had to define this
function in my __init__.py

2. Got some errors about "container" not defined. I replaced these with
"context". But not sure if I can do that everywhere.

Suresh







___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


[Zope-CMF] Re: Better DeprecationWarnings

2005-10-19 Thread yuppie

Tres Seaver wrote:

I'd like to add a DeprecationWarning in manage_addCMFSite,
which is the entry point which drives PortalGenerator.  I plan to write
it as::

 def manage_addCMFSite(self, id, title='Portal', description='',
   create_userfolder=1,
   email_from_address='[EMAIL PROTECTED]',
   email_from_name='Portal Administrator',
   validate_email=0, default_charset='',
   RESPONSE=None):
 """ Adds a portal instance.
 """
 from warnings import warn

 warn("manage_addCMFSite is a deprecated way to create a CMF site; "
  "in the "
  "future, please use CMFSetup's 'Configured CMF Site' (from "
  "the ZMI "
  "add menu) or 'CMFSetup.factory.addConfiguredSite' (from "
  "Python).  "


Well. CMFSetup.factory.addConfiguredSite itself is deprecated because on 
the trunk the factory was moved to CMFDefault.


Cheers, Yuppie

___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


Re: [Zope-CMF] Better DeprecationWarnings (was Re: SVN: CMF/trunk/CMFDefault/Portal.py - reverted Portal.py change of r39125 to fix BBB temporarily)

2005-10-19 Thread Sidnei da Silva
On Wed, Oct 19, 2005 at 09:18:12AM -0400, Tres Seaver wrote:
| -BEGIN PGP SIGNED MESSAGE-
| Hash: SHA1
| 
| Yvo Schubbe wrote:
| > Log message for revision 39508:
| >   - reverted Portal.py change of r39125 to fix BBB temporarily
| >   
| >   Note: PortalGenerator will soon be removed completely from the trunk.
| 
| 
| Sounds fine.  I'd like to add a DeprecationWarning in manage_addCMFSite,
| which is the entry point which drives PortalGenerator.  I plan to write
| it as::
| 
|  def manage_addCMFSite(self, id, title='Portal', description='',
|create_userfolder=1,
|email_from_address='[EMAIL PROTECTED]',
|email_from_name='Portal Administrator',
|validate_email=0, default_charset='',
|RESPONSE=None):
|  """ Adds a portal instance.
|  """
|  from warnings import warn
| 
|  warn("manage_addCMFSite is a deprecated way to create a CMF site; "
|   "in the "
|   "future, please use CMFSetup's 'Configured CMF Site' (from "
|   "the ZMI "
|   "add menu) or 'CMFSetup.factory.addConfiguredSite' (from "
|   "Python).  "
|  "manage_addCMFSite will be removed in CMF 2.0.",
|  DeprecationWarning, 2)
|  ...
| 
| Note that I have just figured out that we can make DeprecationWarnings
| more useful by passing the 'stacklevel' argument to 'warnings.warn';
| passing a value of 2 for that argument causes the warning to be reported
| against the *caller* of the code issuing the warning, which makes it
| possible to find and remove the deprecated use.
| 
| On another note:  we should probably avoid all attempts to muck with the
| 'warnings.filters' data structure in tests.  Getting that wrong causes
| non-local breakage.
| 
|   - Test cases which just want to suppress warnings, should use
| 'Products.CMFCore.tests.base.testcase.WarningInterceptor' as a base
| class, and call its '_trap_warning_output' / '_free_warning_output'
| methods as appropriate ('_free_warning_output' should be in
|'tearDown').
| 
|   - Test cases which actually want to check that warnings are emitted
| should examine either their own '__warningregistry__' (for
| stacklevel=2 warnings) or the '__warningregistry__' of the
| module-under-test, rather than trying to test the output stream.

As a side note, Zope 3 has a excellent way of dealing with warnings
and specially deprecation warnings that should IMHO be used in CMF.

There was also a 'WarningsHook' that has been backported to
ZopeTestCase about one year ago (!) by me.

http://svn.plone.org/svn/collective/ZopeTestCase/trunk/zopedoctest/WarningsTest.txt

-- 
Sidnei da Silva
Enfold Systems, LLC.
http://enfoldsystems.com
___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


[Zope-CMF] Better DeprecationWarnings (was Re: SVN: CMF/trunk/CMFDefault/Portal.py - reverted Portal.py change of r39125 to fix BBB temporarily)

2005-10-19 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Yvo Schubbe wrote:
> Log message for revision 39508:
>   - reverted Portal.py change of r39125 to fix BBB temporarily
>   
>   Note: PortalGenerator will soon be removed completely from the trunk.


Sounds fine.  I'd like to add a DeprecationWarning in manage_addCMFSite,
which is the entry point which drives PortalGenerator.  I plan to write
it as::

 def manage_addCMFSite(self, id, title='Portal', description='',
   create_userfolder=1,
   email_from_address='[EMAIL PROTECTED]',
   email_from_name='Portal Administrator',
   validate_email=0, default_charset='',
   RESPONSE=None):
 """ Adds a portal instance.
 """
 from warnings import warn

 warn("manage_addCMFSite is a deprecated way to create a CMF site; "
  "in the "
  "future, please use CMFSetup's 'Configured CMF Site' (from "
  "the ZMI "
  "add menu) or 'CMFSetup.factory.addConfiguredSite' (from "
  "Python).  "
 "manage_addCMFSite will be removed in CMF 2.0.",
 DeprecationWarning, 2)
 ...

Note that I have just figured out that we can make DeprecationWarnings
more useful by passing the 'stacklevel' argument to 'warnings.warn';
passing a value of 2 for that argument causes the warning to be reported
against the *caller* of the code issuing the warning, which makes it
possible to find and remove the deprecated use.

On another note:  we should probably avoid all attempts to muck with the
'warnings.filters' data structure in tests.  Getting that wrong causes
non-local breakage.

  - Test cases which just want to suppress warnings, should use
'Products.CMFCore.tests.base.testcase.WarningInterceptor' as a base
class, and call its '_trap_warning_output' / '_free_warning_output'
methods as appropriate ('_free_warning_output' should be in
   'tearDown').

  - Test cases which actually want to check that warnings are emitted
should examine either their own '__warningregistry__' (for
stacklevel=2 warnings) or the '__warningregistry__' of the
module-under-test, rather than trying to test the output stream.


Tres.
- --
===
Tres Seaver  +1 202-558-7113  [EMAIL PROTECTED]
Palladion Software   "Excellence by Design"http://palladion.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDVkeT+gerLs4ltQ4RAnoDAJ9wFMH6huX+KJblNTVEWRWEGWwxXACbBMOZ
hustAs1BdEXE927fGclWmWE=
=KlRX
-END PGP SIGNATURE-
___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


[Zope-CMF] CMF Collector: Open Issues

2005-10-19 Thread tseaver
The following supporters have open issues assigned to them in this collector
(http://www.zope.org/Collectors/CMF).

Assigned and Open


  efge

- "CMFSetup: provide non-ascii im- and exports",
  [Accepted] http://www.zope.org/Collectors/CMF/292

- "CMFSetup doesn't correctly detect DCWorkflow on export",
  [Accepted] http://www.zope.org/Collectors/CMF/298


  jens

- "FSPropertiesObject.py cannot handle multiline input for lines, text 
attributes",
  [Accepted] http://www.zope.org/Collectors/CMF/271


  mhammond

- "Windows DevelopmentMode penalty in CMFCore.DirectoryView",
  [Accepted] http://www.zope.org/Collectors/CMF/366


  mj

- "CMFSetup doesn't correctly detect DCWorkflow on export",
  [Accepted] http://www.zope.org/Collectors/CMF/298


Pending / Deferred Issues

- "CMFCalendar weekday locale issue",
  [Pending] http://www.zope.org/Collectors/CMF/237

- "Wrong cache association for FSObject",
  [Pending] http://www.zope.org/Collectors/CMF/255

- "CMFSetup: Windows exports contain CR/LF, LF and even CR newlines",
  [Pending] http://www.zope.org/Collectors/CMF/266

- "PortalCatalog.ZopeFindAndApply should probably also search in 
opaqueItems",
  [Pending] http://www.zope.org/Collectors/CMF/296

- "WorkflowTool should recurse into opaqueItems",
  [Pending] http://www.zope.org/Collectors/CMF/297

- "add External Methods to workflow script handling",
  [Pending] http://www.zope.org/Collectors/CMF/329

- "Can't invalidate skin items in a RAMCacheManager",
  [Pending] http://www.zope.org/Collectors/CMF/343

- "CMFSetup: Workflow Tool export fails with workflows which have scripts",
  [Pending] http://www.zope.org/Collectors/CMF/373

- "CMFCore.Skinnable.SkinnableObjectManager can merge skin data",
  [Pending] http://www.zope.org/Collectors/CMF/375

- "Proxy Roles does't work for a Script using portal_catalog.searchResults",
  [Pending] http://www.zope.org/Collectors/CMF/380

- "WorkflowAction deprecated warning should not printed for WorkflowMethod",
  [Pending] http://www.zope.org/Collectors/CMF/388


Pending / Deferred Features

- "Favorite.py: queries and anchors in remote_url",
  [Pending] http://www.zope.org/Collectors/CMF/26

- "Allow flexible date editing in Event.py (CMFCalendar)",
  [Pending] http://www.zope.org/Collectors/CMF/40

- "DefaultDublinCore should have Creator property",
  [Pending] http://www.zope.org/Collectors/CMF/61

- "Make changeFromProperties accept sequences too",
  [Pending] http://www.zope.org/Collectors/CMF/99

- "path criteria on Topic should honor VHM",
  [Pending] http://www.zope.org/Collectors/CMF/111

- "Document.py: universal newlines",
  [Pending] http://www.zope.org/Collectors/CMF/174

- "Permissions in PortalFolder: invokeFactory()",
  [Pending] http://www.zope.org/Collectors/CMF/175

- "Add condition for transition's action like other action",
  [Pending] http://www.zope.org/Collectors/CMF/207

- "Major action enhancement",
  [Pending] http://www.zope.org/Collectors/CMF/232

- "portal_type is undefined in initialization code",
  [Pending] http://www.zope.org/Collectors/CMF/248

- "Action._listsActions() should be more safe",
  [Pending] http://www.zope.org/Collectors/CMF/253

- "Expose Document text_format metadata",
  [Pending] http://www.zope.org/Collectors/CMF/285

- "customization of type of homefolder on creation",
  [Pending] http://www.zope.org/Collectors/CMF/288

- "Allow contentFilter to use review_state",
  [Pending] http://www.zope.org/Collectors/CMF/294

- "CMFTopic Does Not Cache",
  [Pending] http://www.zope.org/Collectors/CMF/295

- "Wishlist: a flag that tags the selected action.",
  [Pending] http://www.zope.org/Collectors/CMF/301

- "CMFDefault should make use of allowCreate()",
  [Pending] http://www.zope.org/Collectors/CMF/340

- "Nested Skins",
  [Pending] http://www.zope.org/Collectors/CMF/377

- "CatalogVariableProvider code + tests",
  [Pending] http://www.zope.org/Collectors/CMF/378

- "manage_doCustomize() : minor additions",
  [Pending] http://www.zope.org/Collectors/CMF/382



___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


[Zope-CMF] Re: [CMF-checkins] SVN: CMF/branches/1.5/C CMFSetup: added support for configuring content type registry.

2005-10-19 Thread yuppie

Hi Stefan!


Stefan H. Holek wrote:
Right, so at what point is the content-type-registry supposed to be 
added now? Plone Site creation breaks after this checkin with:


  File "/Users/zope/plonehd/Products/CMFCore/utils.py", line 83, in 
getToolByName

raise AttributeError, name
AttributeError: content_type_registry


The change that caused that error is now reverted on the 1.5 branch.

It is also temporarily reverted on the trunk to give product developers 
some more time to update the setup machinery of their products. But CMF 
2.0 will not be backwards compatible for code that depends on 
PortalGenerator because the new setup machinery is completely different.


PortalGenerator, manage_addCMFSite and oldstyle configuration data (fti 
data, workflows - actions are already removed) will soon be removed 
completely from the trunk.



Cheers,

Yuppie

___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests