# HG changeset patch # User Sylvain Thénault # Date 1319455163 -7200 # Node ID 7b2b8a7fb96dce7e4853dff045990640700446ed # Parent 2080e476ece7d770f42810479113382b58dea5d9# Parent 23552e79316f32650f703f935be092398c53e0a6 backport stable diff -r 2080e476ece7 -r 7b2b8a7fb96d doc/book/en/conf.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. diff -r 2080e476ece7 -r 7b2b8a7fb96d misc/scripts/pyroforge2datafeed.py --- 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: diff -r 2080e476ece7 -r 7b2b8a7fb96d view.py --- 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] diff -r 2080e476ece7 -r 7b2b8a7fb96d web/views/rdf.py --- 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) )