Show More
@@ -1,26 +1,23 b'' | |||
|
1 | 1 | # -*- coding: utf-8 -*- |
|
2 | 2 | """Being removed |
|
3 | 3 | """ |
|
4 | 4 | |
|
5 | 5 | from IPython.utils import py3compat |
|
6 | 6 | |
|
7 | 7 | class LazyEvaluate(object): |
|
8 | 8 | """This is used for formatting strings with values that need to be updated |
|
9 | 9 | at that time, such as the current time or working directory.""" |
|
10 | 10 | def __init__(self, func, *args, **kwargs): |
|
11 | 11 | self.func = func |
|
12 | 12 | self.args = args |
|
13 | 13 | self.kwargs = kwargs |
|
14 | 14 | |
|
15 | 15 | def __call__(self, **kwargs): |
|
16 | 16 | self.kwargs.update(kwargs) |
|
17 | 17 | return self.func(*self.args, **self.kwargs) |
|
18 | 18 | |
|
19 | 19 | def __str__(self): |
|
20 | 20 | return str(self()) |
|
21 | ||
|
22 | def __unicode__(self): | |
|
23 | return self.__str__() | |
|
24 | ||
|
21 | ||
|
25 | 22 | def __format__(self, format_spec): |
|
26 | 23 | return format(self(), format_spec) |
General Comments 0
You need to be logged in to leave comments.
Login now