Re: [Zope-dev] Zope2 ZMI and HTML5

2010-02-04 Thread Christian Theune
On 02/04/2010 10:35 PM, Alex Clark wrote:
> On 2010-02-04, Charlie Clark  wrote:
>> Am 04.02.2010, 13:13 Uhr, schrieb Tres Seaver :
>>
>>> I think perhaps Robert meant to say that Zope2 would[ no longer use DTML
>>> for any part of the ZMI, rather than removing the code which allows
>>> users applications to use DTML.
>>
>> This is something I would like to contribute to as it matches my skillset  
>> and interests pretty well. From the responses so far it seems that most  
>> people are so used to the ZMI that no change feels necessary and, let's  
>> face it, it works well enough. However, for new people coming to Zope the  
>> 1990nish of it is a bit off-putting: we've got all this cool technology  
>> underneath but you wouldn't believe it when you look at it. And I don't  
>> think much is required beyond dropping frames, the table-based layout  
>> using PageTemplates rather than DTML. I have an open ticket on much the  
>> same for CMFDefault which is where I will start from (from the point of  
>> view of separating markup from layout). But my work rate isn't brilliant  
>> so it would be good to have a sparring partner or two.
> 
> +1, "works fine as is" or "will be dead before long" are not the best
> approaches IMO, factoring out the ZMI functionality in to something
> that folks can maintain and contribute to in the future if they want
> to, is.

Right. It does work as it is and as always we need to pay attention to
keep things working.

One chance I also see where improvements could happen is that packages
might be able to provide UI components that get re-used within the
various frameworks. Just a quick thought from my side, though.

Christian

-- 
Christian Theune · c...@gocept.com
gocept gmbh & co. kg · forsterstraße 29 · 06112 halle (saale) · germany
http://gocept.com · tel +49 345 1229889 0 · fax +49 345 1229889 1
Zope and Plone consulting and development
___
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] ZODB issue

2010-02-04 Thread Roger
Hi Jim,

I've got an error with the latest ZODB3 trunk:

Traceback (most recent call last):
  File "D:\XPortal\trunk\bin\app-script.py", line 171, in 
]+sys.argv[1:])
  File
"d:\home\.buildout\eggs\pastescript-1.7.3-py2.5.egg\paste\script\command.py"
, line 84, in run
invoke(command, command_name, options, args[1:])
  File
"d:\home\.buildout\eggs\pastescript-1.7.3-py2.5.egg\paste\script\command.py"
, line 123, in invoke
exit_code = runner.run(args)
  File
"d:\home\.buildout\eggs\pastescript-1.7.3-py2.5.egg\paste\script\command.py"
, line 218, in run
result = self.command()
  File
"d:\home\.buildout\eggs\pastescript-1.7.3-py2.5.egg\paste\script\serve.py",
line 276, in command
relative_to=base, global_conf=vars)
  File
"d:\home\.buildout\eggs\pastescript-1.7.3-py2.5.egg\paste\script\serve.py",
line 313, in loadapp
**kw)
  File
"d:\home\.buildout\eggs\pastedeploy-1.3.3-py2.5.egg\paste\deploy\loadwsgi.py
", line 204, in loadapp
return loadobj(APP, uri, name=name, **kw)
  File
"d:\home\.buildout\eggs\pastedeploy-1.3.3-py2.5.egg\paste\deploy\loadwsgi.py
", line 225, in loadobj
return context.create()
  File
"d:\home\.buildout\eggs\pastedeploy-1.3.3-py2.5.egg\paste\deploy\loadwsgi.py
", line 625, in create
return self.object_type.invoke(self)
  File
"d:\home\.buildout\eggs\pastedeploy-1.3.3-py2.5.egg\paste\deploy\loadwsgi.py
", line 177, in invoke
next_app = context.next_context.create()
  File
"d:\home\.buildout\eggs\pastedeploy-1.3.3-py2.5.egg\paste\deploy\loadwsgi.py
", line 625, in create
return self.object_type.invoke(self)
  File
