[Zope-Checkins] SVN: Zope/branches/2.10/ Launchpad #142350: Display description for properties as row title, if present.

2008-05-05 Thread Tres Seaver
Log message for revision 86455:
  Launchpad #142350: Display description for properties as row title, if 
present.
  

Changed:
  U   Zope/branches/2.10/doc/CHANGES.txt
  U   Zope/branches/2.10/lib/python/OFS/PropertyManager.py
  U   Zope/branches/2.10/lib/python/OFS/dtml/properties.dtml
  U   Zope/branches/2.10/lib/python/OFS/tests/testProperties.py

-=-
Modified: Zope/branches/2.10/doc/CHANGES.txt
===
--- Zope/branches/2.10/doc/CHANGES.txt  2008-05-05 15:14:52 UTC (rev 86454)
+++ Zope/branches/2.10/doc/CHANGES.txt  2008-05-05 15:22:12 UTC (rev 86455)
@@ -8,6 +8,9 @@
 
 Bugs fixed
 
+  - Launchpad #142350: Display description for properties as row title,
+if present.
+
   - Launchpad #27: DateTime(anotherDateTime) now preserves the
 timezone.
 

Modified: Zope/branches/2.10/lib/python/OFS/PropertyManager.py
===
--- Zope/branches/2.10/lib/python/OFS/PropertyManager.py2008-05-05 
15:14:52 UTC (rev 86454)
+++ Zope/branches/2.10/lib/python/OFS/PropertyManager.py2008-05-05 
15:22:12 UTC (rev 86455)
@@ -258,6 +258,16 @@
 return p.get('label', id)
 return id
 
+security.declareProtected(access_contents_information,
+  'propertyDescription')
+def propertyDescription(self, id):
+Return a description for the given property id
+
+for p in self._properties:
+if p['id'] == id:
+return p.get('description', '')
+return id
+
 security.declareProtected(access_contents_information, 'propdict')
 def propdict(self):
 dict={}

Modified: Zope/branches/2.10/lib/python/OFS/dtml/properties.dtml
===
--- Zope/branches/2.10/lib/python/OFS/dtml/properties.dtml  2008-05-05 
15:14:52 UTC (rev 86454)
+++ Zope/branches/2.10/lib/python/OFS/dtml/properties.dtml  2008-05-05 
15:22:12 UTC (rev 86455)
@@ -61,8 +61,9 @@
 /tr
 
 dtml-in propertyMap mapping
-dtml-let type=not _.has_key('type') and 'string' or type
-tr
+dtml-let type=not _.has_key('type') and 'string' or type
+  pdesc=propertyDescription(id)
+tr title=dtml-pdesc;
   td align=left valign=top width=16
   dtml-if 'd' in _['sequence-item'].get('mode', 'awd')
   input type=checkbox name=_ids:dtml-var 
REQUEST['management_page_charset_tag']string:list value=dtml-id;

Modified: Zope/branches/2.10/lib/python/OFS/tests/testProperties.py
===
--- Zope/branches/2.10/lib/python/OFS/tests/testProperties.py   2008-05-05 
15:14:52 UTC (rev 86454)
+++ Zope/branches/2.10/lib/python/OFS/tests/testProperties.py   2008-05-05 
15:22:12 UTC (rev 86455)
@@ -21,10 +21,12 @@
 class TestPropertyManager(unittest.TestCase):
 Property management tests.
 
-def _makeOne(self, *args, **kw):
+def _getTargetClass(self):
 from OFS.PropertyManager import PropertyManager
+return PropertyManager
 
-return PropertyManager(*args, **kw)
+def _makeOne(self, *args, **kw):
+return self._getTargetClass()(*args, **kw)
 
 def test_z3interfaces(self):
 from OFS.interfaces import IPropertyManager
@@ -52,7 +54,41 @@
 self.failUnless(type(inst.getProperty('prop2')) == type(()))
 self.failUnless(type(inst.prop2) == type(()))
 
+def test_propertyLabel_no_label_falls_back_to_id(self):
+class NoLabel(self._getTargetClass()):
+_properties = (
+{'id': 'no_label', 'type': 'string'},
+)
+inst = NoLabel()
+self.assertEqual(inst.propertyLabel('no_label'), 'no_label')
 
