9 Commits

Author SHA1 Message Date
Victor Stinner
b259659a22 Use six.moves.range for Python 3
The function xrange() was renamed to range() in Python 3.

Use "from six.moves import range" to get xrange() on Python 2 and range() on
Python 3 as the name "range", and replace "xrange()" with "range()".

The import is omitted for small ranges (1024 items or less).

This patch was generated by the following tool (revision 0c1d096b3903)
with the "xrange" operation:
https://bitbucket.org/haypo/misc/src/tip/python/sixer.py

Manual change:

* Replace range(n) with list(range(n)) in a loop of
  nova/virt/libvirt/driver.py which uses list.pop()

Blueprint nova-python3
Change-Id: Iceda35cace04cc8ddc6adbd59df4613b22b39793
2015-05-20 15:19:51 -07:00
Boris Pavlovic
2dce8c92f6 Remove usage of locals() for formatting from nova.api.*
Using of locals() for formatting string is a nasty thing because:
1) It is not so clear as using explicit dicts
2) It could produce hidden errors during refactoring
3) Changing name of variable causes change in message
4) Creating a lot of unused variables

fixes bug 1171936
Change-Id: I293d7ebb875f65cce322d4938d1ae323f3aded8d
2013-05-18 00:04:17 +04:00
lrqrun
9ddd714f08 Fix PEP8 issues.
Fix some pep8 issues in doc/ext/nova_todo.py make the code looks pretty.

Change-Id: I026c873b487b507a758a2cdb70b444b64702b7fa
2012-08-28 23:13:11 +08:00
Ray Chen
9424514e6f Fix PEP8 issues
Fix some PEP8 issues in doc/ext/nova_todo.py and doc/source/conf.py
and make the code look more clearly.

Change-Id: I2b0ce1b09a4a707cffaa565747aabd5346eb9f41
2012-08-17 11:35:57 +08:00
Vishvananda Ishaya
20b4d89512 Remove a whole bunch of unused imports
Change-Id: I6759e5b6250c48cc0deb4b198b44c948c64c47d1
2012-01-13 13:55:38 -08:00
Lorin Hochstein
d4a3962a2d Fix deprecation warnings
Fixed some warnings like this:

DeprecationWarning: docutils.nodes.Element.set_class deprecated; append to
Element['classes'] list attribute directly
  lists[i].set_class('todo_list')

Change-Id: I94e564f561f95a66e6e98767ccfaa78769b5c0f1
2011-11-24 10:54:21 -05:00
Ed Leafe
68c9c89300 Completed first pass at converting all localized strings with multiple format substitutions. 2011-01-18 21:00:28 -05:00
root
1a020c2713 notes, and add code to enable sorted "..todo:: P[1-5] xyz" syntax 2010-11-12 09:25:01 -08:00
root
dd505245c2 add in custom todo, and custom css 2010-11-05 12:49:42 -07:00