"d:\home\.buildout\eggs\pastedeploy-1.3.3-py2.5.egg\paste\deploy\loadwsgi.py
", line 110, in invoke
return fix_call(context.object, context.global_conf,
**context.local_conf)
  File
"d:\home\.buildout\eggs\pastedeploy-1.3.3-py2.5.egg\paste\deploy\util\fixtyp
eerror.py", line 57, in fix_call
val = callable(*args, **kw)
  File "d:\dev\trunk\externals\xpo\src\xpo\wsgi\__init__.py", line 36, in
application_factory
APPLICATION = zope.app.wsgi.getWSGIApplication(configfile, schemafile)
  File "d:\dev\trunk\externals\zope.app.wsgi\src\zope\app\wsgi\__init__.py",
line 158, in getWSGIApplication
db = config(configfile, schemafile, features)
  File "d:\dev\trunk\externals\zope.app.wsgi\src\zope\app\wsgi\__init__.py",
line 150, in config
db = appsetup.multi_database(options.databases)[0][0]
  File
"d:\dev\trunk\externals\zope.app.appsetup\src\zope\app\appsetup\appsetup.py"
, line 213, in multi_database
db = factory.open()
  File "d:\dev\trunk\externals\zodb3\src\ZODB\config.py", line 101, in open
storage = section.storage.open()
  File "d:\dev\trunk\externals\zodb3\src\ZODB\config.py", line 169, in open
return FileStorage(config.path, **options)
  File "d:\dev\trunk\externals\zodb3\src\ZODB\FileStorage\FileStorage.py",
line 188, in __init__
self._save_index()
  File "d:\dev\trunk\externals\zodb3\src\ZODB\FileStorage\FileStorage.py",
line 249, in _save_index
self._index.save(self._pos, tmp_name)
  File "d:\dev\trunk\externals\zodb3\src\ZODB\fsIndex.py", line 104, in save
pickler.dump((k, v.toString()))
AttributeError: 'BTrees.fsBTree.fsBucket' object has no attribute 'toString'


I just started an custom instance using an empty ZODB and added some
objects,
after that I coudn't restart zope.

Switching to the latest released ZODB3 package solved the problem
for now. The existing ZODB works well with the latest release.
Don't worry this is just a development trunk I don't need help.

But probably this is a problem and should't get released as is.
Any hints?


Regards
Roger Ineichen
_
END OF MESSAGE

___
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] Zope2 ZMI and HTML5

2010-02-04 Thread Alex Clark
On 2010-02-04, Charlie Clark  wrote:
> Am 04.02.2010, 13:13 Uhr, schrieb Tres Seaver :
>
>> I think perhaps Robert meant to say that Zope2 would[ no longer use DTML
>> for any part of the ZMI, rather than removing the code which allows
>> users applications to use DTML.
>
> This is something I would like to contribute to as it matches my skillset  
> and interests pretty well. From the responses so far it seems that most  
> people are so used to the ZMI that no change feels necessary and, let's  
> face it, it works well enough. However, for new people coming to Zope the  
> 1990nish of it is a bit off-putting: we've got all this cool technology  
> underneath but you wouldn't believe it when you look at it. And I don't  
> think much is required beyond dropping frames, the table-based layout  
> using PageTemplates rather than DTML. I have an open ticket on much the  
> same for CMFDefault which is where I will start from (from the point of  
> view of separating markup from layout). But my work rate isn't brilliant  
> so it would be good to have a sparring partner or two.

+1, "works fine as is" or "will be dead before long" are not the best
approaches IMO, factoring out the ZMI functionality in to something
that folks can maintain and contribute to in the future if they want
to, is.

> Charlie


-- 
Alex Clark · http://aclark.net
Practical Plone 3 · http://tinyurl.com/practical-plone

___
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] Zope2 ZMI and HTML5

2010-02-04 Thread Charlie Clark
Am 04.02.2010, 13:13 Uhr, schrieb Tres Seaver :