+def test_propertyLabel_with_label(self):
+class WithLabel(self._getTargetClass()):
+_properties = (
+{'id': 'with_label', 'type': 'string', 'label': 'With Label'},
+)
+inst = WithLabel()
+self.assertEqual(inst.propertyLabel('with_label'), 'With Label')
+
+def test_propertyDescription_no_description_falls_back_to_id(self):
+class NoDescription(self._getTargetClass()):
+_properties = (
+{'id': 'no_description', 'type': 'string'},
+)
+inst = NoDescription()
+self.assertEqual(inst.propertyDescription('no_description'), '')
+
+def test_propertyDescription_with_description(self):
+class WithDescription(self._getTargetClass()):
+_properties = (
+{'id': 'with_description', 'type': 'string',
+ 'description': 'With Description'},
+)
+inst = WithDescription()
+self.assertEqual(inst.propertyDescription('with_description'),
+ 'With Description')
+
+
 class TestPropertySheet(unittest.TestCase):
 Property management tests.
 


[Zope-Checkins] SVN: Zope/branches/2.11/ Launchpad #142350: Display description for properties as row title, if present.

2008-05-05 Thread Tres Seaver
Log message for revision 86456:
  Launchpad #142350: Display description for properties as row title, if 
present.
  
  

Changed:
  U   Zope/branches/2.11/doc/CHANGES.txt
  U   Zope/branches/2.11/lib/python/OFS/PropertyManager.py
  U   Zope/branches/2.11/lib/python/OFS/dtml/properties.dtml
  U   Zope/branches/2.11/lib/python/OFS/tests/testProperties.py

-=-
Modified: Zope/branches/2.11/doc/CHANGES.txt
===
--- Zope/branches/2.11/doc/CHANGES.txt  2008-05-05 15:22:12 UTC (rev 86455)
+++ Zope/branches/2.11/doc/CHANGES.txt  2008-05-05 15:25:30 UTC (rev 86456)
@@ -8,6 +8,9 @@
 
 Bugs Fixed
 
+  - Launchpad #142350: Display description for properties as row title,
+if present.
+
   - Launchpad #27: DateTime(anotherDateTime) now preserves the
 timezone.
 

Modified: Zope/branches/2.11/lib/python/OFS/PropertyManager.py
===
--- Zope/branches/2.11/lib/python/OFS/PropertyManager.py2008-05-05 
15:22:12 UTC (rev 86455)
+++ Zope/branches/2.11/lib/python/OFS/PropertyManager.py2008-05-05 
15:25:30 UTC (rev 86456)
@@ -258,6 +258,16 @@
 return p.get('label', id)
 return id
 
+security.declareProtected(access_contents_information,
+  'propertyDescription')
+def propertyDescription(self, id):
+Return a description for the given property id
+
+for p in self._properties:
+if p['id'] == id:
+return p.get('description', '')
+return id
+
 security.declareProtected(access_contents_information, 'propdict')
 def propdict(self):
 dict={}

Modified: Zope/branches/2.11/lib/python/OFS/dtml/properties.dtml
===
--- Zope/branches/2.11/lib/python/OFS/dtml/properties.dtml  2008-05-05 
15:22:12 UTC (rev 86455)
+++ Zope/branches/2.11/lib/python/OFS/dtml/properties.dtml  2008-05-05 
15:25:30 UTC (rev 86456)
@@ -61,8 +61,9 @@
 /tr
 
 dtml-in propertyMap mapping
-dtml-let type=not _.has_key('type') and 'string' or type
-tr
+dtml-let type=not _.has_key('type') and 'string' or type
+  pdesc=propertyDescription(id)
+tr title=dtml-pdesc;
   td align=left valign=top width=16
   dtml-if 'd' in _['sequence-item'].get('mode', 'awd')
   input type=checkbox name=_ids:dtml-var 
REQUEST['management_page_charset_tag']string:list value=dtml-id;

Modified: Zope/branches/2.11/lib/python/OFS/tests/testProperties.py
===
--- Zope/branches/2.11/lib/python/OFS/tests/testProperties.py   2008-05-05 
15:22:12 UTC (rev 86455)
+++ Zope/branches/2.11/lib/python/OFS/tests/testProperties.py   2008-05-05 
15:25:30 UTC (rev 86456)
@@ -21,10 +21,12 @@
 class TestPropertyManager(unittest.TestCase):
 Property management tests.
 
