backport stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 09 Jun 2010 10:06:46 +0200
changeset 5696 98d390c28edb
parent 5694 ce2c108a9595 (current diff)
parent 5695 85bafafc1f22 (diff)
child 5697 ec1ce7198ef4
backport stable
devtools/__init__.py
server/serverctl.py
server/sources/storages.py
vregistry.py
web/views/autoform.py
web/views/cwproperties.py
web/views/treeview.py
--- a/devtools/__init__.py	Wed Jun 09 09:58:23 2010 +0200
+++ b/devtools/__init__.py	Wed Jun 09 10:06:46 2010 +0200
@@ -245,7 +245,7 @@
     """initialize a fresh sqlserver databse used for testing purpose"""
     if config.init_repository:
         from cubicweb.server import init_repository
-        init_repository(config, interactive=False, drop=True, vreg=vreg)
+        init_repository(config, interactive=False, drop=True)
 
 ### sqlite test database handling ##############################################
 
--- a/hooks/notification.py	Wed Jun 09 09:58:23 2010 +0200
+++ b/hooks/notification.py	Wed Jun 09 10:06:46 2010 +0200
@@ -188,7 +188,7 @@
         except:
             # may raise an error during deletion process, for instance due to
             # missing required relation
-            title = '#%s' % eid
+            title = '#%s' % self.entity.eid
         self._cw.transaction_data.setdefault('pendingchanges', []).append(
-            ('delete_entity', (self.entity.eid, str(self.entity.e_schema), title)))
+            ('delete_entity', (self.entity.eid, self.entity.__regid__, title)))
         return True
--- a/server/checkintegrity.py	Wed Jun 09 09:58:23 2010 +0200
+++ b/server/checkintegrity.py	Wed Jun 09 10:06:46 2010 +0200
@@ -96,7 +96,7 @@
     cursor = session.pool['system']
     if not repo.system_source.dbhelper.has_fti_table(cursor):
         print 'no text index table'
-        dbhelper.init_fti(cursor)
+        repo.system_source.dbhelper.init_fti(cursor)
     repo.system_source.do_fti = True  # ensure full-text indexation is activated
     etypes = set()
     for eschema in schema.entities():
--- a/server/server.py	Wed Jun 09 09:58:23 2010 +0200
+++ b/server/server.py	Wed Jun 09 10:06:46 2010 +0200
@@ -25,8 +25,6 @@
 import warnings
 from time import localtime, mktime
 
-from logilab.common.daemon import daemonize
-
 from cubicweb.cwconfig import CubicWebConfiguration
 from cubicweb.server.repository import Repository
 
--- a/server/serverctl.py	Wed Jun 09 09:58:23 2010 +0200
+++ b/server/serverctl.py	Wed Jun 09 10:06:46 2010 +0200
@@ -539,14 +539,14 @@
         debug = self.config.debug
         # create the server
         server = RepositoryServer(config, debug)
-        # go ! (don't daemonize in debug mode)
-        pidfile = config['pid-file']
         # ensure the directory where the pid-file should be set exists (for
         # instance /var/run/cubicweb may be deleted on computer restart)
+        pidfile = config['pid-file']
         piddir = os.path.dirname(pidfile)
+        # go ! (don't daemonize in debug mode)
         if not os.path.exists(piddir):
             os.makedirs(piddir)
-        if not debug and daemonize(pidfile) == -1:
+        if not debug and daemonize(pidfile):
             return
         uid = config['uid']
         if uid is not None:
--- a/server/sources/storages.py	Wed Jun 09 09:58:23 2010 +0200
+++ b/server/sources/storages.py	Wed Jun 09 10:06:46 2010 +0200
@@ -16,11 +16,12 @@
 # You should have received a copy of the GNU Lesser General Public License along
 # with CubicWeb.  If not, see <http://www.gnu.org/licenses/>.
 """custom storages for the system source"""
+
 from os import unlink, path as osp
 
 from yams.schema import role_name
 
-from cubicweb import Binary
+from cubicweb import Binary, ValidationError
 from cubicweb.server import hook
 
 def set_attribute_storage(repo, etype, attr, storage):
@@ -157,7 +158,7 @@
         fspath = uniquify_path(self.default_directory, '_'.join(basename))
         if fspath is None:
             msg = entity._cw._('failed to uniquify path (%s, %s)') % (
-                dirpath, '_'.join(basename))
+                self.default_directory, '_'.join(basename))
             raise ValidationError(entity.eid, {role_name(attr, 'subject'): msg})
         return fspath
 
--- a/vregistry.py	Wed Jun 09 09:58:23 2010 +0200
+++ b/vregistry.py	Wed Jun 09 10:06:46 2010 +0200
@@ -29,9 +29,8 @@
   current state (req, rset, row, col). At the end of the selection, if
   a appobject class has been found, an instance of this class is
   returned. The selector is instantiated at appobject registration
-
+"""
 
-"""
 __docformat__ = "restructuredtext en"
 
 import sys
--- a/web/views/autoform.py	Wed Jun 09 09:58:23 2010 +0200
+++ b/web/views/autoform.py	Wed Jun 09 10:06:46 2010 +0200
@@ -128,6 +128,7 @@
 from logilab.common.deprecation import deprecated
 
 from cubicweb import typed_eid, neg_role, uilib
+from cubicweb.vregistry import classid
 from cubicweb.schema import display_name
 from cubicweb.view import EntityView
 from cubicweb.selectors import (
@@ -307,7 +308,7 @@
         try:
             cls = self._cw.vreg['etypes'].etype_class(self.etype)
         except:
-            self.w(self._cw._('no such entity type %s') % etype)
+            self.w(self._cw._('no such entity type %s') % self.etype)
             return
         entity = cls(self._cw)
         entity.eid = self._cw.varmaker.next()
@@ -733,7 +734,7 @@
         try:
             srels_by_cat = self.srelations_by_category('generic', 'add', strict=True)
             warn('[3.6] %s: srelations_by_category is deprecated, use uicfg or '
-                 'override editable_relations instead' % classid(form),
+                 'override editable_relations instead' % classid(self),
                  DeprecationWarning)
         except AttributeError:
             srels_by_cat = self.editable_relations()
--- a/web/views/cwproperties.py	Wed Jun 09 09:58:23 2010 +0200
+++ b/web/views/cwproperties.py	Wed Jun 09 10:06:46 2010 +0200
@@ -382,7 +382,7 @@
                 w(u'%s' % self.render_label(form, field))
             error = form.field_error(field)
             if error:
-                w(u'<span class="error">%s</span>' % err)
+                w(u'<span class="error">%s</span>' % error)
             w(u'%s' % self.render_help(form, field))
             w(u'<div class="prefinput">')
             w(field.render(form, self))
--- a/web/views/treeview.py	Wed Jun 09 09:58:23 2010 +0200
+++ b/web/views/treeview.py	Wed Jun 09 10:06:46 2010 +0200
@@ -18,6 +18,7 @@
 """Set of tree views / tree-building widgets, some based on jQuery treeview
 plugin.
 """
+
 __docformat__ = "restructuredtext en"
 
 from warnings import warn