Skip to content

Commit e9c58f7

Browse files
authored
Merge pull request faif#192 from fkromer/setter_injection
ENH: string concatenations everywhere (in setter injection)
2 parents 76653ca + 1dd71c9 commit e9c58f7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

dft/setter_injection.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def __init__(self):
1717
1818
def get_current_time_as_html_fragment(self):
1919
current_time = self.time_provider.now()
20-
current_time_as_html_fragment = "<span class=\"tinyBoldText\">" + current_time.hour + ":" + current_time.minute + "</span>"
20+
current_time_as_html_fragment = "<span class=\"tinyBoldText\">{}</span>".format(current_time)
2121
return current_time_as_html_fragment
2222
"""
2323

@@ -31,7 +31,7 @@ def set_time_provider(self, time_provider):
3131

3232
def get_current_time_as_html_fragment(self):
3333
current_time = self.time_provider.now()
34-
current_time_as_html_fragment = "<span class=\"tinyBoldText\">" + current_time + "</span>"
34+
current_time_as_html_fragment = "<span class=\"tinyBoldText\">{}</span>".format(current_time)
3535
return current_time_as_html_fragment
3636

3737
class ProductionCodeTimeProvider(object):
@@ -42,7 +42,7 @@ class ProductionCodeTimeProvider(object):
4242

4343
def now(self):
4444
current_time = datetime.datetime.now()
45-
current_time_formatted = str(current_time.hour) + ":" + str(current_time.minute)
45+
current_time_formatted = "{}:{}".format(current_time.hour, current_time.minute)
4646
return current_time_formatted
4747

4848
class MidnightTimeProvider(object):

0 commit comments

Comments
 (0)