Mercurial > hg > TextShaper
comparison textshaper/decorator.py @ 28:fd626585c299
test decorator and fix errors
| author | Jeff Hammel <k0scist@gmail.com> |
|---|---|
| date | Sun, 23 Feb 2014 14:27:42 -0800 |
| parents | 4aba57a33376 |
| children | 88a69d587326 |
comparison
equal
deleted
inserted
replaced
| 27:4aba57a33376 | 28:fd626585c299 |
|---|---|
| 19 def __call__(self, text, *args, **kwargs): | 19 def __call__(self, text, *args, **kwargs): |
| 20 is_string = False | 20 is_string = False |
| 21 if isinstance(text, string): | 21 if isinstance(text, string): |
| 22 is_string = True | 22 is_string = True |
| 23 text = text.splitlines() | 23 text = text.splitlines() |
| 24 retval = self.function(*args, **kwargs) | 24 retval = self.function(text, *args, **kwargs) |
| 25 if is_string: | 25 if is_string: |
| 26 return self.line_separator.join(retval) | 26 return self.line_separator.join(retval) |
| 27 return retval | 27 return retval |
