[Zope-dev] Getting REQUEST from within RESPONSE?

2012-01-30 Thread lists
Hi.

I have a patch for Zope that sets expiry dates far into the future for
certain cookies.  However, I would like to know something about where the
user is, or what the user is doing.

Is there a way to get the REQUEST from within a RESPONSE method?

TIA,

Morten

___
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] how to add SOAP APIs in zope 3

2012-01-30 Thread Sanjay Rao

Hi,

If anybody can give some pointers, it would be greatly appreciated.

Thanks  Regards,
Sanjay Rao


___
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] TreeVocabulary in zope.schema.vocabulary

2012-01-30 Thread Jan-Carel Brand
On Sun, 2012-01-29 at 16:17 +0100, Charlie Clark wrote:

snip

  From the zope.schema 4.0.0 release notes:
  Port to Python 3. This adds a dependency on six and removes support for
  Python 2.5
 
 Shouldn't that also mean a preference of
 for key in _dict over for key in _dict.keys() ?
 
 Though you might prefer .items() in _getPathToTreeNode()
 
 i.e
 def _getPathToTreeNode(self, tree, node)
 
  path = []
  for parent, child in tree.items():
  if node == parent.value:
  return [node]
  path = self._getPathToTreeNode(child, node)
  if path:
  path.insert(0, parent.value)
  break
  return path

Thanks, I've taken this code from the diff file you gave.

  So if we want to use OrderedDict (which is from Python = 2.7), we just
  need to bridge the Python 2.6 version with the ordereddict package:
  http://pypi.python.org/pypi/ordereddict/1.1
  This would introduce a new dependency for zope.schema on Python 2.6, I
  don't know if that's acceptable or not.
 
 I think it's perfectly justified in this case and similar to what has  
 happened with other libraries like ElementTree in the past that have made  
 life easier and subsequently been adopted by the standard library.

Marius and Souheil, what do you think about this? I think it probably
still makes sense to have a dict_factory as Souheil suggested, but then
we make the default type OrderedDict and not dict.

Any objections?

  In setup.py one could specify the extra dependency only for Python 
  2.7:
 
  import sys
 
  REQUIRES = ['setuptools',
 'zope.interface = 3.6.0',
 'zope.event',
 'six',
]
 
  if sys.version_info  (2 , 7):
  REQUIRES += ['ordereddict'],
 
  setup(
  # [...]
  install_requires=REQUIRES,
  # [...]
 
 Yep.

snip

  I however don't see how one could use a generator for the recursive
  methods that return dictionaries.
  With regards to the recurse method (now called _getPathToTreeNode), I
  don't see how one could use a generator in a more efficient manner than
  the normal recursion that's being used currently.
  I played around with it and the best I could come up with is this:
 def generator(_dict, value, path=[]):
  if value in _dict.keys():
  yield path+[value]
 for key in _dict.keys():
  for path in recurse(_dict[key], value, path+[key]):
  if value in path:
  yield path
  You still have to recurse through the different branches until you find
  the node that you are looking for and you still need to store the path
  in a list. So what would be the added value?
  What's more, the generator returns a list within a list, like so:
  [['Regions', 'Germany', 'Bavaria']], which I find clunky.
 
 You're probably right. I think I was getting ahead of myself wondering  
 about possible issues with deeply nested vocabularies. 

 Any real improvement would probably involve a node index. 
 I notice that the examples do not allow for departments in regions to have 
 the same name as  
 the region (common enough in some countries) so you could simply add the  
 index keyed by node value with the path as the value when the class is  
 created. 

Yes, the values must be unique, because we do value lookups. 

The title attr doesn't have to be unique though. You could have a
Forestry department for two different regions. The title will be the
same, but the value and token attrs can't.

 This should be possible by calling _getPathToTreeNode during one  
 of the passes through _flattenTree. getTermPath would then just need to do  
 a lookup on this.

I don't like the way the path_node gets implicitly populated during a
call to _flattenTree. 

I'd rather have a separate method that calculates the path and then
explicitly assign it to self.path_node.

In any case, there is now a node_index in the code :)

snip

  but I don't see the advantage of
  cls.createTerm(*args) over SimpleTerm(*args)
  See above. createTerm is there to let developers override it and
  provide their own term objects.
 
 Do you have a concrete use case for this? 

