Skip to content

Commit

Permalink
python2.5 doesn't support .format for strings. Fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
chibisov committed Dec 17, 2011
1 parent 78444d6 commit 454f6ea
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions lettuce/terrain.py
Expand Up @@ -44,19 +44,19 @@ def __init__(self, callback):
@classmethod
def _add_method(cls, name, where, when):
def method(self, fn):
CALLBACK_REGISTRY.append_to(where, when.format(self.name), fn)
CALLBACK_REGISTRY.append_to(where, when % {'0': self.name}, fn)
method.__name__ = method.fn_name = name
setattr(cls, name, method)

for name, where, when in (
('all', 'all', '{0}'),
('each_step', 'step', '{0}_each'),
('each_scenario', 'scenario', '{0}_each'),
('each_feature', 'feature', '{0}_each'),
('harvest', 'harvest', '{0}'),
('each_app', 'app', '{0}_each'),
('runserver', 'runserver', '{0}'),
('handle_request', 'handle_request', '{0}'),
('all', 'all', '%(0)s'),
('each_step', 'step', '%(0)s_each'),
('each_scenario', 'scenario', '%(0)s_each'),
('each_feature', 'feature', '%(0)s_each'),
('harvest', 'harvest', '%(0)s'),
('each_app', 'app', '%(0)s_each'),
('runserver', 'runserver', '%(0)s'),
('handle_request', 'handle_request', '%(0)s'),
('outline', 'scenario', 'outline')):
Main._add_method(name, where, when)

Expand Down

0 comments on commit 454f6ea

Please sign in to comment.