-def _makeOne(self, *args, **kw):
+def _getTargetClass(self):
 from OFS.PropertyManager import PropertyManager
+return PropertyManager
 
-return PropertyManager(*args, **kw)
+def _makeOne(self, *args, **kw):
+return self._getTargetClass()(*args, **kw)
 
 def test_z3interfaces(self):
 from OFS.interfaces import IPropertyManager
@@ -52,7 +54,41 @@
 self.failUnless(type(inst.getProperty('prop2')) == type(()))
 self.failUnless(type(inst.prop2) == type(()))
 
+def test_propertyLabel_no_label_falls_back_to_id(self):
+class NoLabel(self._getTargetClass()):
+_properties = (
+{'id': 'no_label', 'type': 'string'},
+)
+inst = NoLabel()
+self.assertEqual(inst.propertyLabel('no_label'), 'no_label')
 
+def test_propertyLabel_with_label(self):
+class WithLabel(self._getTargetClass()):
+_properties = (
+{'id': 'with_label', 'type': 'string', 'label': 'With Label'},
+)
+inst = WithLabel()
+self.assertEqual(inst.propertyLabel('with_label'), 'With Label')
+
+def test_propertyDescription_no_description_falls_back_to_id(self):
+class NoDescription(self._getTargetClass()):
+_properties = (
+{'id': 'no_description', 'type': 'string'},
+)
+inst = NoDescription()
+self.assertEqual(inst.propertyDescription('no_description'), '')
+
+def test_propertyDescription_with_description(self):
+class WithDescription(self._getTargetClass()):
+_properties = (
+{'id': 'with_description', 'type': 'string',
+ 'description': 'With Description'},
+)
+inst = WithDescription()
+self.assertEqual(inst.propertyDescription('with_description'),
+ 'With Description')
+
+
 class TestPropertySheet(unittest.TestCase):
 Property management tests.
 


[Zope-Checkins] SVN: Zope/trunk/lib/python/OFS/ Launchpad #142350: Display description for properties as row title, if present.

2008-05-05 Thread Tres Seaver
Log message for revision 86457:
  Launchpad #142350: Display description for properties as row title, if 
present.
  
  

Changed:
  U   Zope/trunk/lib/python/OFS/PropertyManager.py
  U   Zope/trunk/lib/python/OFS/dtml/properties.dtml
  U   Zope/trunk/lib/python/OFS/tests/testProperties.py

-=-
Modified: Zope/trunk/lib/python/OFS/PropertyManager.py
===
--- Zope/trunk/lib/python/OFS/PropertyManager.py2008-05-05 15:25:30 UTC 
(rev 86456)
+++ Zope/trunk/lib/python/OFS/PropertyManager.py2008-05-05 15:28:29 UTC 
(rev 86457)
@@ -258,6 +258,16 @@
 return p.get('label', id)
 return id
 
+security.declareProtected(access_contents_information,
+  'propertyDescription')
+def propertyDescription(self, id):
+Return a description for the given property id
+
+for p in self._properties:
+if p['id'] == id:
+return p.get('description', '')
+return id
+
 security.declareProtected(access_contents_information, 'propdict')
 def propdict(self):
 dict={}

Modified: Zope/trunk/lib/python/OFS/dtml/properties.dtml
===
--- Zope/trunk/lib/python/OFS/dtml/properties.dtml  2008-05-05 15:25:30 UTC 
(rev 86456)
+++ Zope/trunk/lib/python/OFS/dtml/properties.dtml  2008-05-05 15:28:29 UTC 
(rev 86457)
@@ -61,8 +61,9 @@
 /tr
 
 dtml-in propertyMap mapping
-dtml-let type=not _.has_key('type') and 'string' or type
-tr
+dtml-let type=not _.has_key('type') and 'string' or type
+  pdesc=propertyDescription(id)
+tr title=dtml-pdesc;
   td align=left valign=top width=16
   dtml-if 'd' in _['sequence-item'].get('mode', 'awd')
   input type=checkbox name=_ids:dtml-var 
REQUEST['management_page_charset_tag']string:list value=dtml-id;

