projects
/
ffpreview.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e434bce
)
* Fixed str2int() to accept optional sign.
author
Urban Wallasch
<urban.wallasch@freenet.de>
Mon, 24 May 2021 15:14:34 +0000
(17:14 +0200)
committer
Urban Wallasch
<urban.wallasch@freenet.de>
Mon, 24 May 2021 15:14:34 +0000
(17:14 +0200)
ffpreview.py
patch
|
blob
|
history
diff --git
a/ffpreview.py
b/ffpreview.py
index 5a21620cf14f86c6d41b5e0fdc36efcc0a1d13f0..d1b0a0dcf94035cb4c0f2f701796645e1a21ef1e 100755
(executable)
--- a/
ffpreview.py
+++ b/
ffpreview.py
@@
-119,7
+119,7
@@
def str2int(s):
if type(s) == type(1):
return s
if s and type(s) == type(' '):
- return int(re.match(r'^\s*(\d+)', s).groups()[0])
+ return int(re.match(r'^\s*(
[+-]?
\d+)', s).groups()[0])
return 0
def str2float(s):