> I think perhaps Robert meant to say that Zope2 would[ no longer use DTML
> for any part of the ZMI, rather than removing the code which allows
> users applications to use DTML.

This is something I would like to contribute to as it matches my skillset  
and interests pretty well. From the responses so far it seems that most  
people are so used to the ZMI that no change feels necessary and, let's  
face it, it works well enough. However, for new people coming to Zope the  
1990nish of it is a bit off-putting: we've got all this cool technology  
underneath but you wouldn't believe it when you look at it. And I don't  
think much is required beyond dropping frames, the table-based layout  
using PageTemplates rather than DTML. I have an open ticket on much the  
same for CMFDefault which is where I will start from (from the point of  
view of separating markup from layout). But my work rate isn't brilliant  
so it would be good to have a sparring partner or two.

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-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] Zope2 ZMI and HTML5

2010-02-04 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Yusei TAHARA wrote:

> On Thu, 04 Feb 2010 00:59:52 -0300
> Roberto Allende  wrote:
> (snip)
>> Probably at this point of the conversation is the right moment to ask if 
>> it would make sense to improve Zope2's ZMI, removing frames and perhaps 
>> DTML code and probably removing all the dtml from zope2.
> 
> I'd say that removing all the dtml from zope2 is too much. I know that
> there are many web sites which have used dtml for a long time. And also
> dtml works quite well without any serious problems.

I think perhaps Robert meant to say that Zope2 would[ no longer use DTML
for any part of the ZMI, rather than removing the code which allows
users applications to use DTML.

I would favor the first alternative (but likely wouldn't put any effort
into it).  I would be opposed to ripping out DTML support for
applications, however.


Tres.
- --
===
Tres Seaver  +1 540-429-0999  tsea...@palladion.com
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

iEYEARECAAYFAktqugEACgkQ+gerLs4ltQ4qZwCcD7y442HqSCg9fbiN8ElDbyv2
9nsAnj2NhZMBbp/uIp4rwzXxAGoIT3sz
=oS8z
-END PGP 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 )


[Zope-dev] Zope Tests: 6 OK

2010-02-04 Thread Zope Tests Summarizer
Summary of messages to the zope-tests list.
Period Wed Feb  3 12:00:00 2010 UTC to Thu Feb  4 12:00:00 2010 UTC.
There were 6 messages: 6 from Zope Tests.


Tests passed OK
---

Subject: OK : Zope-2.10 Python-2.4.6 : Linux
From: Zope Tests
Date: Wed Feb  3 20:36:55 EST 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-February/013503.html

Subject: OK : Zope-2.11 Python-2.4.6 : Linux
From: Zope Tests
Date: Wed Feb  3 20:38:55 EST 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-February/013504.html

Subject: OK : Zope-2.12 Python-2.6.4 : Linux
From: Zope Tests
Date: Wed Feb  3 20:40:56 EST 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-February/013505.html

Subject: OK : Zope-2.12-alltests Python-2.6.4 : Linux
From: Zope Tests
Date: Wed Feb  3 20:42:56 EST 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-February/013506.html

Subject: OK : Zope-trunk Python-2.6.4 : Linux
From: Zope Tests
Date: Wed Feb  3 20:44:56 EST 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-February/013507.html

Subject: OK : Zope-trunk-alltests Python-2.6.4 : Linux
From: Zope Tests
Date: Wed Feb  3 20:46:56 EST 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-February/013508.html

___
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] z3c.password and "failedAttempts" andSessionCredentialsPlugin

2010-02-04 Thread Jan-Wijbrand Kolman
Hi Adam,

Adam GROSZER  wrote:
> We're using it too...
> Go for 0.8.0.

I noticed that requesting for, for example, a resource could still trigger
account locked errors, where in my opinion only the login attempts
themselves should do that.

I created a branch...

  http://svn.zope.org/z3c.password/branches/jw-noraise-for-irrelevant-requests/

..that will check for request relevancy as early as possible.

All tests pass without modification, but still, after an account has been 
locked 
requests for, for example resources, will still work (the diff against the 
trunk 
is pasted below). Additionally I think the code is tad more readable now.