Modified: Zope/trunk/lib/python/OFS/tests/testProperties.py
===
--- Zope/trunk/lib/python/OFS/tests/testProperties.py   2008-05-05 15:25:30 UTC 
(rev 86456)
+++ Zope/trunk/lib/python/OFS/tests/testProperties.py   2008-05-05 15:28:29 UTC 
(rev 86457)
@@ -21,10 +21,12 @@
 class TestPropertyManager(unittest.TestCase):
 Property management tests.
 
-def _makeOne(self, *args, **kw):
+def _getTargetClass(self):
 from OFS.PropertyManager import PropertyManager
+return PropertyManager
 
-return PropertyManager(*args, **kw)
+def _makeOne(self, *args, **kw):
+return self._getTargetClass()(*args, **kw)
 
 def test_z3interfaces(self):
 from OFS.interfaces import IPropertyManager
@@ -52,7 +54,41 @@
 self.failUnless(type(inst.getProperty('prop2')) == type(()))
 self.failUnless(type(inst.prop2) == type(()))
 
+def test_propertyLabel_no_label_falls_back_to_id(self):
+class NoLabel(self._getTargetClass()):
+_properties = (
+{'id': 'no_label', 'type': 'string'},
+)
+inst = NoLabel()
+self.assertEqual(inst.propertyLabel('no_label'), 'no_label')
 
+def test_propertyLabel_with_label(self):
+class WithLabel(self._getTargetClass()):
+_properties = (
+{'id': 'with_label', 'type': 'string', 'label': 'With Label'},
+)
+inst = WithLabel()
+self.assertEqual(inst.propertyLabel('with_label'), 'With Label')
+
+def test_propertyDescription_no_description_falls_back_to_id(self):
+class NoDescription(self._getTargetClass()):
+_properties = (
+{'id': 'no_description', 'type': 'string'},
+)
+inst = NoDescription()
+self.assertEqual(inst.propertyDescription('no_description'), '')
+
+def test_propertyDescription_with_description(self):
+class WithDescription(self._getTargetClass()):
+_properties = (
+{'id': 'with_description', 'type': 'string',
+ 'description': 'With Description'},
+)
+inst = WithDescription()
+self.assertEqual(inst.propertyDescription('with_description'),
+ 'With Description')
+
+
 class TestPropertySheet(unittest.TestCase):
 Property management tests.
 

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


[Zope-dev] Zope Tests:

2008-05-05 Thread Zope Tests Summarizer
Summary of messages to the zope-tests list.
Period Sun May  4 11:00:00 2008 UTC to Mon May  5 11:00:00 2008 UTC.
There were no messages.

___
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] mysqldbda bloats zodb

2008-05-05 Thread Adam GROSZER
Hello,

I'm digging again around rdb and friends.

It seems now that mysqldbda bloats zodb in
def _connection_factory(self):
Create a MySQLdb DBI connection based on the DSN
...
self.__stringConverter = MySQLStringConverter(self.getEncoding())
return connection
on almost every request of us. That causes plenty of conflict errors I
guess. But strangely we end up with
ConnectionStateError: Shouldn't load state for 0x24 when the connection is 
closed
(0x24 is the MySQLdbAdapter instance)

So, I would move the assignment of __stringConverter to setEncoding
where it belongs. (Change it only when the encoding changes).
This seems to solve the above errors.

Any objections?

-- 
Best regards,
 Adam GROSZER  mailto:[EMAIL PROTECTED]
--
Quote of the day:
The work will wait while you show the child the rainbow, but the rainbow won't 
wait while you do the work. 
- Patricia Clafford 

___
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.sqlalchemy

2008-05-05 Thread Laurence Rowe
Following discussions with Kapil, Christian and Martin I've developed 
zope.sqlalchemy. The aim is to provide a common base for transaction 
integration. It does not attempt to define any particular way to handle 
database configuration as there is not yet consensus on the best way to 
handle it.


I've uploaded it to zope svn and pypi. See 
http://pypi.python.org/pypi/zope.sqlalchemy


Currently it depends on a development version of SQLAlchemy. I hope to 
make a release following the 0.4.6 release of SQLAlchemy.


See pypi or the readme for details, but briefly usage is something like:

 engine = create_engine('sqlite:///')
 Session = scoped_session(sessionmaker(
... bind=engine, transactional=True, autoflush=True,
... extension=ZopeTransactionExtension()))
 session = Session()
 session.save(User(name='bob'))
 transaction.commit()

