[Zope-Annce] Get paid for spending your summer improving Zope!

2007-03-15 Thread Philipp von Weitershausen
The Zope Foundation has been accepted as a mentoring organization in 
this year's Google Summer of Code project. That means chosen students 
who want to hack on one of the Zope projects (Zope 2, Zope 3, ZODB, CMF, 
grok, ...) this coming summer will get paid USD 4,500 if they 
successfully complete a project.



What can you work on?
-
See project suggestions at http://wiki.zope.org/zope3/SummerOfCode2007. 
You may also come up with your own suggestions.



Who can apply?
--
Anybody eligible for the GSoC program. See 
http://code.google.com/support/bin/answer.py?answer=60279topic=10730.



How do I apply?
---
You may apply until March 24th through the GSoC webapp. See 
http://code.google.com/support/bin/answer.py?answer=60306topic=10727 
for more info.



If you have any questions, feel free to ask questions on the 
[EMAIL PROTECTED] (http://mail.zope.org/mailman/listinfo/gsoc) mailinglist.



--
http://worldcookery.com -- Professional Zope documentation and training
___
Zope-Announce maillist  -  Zope-Announce@zope.org
http://mail.zope.org/mailman/listinfo/zope-announce

 Zope-Announce for Announcements only - no discussions

(Related lists - 
Users: http://mail.zope.org/mailman/listinfo/zope

Developers: http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope-Checkins] SVN: Zope/branches/2.10/lib/python/Testing/ZopeTestCase/ Use a decorator to save and restore thread-local state.

2007-03-15 Thread Stefan H. Holek
Log message for revision 73184:
  Use a decorator to save and restore thread-local state.
  

Changed:
  U   Zope/branches/2.10/lib/python/Testing/ZopeTestCase/functional.py
  U   
Zope/branches/2.10/lib/python/Testing/ZopeTestCase/zopedoctest/functional.py

-=-
Modified: Zope/branches/2.10/lib/python/Testing/ZopeTestCase/functional.py
===
--- Zope/branches/2.10/lib/python/Testing/ZopeTestCase/functional.py
2007-03-15 04:23:45 UTC (rev 73183)
+++ Zope/branches/2.10/lib/python/Testing/ZopeTestCase/functional.py
2007-03-15 09:58:25 UTC (rev 73184)
@@ -23,6 +23,25 @@
 import interfaces
 
 
+def savestate(func):
+'''Decorator saving thread local state before executing func
+   and restoring it afterwards.
+'''
+from AccessControl.SecurityManagement import getSecurityManager
+from AccessControl.SecurityManagement import setSecurityManager
+from zope.app.component.hooks import getSite
+from zope.app.component.hooks import setSite
+
+def wrapped_func(*args, **kw):
+sm, site = getSecurityManager(), getSite()
+try:
+return func(*args, **kw)
+finally:
+setSecurityManager(sm)
+setSite(site)
+return wrapped_func
+
+
 class Functional(sandbox.Sandboxed):
 '''Derive from this class and an xTestCase to get functional
testing support::
@@ -33,25 +52,15 @@
 
 __implements__ = (interfaces.IFunctional,)
 
+@savestate
 def publish(self, path, basic=None, env=None, extra=None,
 request_method='GET', stdin=None, handle_errors=True):
 '''Publishes the object at 'path' returning a response object.'''
 
-from zope.app.component.hooks import setSite, getSite
 from StringIO import StringIO
 from ZPublisher.Response import Response
 from ZPublisher.Test import publish_module
 
-from AccessControl.SecurityManagement import getSecurityManager
-from AccessControl.SecurityManagement import setSecurityManager
-
-# Save current security manager
-sm = getSecurityManager()
-
-# And we need to store the old site
-old_site = getSite()
-setSite(None)
-
 # Commit the sandbox for good measure
 transaction.commit()
 
@@ -91,12 +100,6 @@
debug=not handle_errors,
   )
 
-# Restore security manager
-setSecurityManager(sm)
-
-# And we need to restore the site again
-setSite(old_site)
-
 return ResponseWrapper(response, outstream, path)
 
 

Modified: 
Zope/branches/2.10/lib/python/Testing/ZopeTestCase/zopedoctest/functional.py
===
--- 
Zope/branches/2.10/lib/python/Testing/ZopeTestCase/zopedoctest/functional.py
2007-03-15 04:23:45 UTC (rev 73183)
+++ 
Zope/branches/2.10/lib/python/Testing/ZopeTestCase/zopedoctest/functional.py
2007-03-15 09:58:25 UTC (rev 73184)
@@ -31,6 +31,7 @@
 from Testing.ZopeTestCase import standard_permissions
 from Testing.ZopeTestCase.sandbox import AppZapper
 from Testing.ZopeTestCase.functional import ResponseWrapper
+from Testing.ZopeTestCase.functional import savestate
 
 
 class HTTPHeaderOutput:
@@ -110,6 +111,7 @@
 getRootFolder()._p_jar.sync()
 
 
[EMAIL PROTECTED]
 def http(request_string, handle_errors=True):
 Execute an HTTP request string via the publisher
 
@@ -117,20 +119,10 @@
 
 import urllib
 import rfc822
-from zope.app.component.hooks import setSite, getSite
 from cStringIO import StringIO
 from ZPublisher.Response import Response
 from ZPublisher.Test import publish_module
-from AccessControl.SecurityManagement import getSecurityManager
-from AccessControl.SecurityManagement import setSecurityManager
 
-# Save current Security Manager
-old_sm = getSecurityManager()
-
-# And we need to store the old site
-old_site = getSite()
-setSite(None)
-
 # Commit work done by previous python code.
 transaction.commit()
 
@@ -194,14 +186,6 @@
 header_output.appendResponseHeaders(response._cookie_list())
 
header_output.appendResponseHeaders(response.accumulated_headers.splitlines())
 
-# Restore previous security manager, which may have been changed
-# by calling the publish method above
-setSecurityManager(old_sm)
-
-# And we need to restore the site again
-setSite(old_site)
-# Sync connection
-
 sync()
 
 return DocResponseWrapper(response, outstream, path, header_output)

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/trunk/lib/python/Testing/ZopeTestCase/doc/ClassDiagram.pdf Updated class diagram.

2007-03-15 Thread Stefan H. Holek
Log message for revision 73191:
  Updated class diagram.
  

Changed:
  U   Zope/trunk/lib/python/Testing/ZopeTestCase/doc/ClassDiagram.pdf

-=-
Modified: Zope/trunk/lib/python/Testing/ZopeTestCase/doc/ClassDiagram.pdf
===
(Binary files differ)

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/branches/2.10/lib/python/Testing/ZopeTestCase/ Merged r73189:73190 from the trunk.

2007-03-15 Thread Stefan H. Holek
Log message for revision 73192:
  Merged r73189:73190 from the trunk.
  
  Protect against setNumberOfThreads disappearing after first use.
  

Changed:
  U   Zope/branches/2.10/lib/python/Testing/ZopeTestCase/threadutils.py
  U   Zope/branches/2.10/lib/python/Testing/ZopeTestCase/utils.py

-=-
Modified: Zope/branches/2.10/lib/python/Testing/ZopeTestCase/threadutils.py
===
--- Zope/branches/2.10/lib/python/Testing/ZopeTestCase/threadutils.py   
2007-03-15 13:44:26 UTC (rev 73191)
+++ Zope/branches/2.10/lib/python/Testing/ZopeTestCase/threadutils.py   
2007-03-15 14:20:14 UTC (rev 73192)
@@ -13,7 +13,7 @@
 Parts of ZServer support are in this module so they can
 be imported more selectively.
 
-$Id: threadutils.py,v 1.6 2004/08/19 15:31:26 shh42 Exp $
+$Id$
 
 
 from threading import Thread
@@ -22,6 +22,15 @@
 dummyLOG = StringIO()
 
 
+def setNumberOfThreads(number_of_threads):
+'''Sets number of ZServer threads.'''
+try:
+from ZServer.PubCore import setNumberOfThreads
+setNumberOfThreads(number_of_threads)
+except ImportError:
+pass
+
+
 def zserverRunner(host, port, log=None):
 '''Runs an HTTP ZServer on host:port.'''
 from ZServer import logger, asyncore

Modified: Zope/branches/2.10/lib/python/Testing/ZopeTestCase/utils.py
===
--- Zope/branches/2.10/lib/python/Testing/ZopeTestCase/utils.py 2007-03-15 
13:44:26 UTC (rev 73191)
+++ Zope/branches/2.10/lib/python/Testing/ZopeTestCase/utils.py 2007-03-15 
14:20:14 UTC (rev 73192)
@@ -115,7 +115,7 @@
 if _Z2HOST is None:
 _Z2HOST = '127.0.0.1'
 _Z2PORT = random.choice(range(55000, 55500))
-from ZServer import setNumberOfThreads
+from threadutils import setNumberOfThreads
 setNumberOfThreads(number_of_threads)
 from threadutils import QuietThread, zserverRunner
 t = QuietThread(target=zserverRunner, args=(_Z2HOST, _Z2PORT, log))

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-dev] need help to solve zgadfly database issue

2007-03-15 Thread Dear
  
Hi Every Body,

CASE 1.

1) I have created one page template which contains one
form  after submit i inserted the form values in to
zgadfly database table as given below Using External
Methods.


connection = gadfly.gadfly(dbName,dbPath)

cursor = connection.cursor()

cursor.execute(insert into tablename())

connection.commit()

connection.close()


2) Now to read this information i created .

   i) Z SQL Method
   ii) Z Search Interface. (used page template option)

But when i view the page it is not showing the valuse
which i have recently inserted, i need to restart the
ZOPE server to get these changes reflected. What i
mean
i Z SQL there is statement select  * from table

but without zestarting the server it is not pulling
the  valuse inserted in tables.

CASE 2.

now i tried second option to read data from tables.

instead of creating page template, i wrote External
Method, in which i created html page

systax like this

connection = gadfly.gadfly(dbName,dbPath)
cursor = connection.cursor()
cursor.execute(select * from table_name)
rc=cursor.fetchall()
connection.commit()
connection.close()

return rc

if i visit the page, zope is hanging, on status bar it
is showing messahe waiting...

did any body face this problem , and can help me.



for both operations i am using External Methods.

Thanks in advance

Mukhtar___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Can Any Body help me to solve Zgadfly data Base issues

2007-03-15 Thread mukhtar wani
Hi All,

My requirements.

I am uploading CSV files, store it on System,
using External method i am merging these values to CMS


user = 'admin'
   
newSecurityManager(None,app.VeraWang.acl_users.getUser(user))
get_transaction().begin()
   
targetFolder.invokeFactory(type_name='Store',id=id1,title=storeName)

tempObj = {
   ... values
   ...
   }
obj = getattr(targetFolder, id1)
obj.edit(**tempObj)
get_transaction().commit()

it merges changes with CMS and no problem.

now i need  some information to store of this uploaded
file, i am using zgadfly database for this purpose.

in the same  external method, i am openong connection
to gadfly and insert values into tables,
 which i did successfully.

Now i am using z SQL and Z Search  interface, to read
data from gadfly.

it is not showing the inserted rows unless i restarted
the zope server.


second method:

instead of using Z SQL and Z Search interface i
developed another external script in zope.

here i wrote html code and select query which is
also working. good. 

in this html i have some forms, to submit some data,
if i submit this form it is hanging, even i will
return only some string.

and didn't allow me to visit other pages, it is
hanging

did any body use external methos to insert/select data
in gadfly.

Thanks for you help.

Mukhtar


 

We won't tell. Get more on shows you hate to love 
(and love to hate): Yahoo! TV's Guilty Pleasures list.
http://tv.yahoo.com/collections/265 
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Zope Tests: 5 OK

2007-03-15 Thread Zope Tests Summarizer
Summary of messages to the zope-tests list.
Period Wed Mar 14 12:00:00 2007 UTC to Thu Mar 15 12:00:00 2007 UTC.
There were 5 messages: 5 from Zope Unit Tests.


Tests passed OK
---

Subject: OK : Zope-2.7 Python-2.3.6 : Linux
From: Zope Unit Tests
Date: Wed Mar 14 21:52:53 EDT 2007
URL: http://mail.zope.org/pipermail/zope-tests/2007-March/007443.html

Subject: OK : Zope-2.8 Python-2.3.6 : Linux
From: Zope Unit Tests
Date: Wed Mar 14 21:54:23 EDT 2007
URL: http://mail.zope.org/pipermail/zope-tests/2007-March/007444.html

Subject: OK : Zope-2.9 Python-2.4.4 : Linux
From: Zope Unit Tests
Date: Wed Mar 14 21:55:53 EDT 2007
URL: http://mail.zope.org/pipermail/zope-tests/2007-March/007445.html

Subject: OK : Zope-2.10 Python-2.4.4 : Linux
From: Zope Unit Tests
Date: Wed Mar 14 21:57:24 EDT 2007
URL: http://mail.zope.org/pipermail/zope-tests/2007-March/007446.html

Subject: OK : Zope-trunk Python-2.4.4 : Linux
From: Zope Unit Tests
Date: Wed Mar 14 21:58:54 EDT 2007
URL: http://mail.zope.org/pipermail/zope-tests/2007-March/007447.html

___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope] need help to solve zgadfly database issue

2007-03-15 Thread mukhtar wani
Hi Every Body,

CASE 1.

1) I have created one page template which contains one
form  after submit i inserted the form values in to
zgadfly database table as given below Using External
Methods.


connection = gadfly.gadfly(dbName,dbPath)

cursor = connection.cursor()

cursor.execute(insert into tablename())

connection.commit()

connection.close()


2) Now to read this information i created .

   i) Z SQL Method
   ii) Z Search Interface. (used page template option)

But when i view the page it is not showing the valuse
which i have recently inserted, i need to restart the
ZOPE server to get these changes reflected. What i
mean
i Z SQL there is statement select  * from table

but without zestarting the server it is not pulling
the  valuse inserted in tables.

CASE 2.

now i tried second option to read data from tables.

instead of creating page template, i wrote External
Method, in which i created html page

systax like this

connection = gadfly.gadfly(dbName,dbPath)
cursor = connection.cursor()
cursor.execute(select * from table_name)
rc=cursor.fetchall()
connection.commit()
connection.close()

return rc

if i visit the page, zope is hanging, on status bar it
is showing messahe waiting...

did any body face this problem , and can help me.



for both operations i am using External Methods.

Thanks in advance

Mukhtar


 

Bored stiff? Loosen up... 
Download and play hundreds of games for free on Yahoo! Games.
http://games.yahoo.com/games/front
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] How do people work with html-designers?

2007-03-15 Thread Jaroslav Lukesh

do google: zpt OR tal lukesh

I was wrote about this few months ago in this mailinglist.

Regards JL.

- Original Message - 
From: Gaute Amundsen [EMAIL PROTECTED]




I have been meaning to ask this for a while..

How do people set up the zope development process and servers to work well
with web-designers who use wysiwyg editors like dreamweaver?

I mean, we all probably use webdav, and external editor, but after that?

After all one of the advertised advantages of ZPT, is that you can send 
the
template back to the designer without him destroying the TAL code. (not 
right

away at least)


___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] How do people work with html-designers?

2007-03-15 Thread Gaute Amundsen
On Thursday 15 March 2007 10:23, Jaroslav Lukesh wrote:
 do google: zpt OR tal lukesh

 I was wrote about this few months ago in this mailinglist.

 Regards JL.

Did you try googling that yourself before responding?
Not much there..
I searched the mailinglist for various terms as well before posting this, 
but could find nothing very relevant.

Tried lukesh on the list now..
You can't be thinking of the Urgent Help Required thread.
I have not read every last post, but that does no look like a very 
constructive...

A slightly more specific pointer would be appreciated.

Gaute
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] how to do this?

2007-03-15 Thread javi lopez

Hello everyone and thaks for your help:

I have this things:
Zdatabase Conection
zsql method
Controller page template(form)
Controller python script(call zsql method)
controller validator
page template

it´s a form, it stores email and comments in database and it works. I
need put all this inside a product i did,  and when I have to push a
button from a page template (of the product), show me the form, i fill
in it, and it stores data in db.
Can i do it?Can you help me please?Thanks
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] build a safe proxy

2007-03-15 Thread Eric Bréhault

Hello,

I am trying to build a safe proxy to wrap the Plone portal object in order
to control what is allowed or not.
Here is my code:
class SafeProxy:
   def __init__(self, obj):
   self.__dict__['_obj'] = obj

   def __getattr__(self, attr):
   attributes_whitelist=['portal_membership', 'MailHost']
   if attr in attributes_whitelist:
   return getattr(self._obj, attr)
   else:
   raise AttributeError, attr+ not allowed in Plomino formula
context

   def __setattr__(self, attr, val):
   raise AttributeError, attr+ not allowed in Plomino formula context

Then I use it that way:

safeportal=SafeProxy(portal)
safeportal.portal_membership

MembershipTool at /myportal/portal_membership

safeportal.portal_catalog

AttributeError: portal_catalog not allowed in Plomino formula context

which is perfect.

But my problem is:

safeportal._obj.portal_catalog

CatalogTool at /concerteau/portal_catalog

How can I hide completely the SafeProxy _obj ? How can I make sure it can
only be used from the SafeProxy class code itself and nowhere else ?
How can I turn it private ? (in Python private attributes are supposed to
start with 2 underscores:  __obj, but it just mangles with the classname:
_SafeProxy__obj, so it just guarantees it will not be overwrite by another
class, it does not physically protect it)

OR (if totally impossible in Python):
how can I do it another way ? maybe using zope.proxy.ProxyBase, but i do not
find any documentation about it...

Thanks in advance,

Eric BREHAULT
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )