summaryrefslogtreecommitdiffstats
path: root/doc/ext
diff options
context:
space:
mode:
authorBoris Pavlovic <boris@pavlovic.me>2013-05-17 17:38:51 +0400
committerBoris Pavlovic <boris@pavlovic.me>2013-05-18 00:04:17 +0400
commit2dce8c92f6cfc4fb5d6a455fe13cbc0ed6d72882 (patch)
tree2bee70e0e0d4847b20dad29500600825b20c06d7 /doc/ext
parentf124d50024fbddb56733831149012f6f4c9c3e6e (diff)
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
Diffstat (limited to 'doc/ext')
-rw-r--r--doc/ext/nova_todo.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/doc/ext/nova_todo.py b/doc/ext/nova_todo.py
index 979a176cf..6f66e2573 100644
--- a/doc/ext/nova_todo.py
+++ b/doc/ext/nova_todo.py
@@ -37,13 +37,13 @@ def process_todo_nodes(app, doctree, fromdocname):
for todo_info in env.todo_all_todos:
para = nodes.paragraph()
- filename = env.doc2path(todo_info['docname'], base=None)
-
# Create a reference
newnode = nodes.reference('', '')
- line_info = todo_info['lineno']
- link = _('%(filename)s, line %(line_info)d') % locals()
+ filename = env.doc2path(todo_info['docname'], base=None)
+ link = (_('%(filename)s, line %(line_info)d') %
+ {'filename': filename, 'line_info': todo_info['lineno']})
+
innernode = nodes.emphasis(link, link)
newnode['refdocname'] = todo_info['docname']