I realize now that I should add a test to demonstrate this.

Anyway, could you tell me what you think of this approach?

regards, jw




--- z3c.password-trunk/src/z3c/password/principal.py
2010-02-04 12:15:46.632785192 +0100
+++ z3c.password/src/z3c/password/principal.py  2010-02-04 12:08:56.351805021 
+0100
@@ -13,7 +13,7 @@
 ##
 """Principal MixIn for Advanced Password Management
 
-$Id: principal.py 108644 2010-01-29 17:28:55Z adamg $
+$Id: principal.py 108749 2010-02-04 11:08:55Z janwijbrand $
 """
 __docformat__ = "reStructuredText"
 import datetime
@@ -81,6 +81,30 @@
 #hook to facilitate testing and easier override
 return datetime.datetime.now()
 
+def _isIrrelevantRequest(self, RELEVANT=False, IRRELEVANT=True):
+fac = self._failedAttemptCheck()
+if fac is None:
+return RELEVANT
+
+if fac == interfaces.TML_CHECK_ALL:
+return RELEVANT
+
+interaction = getInteraction()
+try:
+request = interaction.participations[0]
+except IndexError:
+return RELEVANT # no request, we regard that as relevant.
+
+if fac == interfaces.TML_CHECK_NONRESOURCE:
+if '/@@/' in request.getURL():
+return IRRELEVANT
+return RELEVANT
+
+if fac == interfaces.TML_CHECK_POSTONLY:
+if request.method == 'POST':
+return RELEVANT
+return IRRELEVANT
+
 def checkPassword(self, pwd, ignoreExpiration=False, ignoreFailures=False):
 # keep this as fast as possible, because it will be called (usually)
 # for EACH request
@@ -88,6 +112,11 @@
 # Check the password
 same = super(PrincipalMixIn, self).checkPassword(pwd)
 
+# Do not try to record failed attempts or raise account locked
+# errors for requests that are irrelevant in this regard.
+if self._isIrrelevantRequest():
+return same
+
 if not ignoreFailures and self.lastFailedAttempt is not None:
 if self.tooManyLoginFailures():
 locked = self.accountLocked()
@@ -118,7 +147,9 @@
 add = 0
 else:
 #failed attempt, record it, increase counter
-add = self.checkFailedAttempt()
+self.failedAttempts += 1
+self.lastFailedAttempt = self.now()
+add = 1
 
 # If the maximum amount of failures has been reached notify the
 # system by raising an error.
@@ -133,45 +164,6 @@
 
 return same
 
-def _getRequest(self):
-interaction = getInteraction()
-try:
-return interaction.participations[0]
-except IndexError:
-return None
-
-def checkFailedAttempt(self):
-#failed attempt, record it, increase counter (in case we have to)
-validRequest = True
-fac = self._failedAttemptCheck()
-if fac == interfaces.TML_CHECK_ALL:
-validRequest = True
-else:
-request = self._getRequest()
-if request is None:
-validRequest = True
-else:
-if fac == interfaces.TML_CHECK_NONRESOURCE:
-url = request.getURL()
-if '/@@/' in url:
-#this is a resource
-validRequest = False
-else:
-validRequest = True
-elif fac == interfaces.TML_CHECK_POSTONLY:
-if request.method == 'POST':
-#this is a POST request
-validRequest = True
-else:
-validRequest = False
-
-if validRequest:
-self.failedAttempts += 1
-self.lastFailedAttempt = self.now()
-return 1
-else:
-return 0
-



___
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] Zope2 ZMI and HTML5

2010-02-04 Thread Lennart Regebro
On Thu, Feb 4, 2010 at 04:59, Roberto Allende  wrote:
> Probably at this point of the conversation is the right moment to ask if
> it would make sense to improve Zope2's ZMI, removing frames and perhaps
> DTML code and probably removing all the dtml from zope2.

I think it works just fine as it is.

-- 
Lennart Regebro: Python, Zope, Plone, Grok
http://regebro.wordpress.com/
+33 661 58 14 64
___
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 )