Not really, but that doesn't mean it doesn't exist.

 Remember that createTerm is a  
 convenience method only. Frankly, I don't see the need for it in what is a  
 fairly specialised class.

I like consistency and symmetry, so if SimpleVocabulary has it, as an
add-on developer I'd expect for TreeVocabulary to also have it.

I don't however feel very strongly about it though, and I wanna get this
done, so I removed it.

J-C

___
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] how to add SOAP APIs in zope 3

2012-01-30 Thread Jim Fulton
On Mon, Jan 30, 2012 at 6:26 AM, Sanjay Rao
s...@noida.interrasystems.com wrote:
...
 If anybody can give some pointers, it would be greatly appreciated.

I recommend using an established SOAP server.  You should be able to
use application code that works with Zope3/ZTK/whatever with any server
framework. If not, then you have another problem. :)

Jim

-- 
Jim Fulton
http://www.linkedin.com/in/jimfulton
___
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] TreeVocabulary in zope.schema.vocabulary

2012-01-30 Thread Jan-Carel Brand
On Fri, 2012-01-27 at 11:50 +0100, Souheil CHELFOUH wrote:
 Yes, Marius got exactly what I meant, this is how I usually make the
 not-so-pluggable stuff pluggable :)
 About the fact to release it out of zope.schema, it's also to be able
 to make it live a bit and prove itself.
 Then, including it and changing the API can be easily justified. I'm
 not afraid of the changes in zope.schema.
 z3c.form is not the only form option, I'll probably use it in
 dolmen.forms that came from zeam.form.
 So, whatever you decide, we'll try to make it easy for you to contribute.
 It tends to get to complicated to do anything in zope, lately :)

Ok, I've implemented the idea of the dict_factory, making sure to
implement all the methods required by IEnumerableMapping and
IReadMapping. All tests pass and it works in my specific end use-case.

However, since we can use the OrderedDict type in Python  2.7 by means
of the ordereddict package, what do you think of making that the default
dict type and adding an 'ordereddict' dependency for older Python
versions? (Please see Charlie and my discussion about it.)

If we still use the concept of a dict_factory, it wouldn't make sense to
implement the OrderedDict specific methods like popItem, but the
keys method would be ordered, which I think would be enough.


J-C



___
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] TreeVocabulary in zope.schema.vocabulary

2012-01-30 Thread Charlie Clark

Hiya,


Am 30.01.2012, 14:33 Uhr, schrieb Jan-Carel Brand li...@opkode.com:

... lots cut ...


Yes, the values must be unique, because we do value lookups.
The title attr doesn't have to be unique though. You could have a
Forestry department for two different regions. The title will be the
same, but the value and token attrs can't.


I think the tests should be extended to show that this also includes  
nesting because this is non-obvious. ie. I believe that the region Izmir  
is within the state of Izimir in Turkey.



This should be possible by calling _getPathToTreeNode during one
of the passes through _flattenTree. getTermPath would then just need to  
do

a lookup on this.



I don't like the way the path_node gets implicitly populated during a
call to _flattenTree.


hm, okay. Personally, I think you should be able to populate your  
dictionaries with only a single pass through the terms. However, as this  
only needs to happen when the application starts we don't need to worry  
too much about the performance.



I'd rather have a separate method that calculates the path and then
explicitly assign it to self.path_node.
In any case, there is now a node_index in the code
snip


 but I don't see the advantage of
 cls.createTerm(*args) over SimpleTerm(*args)
 See above. createTerm is there to let developers override it and
 provide their own term objects.

Do you have a concrete use case for this?

Not really, but that doesn't mean it doesn't exist.


Then someone will speak up for it if they need it or do their own  
subclassing/composition as required. Otherwise it's just food for warts.



Remember that createTerm is a
convenience method only. Frankly, I don't see the need for it in what  
is a

fairly specialised class.



I like consistency and symmetry, so if SimpleVocabulary has it, as an
add-on developer I'd expect for TreeVocabulary to also have it.
I don't however feel very strongly about it though, and I wanna get this
done, so I removed it.


Well, we could always think about removing it from SimpleVocabulary: it's  
not in the interface so no subclass actually has the right to depend on  
it. ;-)


Charlie
--
Charlie Clark
Managing Director
Clark Consulting  Research
German Office
Kronenstr. 27a
Düsseldorf
D- 40217
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] TreeVocabulary in zope.schema.vocabulary

