backport stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Mon, 24 Oct 2011 13:19:23 +0200
changeset 8013 7b2b8a7fb96d
parent 8012 2080e476ece7 (current diff)
parent 8011 23552e79316f (diff)
child 8014 6ce4ff44b2cf
backport stable
view.py
--- a/doc/book/en/conf.py	Mon Oct 24 13:18:58 2011 +0200
+++ b/doc/book/en/conf.py	Mon Oct 24 13:19:23 2011 +0200
@@ -1,5 +1,5 @@
 # -*- coding: utf-8 -*-
-# copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
+# copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
 #
 # This file is part of CubicWeb.
@@ -66,7 +66,7 @@
 
 # General substitutions.
 project = 'CubicWeb'
-copyright = '2001-2010, Logilab'
+copyright = '2001-2011, Logilab'
 
 # The default replacements for |version| and |release|, also used in various
 # other places throughout the built documents.
--- a/misc/scripts/pyroforge2datafeed.py	Mon Oct 24 13:18:58 2011 +0200
+++ b/misc/scripts/pyroforge2datafeed.py	Mon Oct 24 13:19:23 2011 +0200
@@ -45,8 +45,8 @@
 
 from cubicweb.server import debugged
 todelete = {}
+host = source.config['base-url'].split('://')[1]
 for entity in rql('Any X WHERE X cw_source S, S eid %(s)s', {'s': source.eid}).entities():
-    with debugged('DBG_SQL'):
         etype = entity.__regid__
         if not source.support_entity(etype):
             print "source doesn't support %s, delete %s" % (etype, entity.eid)
@@ -55,7 +55,10 @@
         else:
             try:
                 entity.complete()
-            except:
+                if not host in entity.cwuri:
+                    print 'SKIP foreign entity', entity.cwuri, source.config['base-url']
+                    continue
+            except Exception:
                 print '%s %s much probably deleted, delete it (extid %s)' % (
                     etype, entity.eid, entity.cw_metainformation()['extid'])
             else:
--- a/view.py	Mon Oct 24 13:18:58 2011 +0200
+++ b/view.py	Mon Oct 24 13:19:23 2011 +0200
@@ -449,7 +449,7 @@
         if tr:
             translate = partial(display_name, self._cw)
         else:
-            translate = lambda val: val
+            translate = lambda val, *args,**kwargs: val
         # XXX [0] because of missing Union support
         rql_syntax_tree = self.cw_rset.syntax_tree()
         rqlstdescr = rql_syntax_tree.get_description(mainindex, translate)[0]
--- a/web/views/rdf.py	Mon Oct 24 13:18:58 2011 +0200
+++ b/web/views/rdf.py	Mon Oct 24 13:19:23 2011 +0200
@@ -89,17 +89,14 @@
                             except xy.UnsupportedVocabulary:
                                 pass
                     else:
-                        try:
-                            for related in entity.related(rtype, role, entities=True, safe=True):
-                                if role == 'subject':
-                                    add( (cwuri, CW[rtype], URIRef(related.cwuri)) )
-                                    try:
-                                        for item in xy.xeq('%s %s' % (entity.e_schema.type, rtype)):
-                                            add( (cwuri, urijoin(item), URIRef(related.cwuri)) )
-                                    except xy.UnsupportedVocabulary:
-                                        pass
-                                else:
-                                    add( (URIRef(related.cwuri), CW[rtype], cwuri) )
-                        except Unauthorized:
-                            pass
+                        for related in entity.related(rtype, role, entities=True, safe=True):
+                            if role == 'subject':
+                                add( (cwuri, CW[rtype], URIRef(related.cwuri)) )
+                                try:
+                                    for item in xy.xeq('%s %s' % (entity.e_schema.type, rtype)):
+                                        add( (cwuri, urijoin(item), URIRef(related.cwuri)) )
+                                except xy.UnsupportedVocabulary:
+                                    pass
+                            else:
+                                add( (URIRef(related.cwuri), CW[rtype], cwuri) )