Commit Graph

14 Commits

Author SHA1 Message Date
Petr Viktorin
3bf91eab25 Use Python3-compatible dict method names
Python 2 has keys()/values()/items(), which return lists,
iterkeys()/itervalues()/iteritems(), which return iterators,
and viewkeys()/viewvalues()/viewitems() which return views.

Python 3 has only keys()/values()/items(), which return views.
To get iterators, one can use iter() or a for loop/comprehension;
for lists there's the list() constructor.

When iterating through the entire dict, without modifying the dict,
 the difference between Python 2's items() and iteritems() is
negligible, especially on small dicts (the main overhead is
extra memory, not CPU time). In the interest of simpler code,
this patch changes many instances of iteritems() to items(),
iterkeys() to keys() etc.

In other cases, helpers like six.itervalues are used.

Reviewed-By: Christian Heimes <cheimes@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-09-01 11:42:01 +02:00
Petr Viktorin
5435a8a32a Use absolute imports
In Python 3, implicit relative imports will not be supported.
Use fully-qualified imports everywhere.

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2015-08-12 18:17:23 +02:00
Pavel Zuna
6eb70ea8e2 Remove deprecated i18n code from ipalib/request and all references to it.
Ticket #903
2011-03-01 10:31:36 -05:00
Jakub Hrozek
7493d781df Change FreeIPA license to GPLv3+
The changes include:
 * Change license blobs in source files to mention GPLv3+ not GPLv2 only
 * Add GPLv3+ license text
 * Package COPYING not LICENSE as the license blobs (even the old ones)
   mention COPYING specifically, it is also more common, I think

 https://fedorahosted.org/freeipa/ticket/239
2010-12-20 17:19:53 -05:00
Jason Gerard DeRose
c350f84134 Finish deferred translation mechanism 2010-03-16 11:41:22 -06:00
Pavel Zuna
314fe71787 Allow creation of new connections by unshared instances of backend.Connectible. 2010-01-11 13:51:05 -05:00
Jason Gerard DeRose
66b6029e40 Ported xmlclient to subclass from Connectible 2009-02-03 15:29:03 -05:00
Jason Gerard DeRose
f7375bb609 Added stuff for managing connections and new Executioner backend base class 2009-02-03 15:29:03 -05:00
Jason Gerard DeRose
c161784973 Added request.ugettext() and request.ungettext() functions; added corresponding unit tests 2009-01-04 00:46:21 -07:00
Jason Gerard DeRose
c081ce5460 request.create_translation() now sets context.ugettext and context.ungettext 2009-01-03 22:03:37 -07:00
Jason Gerard DeRose
0d3ddef93b Started fleshing out reoganization of errors in errors.py (with gettext support) 2009-01-03 02:35:36 -07:00
Jason Gerard DeRose
6b055b435f Cleaned up Env.__setattr__() and Env.__setitem__() a bit updated their unit tests 2008-12-22 17:29:11 -07:00
Jason Gerard DeRose
9a69adeef0 Added request.create_translation() function and corresponding unit tests 2008-12-18 16:58:48 -07:00
Jason Gerard DeRose
dc54dee622 Started work on per-request gettext setup 2008-12-18 14:01:59 -07:00