2012-01-30 Thread Souheil CHELFOUH
Snip snip

 Marius and Souheil, what do you think about this? I think it probably
 still makes sense to have a dict_factory as Souheil suggested, but then
 we make the default type OrderedDict and not dict.


This sounds perfectly reasonnable.

 Any objections?

Not really
___
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 - FAILED: 27, OK: 40

2012-01-30 Thread Zope tests summarizer
This is the summary for test reports received on the 
zope-tests list between 2012-01-29 00:00:00 UTC and 2012-01-30 00:00:00 UTC:

See the footnotes for test reports of unsuccessful builds.

An up-to date view of the builders is also available in our 
buildbot documentation: 
http://docs.zope.org/zopetoolkit/process/buildbots.html#the-nightly-builds

Reports received


[1]ZTK 1.0 / Python2.4.6 Linux 64bit
[2]ZTK 1.0 / Python2.5.5 Linux 64bit
   ZTK 1.0 / Python2.6.7 Linux 64bit
[3]ZTK 1.0dev / Python2.4.6 Linux 64bit
[4]ZTK 1.0dev / Python2.5.5 Linux 64bit
   ZTK 1.0dev / Python2.6.7 Linux 64bit
[5]ZTK 1.1 / Python2.5.5 Linux 64bit
   ZTK 1.1 / Python2.6.7 Linux 64bit
   ZTK 1.1 / Python2.7.2 Linux 64bit
[6]ZTK 1.1dev / Python2.5.5 Linux 64bit
   ZTK 1.1dev / Python2.6.7 Linux 64bit
   ZTK 1.1dev / Python2.7.2 Linux 64bit
   Zope 3.4 KGS / Python2.4.6 64bit linux
   Zope 3.4 KGS / Python2.5.5 64bit linux
   Zope 3.4 Known Good Set / py2.4-32bit-linux
   Zope 3.4 Known Good Set / py2.4-64bit-linux
   Zope 3.4 Known Good Set / py2.5-32bit-linux
   Zope 3.4 Known Good Set / py2.5-64bit-linux
   Zope Buildbot / zope2.12-py2.6 slave-ubuntu32
   Zope Buildbot / zope2.12-py2.6 slave-ubuntu64
   Zope Buildbot / zope2.13-py2.6 slave-ubuntu32
   Zope Buildbot / zope2.13-py2.6 slave-ubuntu64
   Zope Buildbot / zope2.13-py2.7 slave-ubuntu32
   Zope Buildbot / zope2.13-py2.7 slave-ubuntu64
   Zope Buildbot / zope2.14-py2.6 slave-ubuntu32
   Zope Buildbot / zope2.14-py2.6 slave-ubuntu64
   Zope Buildbot / zope2.14-py2.7 slave-ubuntu32
   Zope Buildbot / zope2.14-py2.7 slave-ubuntu64
[7]Zope Buildbot / zopetoolkit-1.0-py2.4 slave-ubuntu32
[8]Zope Buildbot / zopetoolkit-1.0-py2.4 slave-ubuntu64
[9]Zope Buildbot / zopetoolkit-1.0-py2.5 slave-ubuntu32
[10]   Zope Buildbot / zopetoolkit-1.0-py2.5 slave-ubuntu64
[11]   Zope Buildbot / zopetoolkit-1.0-py2.6 slave-ubuntu32
[12]   Zope Buildbot / zopetoolkit-1.0-py2.6 slave-ubuntu64
[13]   Zope Buildbot / zopetoolkit-1.1-py2.5 slave-ubuntu32
[14]   Zope Buildbot / zopetoolkit-1.1-py2.5 slave-ubuntu64
[15]   Zope Buildbot / zopetoolkit-1.1-py2.6 slave-ubuntu32
[16]   Zope Buildbot / zopetoolkit-1.1-py2.6 slave-ubuntu64
[17]   Zope Buildbot / zopetoolkit-py2.5 slave-ubuntu32
[18]   Zope Buildbot / zopetoolkit-py2.5 slave-ubuntu64
[19]   Zope Buildbot / zopetoolkit-py2.6 slave-ubuntu32
[20]   Zope Buildbot / zopetoolkit-py2.6 slave-ubuntu64
   Zope-2.10 Python-2.4.6 : Linux
   Zope-2.11 Python-2.4.6 : Linux
   Zope-2.12 Python-2.6.6 : Linux
   Zope-2.12-alltests Python-2.6.6 : Linux
   Zope-2.13 Python-2.6.6 : Linux
   Zope-2.13-alltests Python-2.6.6 : Linux
   Zope-trunk Python-2.6.6 : Linux
   Zope-trunk-alltests Python-2.6.6 : Linux
   winbot / ZODB_dev py_265_win32
   winbot / ZODB_dev py_265_win64
   winbot / ZODB_dev py_270_win32
   winbot / ZODB_dev py_270_win64
