[Zope3-checkins] CVS: Zope3/src/zodb/code - class_.py:1.17.4.1 module.py:1.10.10.1
Grégoire Weber
zope@i-con.ch
Sun, 22 Jun 2003 10:23:59 -0400
Update of /cvs-repository/Zope3/src/zodb/code
In directory cvs.zope.org:/tmp/cvs-serv24874/src/zodb/code
Modified Files:
Tag: cw-mail-branch
class_.py module.py
Log Message:
Synced up with HEAD
=== Zope3/src/zodb/code/class_.py 1.17 => 1.17.4.1 ===
--- Zope3/src/zodb/code/class_.py:1.17 Wed May 7 14:19:07 2003
+++ Zope3/src/zodb/code/class_.py Sun Jun 22 10:22:28 2003
@@ -15,6 +15,7 @@
__metaclass__ = type
+from zope.interface import implements
from persistence import PersistentMetaClass
from persistence._persistence import UPTODATE, CHANGED, GHOST
from persistence.interfaces import IPersistent
@@ -233,6 +234,7 @@
# The hack solution is to have a hook for _p_jar that activates
# the object the first time it is set.
+ #implements(IPersistent)
__implements__ = IPersistent
# A class is normally created in the UPTODATE state, but when a
=== Zope3/src/zodb/code/module.py 1.10 => 1.10.10.1 ===
--- Zope3/src/zodb/code/module.py:1.10 Thu May 1 15:34:59 2003
+++ Zope3/src/zodb/code/module.py Sun Jun 22 10:22:28 2003
@@ -15,6 +15,8 @@
__metaclass__ = type
+from zope.interface import implements
+
from persistence import Persistent
from persistence._persistence import GHOST
from zodb.code.interfaces import IPersistentModuleManager
@@ -101,7 +103,7 @@
class PersistentModuleManager(Persistent):
- __implements__ = IPersistentModuleManager
+ implements(IPersistentModuleManager)
def __init__(self, registry):
self._registry = registry
@@ -135,7 +137,8 @@
def update(self, source):
# Try to prevent compilation errors from files without trailing
# newlines.
- source += "\n"
+ if source and source[-1] != "\n":
+ source += "\n"
self._module._p_changed = True
moddict = self._module.__dict__
old_names = NameFinder(self._module)
@@ -147,7 +150,7 @@
convert(self._module, replacements)
self.source = source
- def remove(self, source):
+ def remove(self):
self._registry.delModule(self._module.__name__)
self._module = None
@@ -273,8 +276,8 @@
looks for them there.
"""
- __implements__ = (IPersistentModuleImportRegistry,
- IPersistentModuleUpdateRegistry)
+ implements(IPersistentModuleImportRegistry,
+ IPersistentModuleUpdateRegistry)
def __init__(self):
self._modules = {}