Any comments appreciated.

Laurence

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


Re: [Zope-dev] zope.sqlalchemy

2008-05-05 Thread Andreas Jung



--On 6. Mai 2008 02:26:58 +0100 Laurence Rowe [EMAIL PROTECTED] wrote:


Following discussions with Kapil, Christian and Martin I've developed
zope.sqlalchemy. The aim is to provide a common base for transaction
integration. It does not attempt to define any particular way to handle
database configuration as there is not yet consensus on the best way to
handle it.

I've uploaded it to zope svn and pypi. See
http://pypi.python.org/pypi/zope.sqlalchemy

Currently it depends on a development version of SQLAlchemy. I hope to
make a release following the 0.4.6 release of SQLAlchemy.

See pypi or the readme for details, but briefly usage is something like:

  engine = create_engine('sqlite:///')
  Session = scoped_session(sessionmaker(
 ... bind=engine, transactional=True, autoflush=True,
 ... extension=ZopeTransactionExtension()))
  session = Session()
  session.save(User(name='bob'))
  transaction.commit()

Any comments appreciated.



Looks great (on the paper :-)). Trying to integrate it with z3c.sqlalchemy 
over the weekend. Thanks Laurence.


Andreas

pgpZKhiINSlh6.pgp
Description: PGP signature
___
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 )


Re: [Zope] Zope threads and the GIL

2008-05-05 Thread Manuel Vazquez Acosta
Andreas Jung wrote:
 Then it should play nicely with Python. But keep in mind that thread
 switches can also be blocked by some thread without having the GIL locked.
 We've seen such situations were a thread had to perform complex regular
 expression matching operations. Obviously code in Python C extension is
 also able to lock up the Python interpreter until the result is being
 passed back to the Python interpreter.
 

Another Q: Is AccessControl GIL aware? I mean, this is probably the most
used component in Zope. Maybe a performance boost is experienced if
those checks can be made simultaneously.

Thinking harder, I realize that a tradeoff is in place: Objects can
change its security status (the security policy -- i.e, the security
object -- can be changed also, but is a weird use case, isn't it?). So
maybe write-lock is needed.

On the other hand, for objects with a high demand rate, which are kept
in memory, good results are to be expected.

CacheFu deals OK with Anonymous users, but a boost is to be expected for
authenticated users.

Best regards,
Manuel.
___
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] Zope threads and the GIL

2008-05-05 Thread Andreas Jung



--On 5. Mai 2008 10:11:32 -0400 Manuel Vazquez Acosta [EMAIL PROTECTED] 
wrote:



Andreas Jung wrote:

Then it should play nicely with Python. But keep in mind that thread
switches can also be blocked by some thread without having the GIL
locked. We've seen such situations were a thread had to perform complex
regular expression matching operations. Obviously code in Python C
extension is also able to lock up the Python interpreter until the
result is being passed back to the Python interpreter.



Another Q: Is AccessControl GIL aware? I mean, this is probably the most
used component in Zope. Maybe a performance boost is experienced if
those checks can be made simultaneously.


Better tell us what your _real_ question/problem is. I am not getting the 
point what you are really interested in.


-aj

pgpenBunKtLxQ.pgp
Description: PGP signature
___
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] Zope threads and the GIL

2008-05-05 Thread Manuel Vazquez Acosta
Andreas Jung wrote:
 
 
 --On 5. Mai 2008 10:11:32 -0400 Manuel Vazquez Acosta
 [EMAIL PROTECTED] wrote:
 
 Andreas Jung wrote:
 Then it should play nicely with Python. But keep in mind that thread
 switches can also be blocked by some thread without having the GIL
 locked. We've seen such situations were a thread had to perform complex
 regular expression matching operations. Obviously code in Python C
 extension is also able to lock up the Python interpreter until the
 result is being passed back to the Python interpreter.


 Another Q: Is AccessControl GIL aware? I mean, this is probably the most
 used component in Zope. Maybe a performance boost is experienced if
 those checks can be made simultaneously.
 
 Better tell us what your _real_ question/problem is. I am not getting
 the point what you are really interested in.
 
 -aj

I'm thinking in CPU-bounded parts of a request: Reindexing, Clustering,
Automatic Content Extraction, and the like...

