[server/sources] fix docstring for eid_type_source

authorJulien Cristau <julien.cristau@logilab.fr>
changeset036f5964e6fe
branchdefault
phasepublic
hiddenno
parent revision#6a07c2dc3d85 [views] fix ProcessInformationView: SESSION_MANAGER can be None (closes #5753280)
child revision#1ee631aedf2f [server/sources] AbstractSource.__ne__
files modified by this revision
server/sources/__init__.py
server/sources/native.py
# HG changeset patch
# User Julien Cristau <julien.cristau@logilab.fr>
# Date 1437746977 -7200
# Fri Jul 24 16:09:37 2015 +0200
# Node ID 036f5964e6fe33ee3ed18631975092202c04d284
# Parent 6a07c2dc3d85f4de0cf48221607e02c4473e11e4
[server/sources] fix docstring for eid_type_source

diff --git a/server/sources/__init__.py b/server/sources/__init__.py
@@ -393,11 +393,11 @@
1          raise NotImplementedError(self)
2 
3      # system source interface #################################################
4 
5      def eid_type_source(self, cnx, eid):
6 -        """return a tuple (type, source, extid) for the entity with id <eid>"""
7 +        """return a tuple (type, extid, source) for the entity with id <eid>"""
8          raise NotImplementedError(self)
9 
10      def create_eid(self, cnx):
11          raise NotImplementedError(self)
12 
diff --git a/server/sources/native.py b/server/sources/native.py
@@ -847,21 +847,21 @@
13          except Exception:
14              self.exception('failed to query entities table for eid %s', eid)
15          raise UnknownEid(eid)
16 
17      def eid_type_source(self, cnx, eid): # pylint: disable=E0202
18 -        """return a tuple (type, source, extid) for the entity with id <eid>"""
19 +        """return a tuple (type, extid, source) for the entity with id <eid>"""
20          sql = 'SELECT type, extid, asource FROM entities WHERE eid=%s' % eid
21          res = self._eid_type_source(cnx, eid, sql)
22          if res[-2] is not None:
23              if not isinstance(res, list):
24                  res = list(res)
25              res[-2] = b64decode(res[-2])
26          return res
27 
28      def eid_type_source_pre_131(self, cnx, eid):
29 -        """return a tuple (type, source, extid) for the entity with id <eid>"""
30 +        """return a tuple (type, extid, source) for the entity with id <eid>"""
31          sql = 'SELECT type, extid FROM entities WHERE eid=%s' % eid
32          res = self._eid_type_source(cnx, eid, sql)
33          if not isinstance(res, list):
34              res = list(res)
35          if res[-1] is not None: