Only markdownify $target if move.range exists.

This commit is contained in:
Lynn "Zhorken" Vaughan 2012-08-06 14:08:46 -04:00
parent c00bc4cad2
commit 95422bc985

View file

@ -99,14 +99,19 @@ def _markdownify_effect_text(move, effect_text, language=None):
effect_text = effect_text.replace(
u'$effect_chance',
unicode(move.effect_chance),
).replace(
u'$target',
_target_labels[move.range.targets > 1]
).replace(
u'$Target',
_target_labels[move.range.targets > 1].capitalize()
)
# "The target" vs "each target"; for Conquest, but hopefully main series
# moves too eventually
if hasattr(move, 'range'):
effect_text = effect_text.replace(
u'$target',
_target_labels[move.range.targets > 1]
).replace(
u'$Target',
_target_labels[move.range.targets > 1].capitalize()
)
return MarkdownString(effect_text, session, language)
_target_labels = {