We have implemented k-means clustering algorithm on top ZCTextIndex (now
plan to port to zc.catalog), although this is batch operation, some
other are per-query: Summarizing is one of those: Per cluster, and per
document. (Although this is maybe a question for the OTS list).

So I'm a little bit worried about how the resource utilization.

Best regards,
Manuel.




___
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] Add Combo Box in External method page

2008-05-05 Thread Dieter Maurer
vaibhav pol wrote at 2008-4-30 11:26 +0530:
 ...
 I want to modify the ExternalMethod dtml page which cames in zope i have to
add combobox into the external method
 i go into the
 zopehome/lib/python/Products/ExternalMethod/dtml where i get the dtml page
methodAdd.dtml
 i add combo box this dtml page is call in ExternalMethod.py how can i
modifed that is it i have to create a object for the combobox .

I fear I cannot understand this English.

Where is your problem?

In methodAdd.dtml when you try to construct the combobox?
In the corresponding action when you try to interpret and handle
the value from your combobox?



-- 
Dieter
___
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] Zope threads and the GIL

2008-05-05 Thread Dieter Maurer
Manuel Vazquez Acosta wrote at 2008-5-4 11:12 -0400:
 ...
That would mean that the only place where real multitasking occurs is
when fetching objects from ZEO and other I/O bounded tasks, isn't?

I depends what you mean with real multitasking.

If you mean by this that several CPUs are concurrently active for your
Zope process, then you are near. You can, however, also write code
for expensive time consuming operations in a language different from
Python and then release the GIL before you active such code. Then,
this code, too, can occupy a CPU in addition to the Python activity.



-- 
Dieter
___
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] Zope threads and the GIL

2008-05-05 Thread Manuel Vazquez Acosta
Dieter Maurer wrote:
 Manuel Vazquez Acosta wrote at 2008-5-4 11:12 -0400:
 ...
 That would mean that the only place where real multitasking occurs is
 when fetching objects from ZEO and other I/O bounded tasks, isn't?
 
 I depends what you mean with real multitasking.
 
 If you mean by this that several CPUs are concurrently active for your
 Zope process, then you are near. 

Exactly. Several CPUs, I would like to use.

 You can, however, also write code
 for expensive time consuming operations in a language different from
 Python and then release the GIL before you active such code. Then,
 this code, too, can occupy a CPU in addition to the Python activity.
 

I'm very new to Python, and don't grasp yet the C API. Also I would like
to implement almost everything in Python: I need this, b/c my of my
team's skills in C are None.

Best regards,
Manuel.

___
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] Re: Zope threads and the GIL

2008-05-05 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Manuel Vazquez Acosta wrote:
 Dieter Maurer wrote:
 Manuel Vazquez Acosta wrote at 2008-5-4 11:12 -0400:
 ...
 That would mean that the only place where real multitasking occurs is
 when fetching objects from ZEO and other I/O bounded tasks, isn't?
 I depends what you mean with real multitasking.

 If you mean by this that several CPUs are concurrently active for your
 Zope process, then you are near. 
 
 Exactly. Several CPUs, I would like to use.

Generally, the rule-of-thumb for scaling Zope on a multi-CPU box is to
run an appserver instance per CPU, each talking to a shared storage
(ZEO, usually, but RelStorage would do as well).


Tres.
- --
===
Tres Seaver  +1 540-429-0999  [EMAIL PROTECTED]
Palladion Software   Excellence by Designhttp://palladion.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFIH7wa+gerLs4ltQ4RAndLAJwM+qs7w5hQy0tA9ZY33mJBGPeTBgCeN8fi
J50GVau5mZLxpFnRyJLYCIc=
=09EA
-END PGP SIGNATURE-

___
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] Turning back system clock

2008-05-05 Thread Sinang, Danny
Dear All,
 
The system clock of our Zope 2.7 machine accidentally got set to 2009.
We noticed this mistake 6 hours later and we decided to set back the
clock to 2008. 
 
How does this affect the integrity of Data.fs ?
 
From our observation :
 
1. Session write errors suddenly began to appear
 
2. Data.fs.index won't grow anymore and its timestamp remained at the
time we set back the clock
 
3. Packing the database (which was 8 GB at the time) took too long
without any signs of any Data.fs.pack file in the var folder. We decided
to restart Zope after a few minutes.
 
