projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
46f59e8
)
[utils] Add strip_or_none
author
Sergey M․
<dstftw@gmail.com>
Sat, 25 Jun 2016 15:32:02 +0000
(22:32 +0700)
committer
Sergey M․
<dstftw@gmail.com>
Sat, 25 Jun 2016 16:19:18 +0000
(23:19 +0700)
youtube_dl/utils.py
patch
|
blob
|
history
diff --git
a/youtube_dl/utils.py
b/youtube_dl/utils.py
index de66cb482730b564375e227da64b4240566ea3f5..a375282f231d507bda3099b85133092396441afe 100644
(file)
--- a/
youtube_dl/utils.py
+++ b/
youtube_dl/utils.py
@@
-1660,6
+1660,10
@@
def float_or_none(v, scale=1, invscale=1, default=None):
return default
+def strip_or_none(v):
+ return None if v is None else v.strip()
+
+
def parse_duration(s):
if not isinstance(s, compat_basestring):
return None