# HG changeset patch # User Samuel Trégouët # Date 1441980070 -7200 # Node ID 03ce3d24db8750994a67ab01faa02c020dd7cee7 # Parent dfa1dcf4d7f15994f595750e6b039e7f936afc49 [py3k] tuple unpacking in function args diff -r dfa1dcf4d7f1 -r 03ce3d24db87 rset.py --- a/rset.py Fri Sep 11 15:52:18 2015 +0200 +++ b/rset.py Fri Sep 11 16:01:10 2015 +0200 @@ -215,10 +215,10 @@ rset = self.copy(rows, descr) if col >= 0: entities = sorted(enumerate(self.entities(col)), - key=lambda (i, e): keyfunc(e), reverse=reverse) + key=lambda t: keyfunc(t[1]), reverse=reverse) else: entities = sorted(enumerate(self), - key=lambda (i, e): keyfunc(e), reverse=reverse) + key=lambda t: keyfunc(t[1]), reverse=reverse) for index, _ in entities: rows.append(self.rows[index]) descr.append(self.description[index]) diff -r dfa1dcf4d7f1 -r 03ce3d24db87 sobjects/supervising.py --- a/sobjects/supervising.py Fri Sep 11 15:52:18 2015 +0200 +++ b/sobjects/supervising.py Fri Sep 11 16:01:10 2015 +0200 @@ -128,13 +128,15 @@ # XXX print changes self.w(u' %s' % changedescr.entity.absolute_url()) - def delete_entity(self, (eid, etype, title)): + def delete_entity(self, args): + eid, etype, title = args msg = self._cw._('deleted %(etype)s #%(eid)s (%(title)s)') etype = display_name(self._cw, etype).lower() self.w(msg % locals()) - def change_state(self, (entity, fromstate, tostate)): + def change_state(self, args): _ = self._cw._ + entity, fromstate, tostate = args msg = _('changed state of %(etype)s #%(eid)s (%(title)s)') self.w(u'%s\n' % (msg % self._entity_context(entity))) self.w(_(' from state %(fromstate)s to state %(tostate)s\n' % diff -r dfa1dcf4d7f1 -r 03ce3d24db87 web/http_headers.py --- a/web/http_headers.py Fri Sep 11 15:52:18 2015 +0200 +++ b/web/http_headers.py Fri Sep 11 16:01:10 2015 +0200 @@ -766,7 +766,8 @@ v = [field.strip().lower() for field in v.split(',')] return k, v -def generateCacheControl((k, v)): +def generateCacheControl(args): + k, v = args if v is None: return str(k) else: diff -r dfa1dcf4d7f1 -r 03ce3d24db87 web/views/autoform.py --- a/web/views/autoform.py Fri Sep 11 15:52:18 2015 +0200 +++ b/web/views/autoform.py Fri Sep 11 16:01:10 2015 +0200 @@ -490,7 +490,8 @@ pendings.remove( (int(eidfrom), rel, int(eidto)) ) @ajaxfunc(output_type='json') -def remove_pending_insert(self, (eidfrom, rel, eidto)): +def remove_pending_insert(self, args): + eidfrom, rel, eidto = args _remove_pending(self._cw, eidfrom, rel, eidto, 'insert') @ajaxfunc(output_type='json') @@ -499,11 +500,13 @@ _add_pending(self._cw, eidfrom, rel, eidto, 'insert') @ajaxfunc(output_type='json') -def remove_pending_delete(self, (eidfrom, rel, eidto)): +def remove_pending_delete(self, args): + eidfrom, rel, eidto = args _remove_pending(self._cw, eidfrom, rel, eidto, 'delete') @ajaxfunc(output_type='json') -def add_pending_delete(self, (eidfrom, rel, eidto)): +def add_pending_delete(self, args): + eidfrom, rel, eidto = args _add_pending(self._cw, eidfrom, rel, eidto, 'delete') diff -r dfa1dcf4d7f1 -r 03ce3d24db87 web/views/startup.py --- a/web/views/startup.py Fri Sep 11 15:52:18 2015 +0200 +++ b/web/views/startup.py Fri Sep 11 16:01:10 2015 +0200 @@ -106,7 +106,7 @@ def entity_types_table(self, eschemas): infos = sorted(self.entity_types(eschemas), - key=lambda (l,a,e): unormalize(l)) + key=lambda t: unormalize(t[0])) q, r = divmod(len(infos), 2) if r: infos.append( (None, ' ', ' ') )