4. There seem to be some catalog indexing problems as our catalog
searches on a certain field doesn't work as reliably as it did before.
We tried reindexing the field and even the catalog, but it timed out on
us (lots of objects in the database).
 
Has anyone here had any similar experiences ? How do I go about fixing
this ?
 
Using repozo.py last night, I made a full backup of Data.fs, copied it
to a new instance, was able to create a new Data.fs.index, and
eventually succeeded in packing the 8 GB database to just 2.4 GB. But it
took quite a while - like 10 or 15 minutes before any Data.fs.pack
appeared. 
 
I haven't checked yet if the catalog indexing problem has gone away.
 
Regards,
Danny
 
 
 
 
 
___
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 stop packing ?

2008-05-05 Thread Sinang, Danny
Hi All,
 
Is it possible to stop an ongoing ZODB packing operation without
restarting Zope ?
 
Am using Zope 2.7.6-final.
 
- Danny
___
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 to stop packing ?

2008-05-05 Thread Andreas Jung



--On 6. Mai 2008 12:19:10 +0800 Sinang, Danny [EMAIL PROTECTED] 
wrote:



Hi All,

Is it possible to stop an ongoing ZODB packing operation without
restarting Zope ?




Restart.

-aj

pgpCjGm07d8kI.pgp
Description: PGP signature
___
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] Turning back system clock

2008-05-05 Thread Andreas Jung



--On 6. Mai 2008 10:28:29 +0800 Sinang, Danny [EMAIL PROTECTED] 
wrote:



Dear All,

The system clock of our Zope 2.7 machine accidentally got set to 2009.
We noticed this mistake 6 hours later and we decided to set back the
clock to 2008.

How does this affect the integrity of Data.fs ?


From our observation :


1. Session write errors suddenly began to appear

2. Data.fs.index won't grow anymore and its timestamp remained at the
time we set back the clock

3. Packing the database (which was 8 GB at the time) took too long
without any signs of any Data.fs.pack file in the var folder. We decided
to restart Zope after a few minutes.

4. There seem to be some catalog indexing problems as our catalog
searches on a certain field doesn't work as reliably as it did before.
We tried reindexing the field and even the catalog, but it timed out on
us (lots of objects in the database).

Has anyone here had any similar experiences ? How do I go about fixing
this ?


Turning the clock back is known to result in data inconsistencies.
It is is best-practice having NTP installed on all Zope machines.

-aj


pgpDp98pmno8W.pgp
Description: PGP signature
___
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] Turning back system clock

2008-05-05 Thread Sinang, Danny
Thanks.

Is there a way to spot these data inconsistencies in Data.fs and remove
or fix them ?

Regards,
Danny 

-Original Message-
From: Andreas Jung [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, May 06, 2008 12:31 PM
To: Sinang, Danny; zope@zope.org
Subject: Re: [Zope] Turning back system clock



--On 6. Mai 2008 10:28:29 +0800 Sinang, Danny [EMAIL PROTECTED]
wrote:

 Dear All,

 The system clock of our Zope 2.7 machine accidentally got set to 2009.
 We noticed this mistake 6 hours later and we decided to set back the 
 clock to 2008.

 How does this affect the integrity of Data.fs ?

 From our observation :

 1. Session write errors suddenly began to appear

 2. Data.fs.index won't grow anymore and its timestamp remained at the 
 time we set back the clock

 3. Packing the database (which was 8 GB at the time) took too long 
 without any signs of any Data.fs.pack file in the var folder. We 
 decided to restart Zope after a few minutes.

 4. There seem to be some catalog indexing problems as our catalog 
 searches on a certain field doesn't work as reliably as it did before.
 We tried reindexing the field and even the catalog, but it timed out 
 on us (lots of objects in the database).

 Has anyone here had any similar experiences ? How do I go about fixing

 this ?

Turning the clock back is known to result in data inconsistencies.
It is is best-practice having NTP installed on all Zope machines.

-aj
___
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] Turning back system clock

2008-05-05 Thread Andreas Jung



--On 6. Mai 2008 12:37:50 +0800 Sinang, Danny [EMAIL PROTECTED] 
wrote:



Thanks.

Is there a way to spot these data inconsistencies in Data.fs and remove
or fix them ?



You might ask Google. This topic came up several times in the past.

-aj

pgpSYHIC687AM.pgp
Description: PGP signature
___
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 )