[21]   winbot / zope.testing_py_265_32
[22]   winbot / ztk_10 py_254_win32
   winbot / ztk_10 py_265_win32
   winbot / ztk_10 py_265_win64
[23]   winbot / ztk_11 py_254_win32
   winbot / ztk_11 py_265_win32
   winbot / ztk_11 py_265_win64
   winbot / ztk_11 py_270_win32
   winbot / ztk_11 py_270_win64
[24]   winbot / ztk_dev py_265_win32
[25]   winbot / ztk_dev py_265_win64
[26]   winbot / ztk_dev py_270_win32
[27]   winbot / ztk_dev py_270_win64

Non-OK results
--

[1]FAILED  ZTK 1.0 / Python2.4.6 Linux 64bit
   https://mail.zope.org/pipermail/zope-tests/2012-January/057076.html


[2]FAILED  ZTK 1.0 / Python2.5.5 Linux 64bit
   https://mail.zope.org/pipermail/zope-tests/2012-January/057078.html


[3]FAILED  ZTK 1.0dev / Python2.4.6 Linux 64bit
   https://mail.zope.org/pipermail/zope-tests/2012-January/057087.html


[4]FAILED  ZTK 1.0dev / Python2.5.5 Linux 64bit
   https://mail.zope.org/pipermail/zope-tests/2012-January/057089.html


[5]FAILED  ZTK 1.1 / Python2.5.5 Linux 64bit
   https://mail.zope.org/pipermail/zope-tests/2012-January/057074.html


[6]FAILED  ZTK 1.1dev / Python2.5.5 Linux 64bit
   https://mail.zope.org/pipermail/zope-tests/2012-January/057085.html


[7]FAILED  Zope Buildbot / zopetoolkit-1.0-py2.4 slave-ubuntu32
   https://mail.zope.org/pipermail/zope-tests/2012-January/057106.html


[8]FAILED  Zope Buildbot / zopetoolkit-1.0-py2.4 slave-ubuntu64
   https://mail.zope.org/pipermail/zope-tests/2012-January/057096.html


[9]FAILED  Zope Buildbot / zopetoolkit-1.0-py2.5 slave-ubuntu32
   https://mail.zope.org/pipermail/zope-tests/2012-January/057108.html


[10]   FAILED  Zope Buildbot / zopetoolkit-1.0-py2.5 slave-ubuntu64
   https://mail.zope.org/pipermail/zope-tests/2012-January/057098.html


[11]   FAILED  Zope Buildbot / zopetoolkit-1.0-py2.6 slave-ubuntu32
   

Re: [Zope-dev] [Checkins] SVN: z3c.form/trunk/setup.py Get ready for 2.6.1 release.

2012-01-30 Thread Adam GROSZER

Hello,

I think we need to automate sdist upload, the .mo files are missing 
from the release.


Any ideas other than patching setup.py to create the .mo files 
automatically?


On Mon, 30 Jan 2012 23:03:08 -0500 (EST) you wrote:


Log message for revision 124260:
   Get ready for 2.6.1 release.



--
Best regards,
 Adam GROSZER
--
Quote of the day:
A man forgives only when he is in the wrong.
___
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] [Checkins] SVN: z3c.form/trunk/setup.py Get ready for 2.6.1 release.

2012-01-30 Thread David Glick

On 1/30/12 11:15 PM, Adam GROSZER wrote:

Hello,

I think we need to automate sdist upload, the .mo files are missing
from the release.

Any ideas other than patching setup.py to create the .mo files
automatically?


See zest.releaser [1] and its plugin zest.pocompile [2]

[1] http://pypi.python.org/pypi/zest.releaser
[2] http://pypi.python.org/pypi/zest.pocompile

David


--  
David Glick
Web Developer
davidgl...@groundwire.org
206.286.1235x32

Engagement technology for social and environmental change.

http://www.groundwire.org


___
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 )