Re: [Repoze-dev] [ZODB-Dev] Problem with handling of data managers that join transactions after savepoints

2010-05-11 Thread Chris Withers
Jim Fulton wrote:
>>> I plan to implement A soon if there are no objections.
>>>
>>> Unless someone somehow convinced me to do D, I'll also add an
>>> assertion in the Transaction.join method to raise an error if a
>>> data manager joins more than once.
>> Option A sounds sensible. It also means I won't have to change
>> anything in the zope.sqlalchemy data manager.
> 
> Very cool. I was hoping non-ZODB-data-manager authors
> were paying attention. :)
> 
> If anyone knows of any other, I would appreciate someone forwarding
> this thread to them.

zope.sendmail and MaildropHost have data managers.
I've seen some file-based things that was a data manager and a few 
others in people's BFG stacks, maybe they can pipe up and/or let the 
others of those wsgi components know.

I'm also likely about to write one, but I'm dumb, so can't comment 
meaningfully on the options ;-)

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
 - http://www.simplistix.co.uk

___
Repoze-dev mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev


[Repoze-dev] [issue145] repoze.who.classifiers - too strict content-type handling

2010-05-11 Thread Chris McDonough

Chris McDonough  added the comment:

Thanks Lorenzo!  Your patch is applied to the trunk and will be present in the 
next 
2.X release.

--
status: unread -> resolved

__
Repoze Bugs 

__
___
Repoze-dev mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev


[Repoze-dev] [issue145] repoze.who.classifiers - too strict content-type handling

2010-05-11 Thread Lorenzo M. Catucci

New submission from Lorenzo M. Catucci :

Please find enclosed a small patch that helps coping with xml submissions
with an explicit charset defined.

While at it, I corrected the handling of type and subtype, which, according to
RFC 2045, must be matched case-insensitively.

For better long-term documentation, I added two test-cases, instead of
shoe-horning  in test_classify_xmlpost the test for both fixes.

As usual... The fix is really small, but if needed, I waive any copyright etc.

--
assignedto: chrism
files: content-type-parameters.diff
messages: 405
nosy: catucci, chrism
priority: bug
status: unread
title: repoze.who.classifiers - too strict content-type handling

__
Repoze Bugs 

__diff --git a/repoze/who/classifiers.py b/repoze/who/classifiers.py
--- a/repoze/who/classifiers.py
+++ b/repoze/who/classifiers.py
@@ -44,7 +44,7 @@
 if useragent.find(agent) != -1:
 return 'dav'
 if request_method == 'POST':
-if CONTENT_TYPE(environ) == 'text/xml':
+if CONTENT_TYPE(environ).lower().startswith('text/xml'):
 return 'xmlpost'
 return 'browser'
 zope.interface.directlyProvides(default_request_classifier, IRequestClassifier)
diff --git a/repoze/who/tests/test_classifiers.py b/repoze/who/tests/test_classifiers.py
--- a/repoze/who/tests/test_classifiers.py
+++ b/repoze/who/tests/test_classifiers.py
@@ -32,6 +32,24 @@
 result = classifier(environ)
 self.assertEqual(result, 'xmlpost')
 
+def test_classify_xmlpost_uppercase(self):
+"""RFC 2045, Sec. 5.1: The type, subtype, and parameter names
+   are not case sensitive"""
+classifier = self._getFUT()
+environ = self._makeEnviron({'CONTENT_TYPE':'TEXT/XML',
+ 'REQUEST_METHOD':'POST'})
+result = classifier(environ)
+self.assertEqual(result, 'xmlpost')
+
+def test_classify_rich_xmlpost(self):
+"""RFC 2046, sec. 4.1.2: A critical parameter that may be specified
+   in the Content-Type field for "text/plain" data is the character set.""" 
+classifier = self._getFUT()
+environ = self._makeEnviron({'CONTENT_TYPE':'text/xml; charset=UTF-8 (some comment)',
+ 'REQUEST_METHOD':'POST'})
+result = classifier(environ)
+self.assertEqual(result, 'xmlpost')
+
 def test_classify_browser(self):
 classifier = self._getFUT()
 environ = self._makeEnviron({'CONTENT_TYPE':'text/xml',
___
Repoze-dev mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev


[Repoze-dev] making chameleon.genshi a first-class option for template rendering

2010-05-11 Thread Chris Withers
Hi All,

I mistakenly thought that genshi was a "first class" option as a 
templating language for BFG.

Chris disuaded me of that belief, but I'd like to know what needs to be 
written for Genshi to be settable as the "default template language" for 
a BFG app.

What components need to be written?
How would I set them as "default"?

(yes, I am volunteering to do the work...)

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
 - http://www.simplistix.co.uk
___
Repoze-dev mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev