Skip to content
Snippets Groups Projects
Commit e85c54c9 authored by Sébastien Helleu's avatar Sébastien Helleu
Browse files

Don't check translation of mapping keys in Python string formatters

parent efc66ab1
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -38,7 +38,7 @@ STR_FORMATTERS.update({
'python': (
(r'[\%]{2}', '%'),
(r'\%([.\d]+)?[bcdeEfFgGnosxX]', r''),
(r'\%(\(([^)]*)\))([.\d]+)?[bcdeEfFgGnosxX]', r'\g<2>'),
(r'\%(\([^)]*\))([.\d]+)?[bcdeEfFgGnosxX]', r''),
(r'\{([^\:\}]*)?(:[^\}]*)?\}', r''),
),
})
Loading
Loading
Loading
Loading
@@ -127,8 +127,8 @@ class TestMsgCheck(unittest.TestCase): # pylint: disable=too-many-public-method
self.assertEqual(replace_formatters('%b', 'python'), '')
self.assertEqual(replace_formatters('%%', 'python'), '%')
self.assertEqual(replace_formatters('%.02f', 'python'), '')
self.assertEqual(replace_formatters('%(sth)s', 'python'), 'sth')
self.assertEqual(replace_formatters('%(sth)02f', 'python'), 'sth')
self.assertEqual(replace_formatters('%(sth)s', 'python'), '')
self.assertEqual(replace_formatters('%(sth)02f', 'python'), '')
# str.format()
conditions = (
('First, thou shalt count to {0}',
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment