Format: text/x-python
⬇ Download File (605 B)
   1  # -*- coding: utf-8 -*-
   2  """Being removed
   3  """
   4  
   5  
   6  class LazyEvaluate(object):
   7      """This is used for formatting strings with values that need to be updated
   8      at that time, such as the current time or working directory."""
   9  
  10      def __init__(self, func, *args, **kwargs):
  11          self.func = func
  12          self.args = args
  13          self.kwargs = kwargs
  14  
  15      def __call__(self, **kwargs):
  16          self.kwargs.update(kwargs)
  17          return self.func(*self.args, **self.kwargs)
  18  
  19      def __str__(self):
  20          return str(self())
  21  
  22      def __format__(self, format_spec):
  23          return format(self(), format_spec)
  24