* Fixed str2int() to accept optional sign.
authorUrban Wallasch <urban.wallasch@freenet.de>
Mon, 24 May 2021 15:14:34 +0000 (17:14 +0200)
committerUrban Wallasch <urban.wallasch@freenet.de>
Mon, 24 May 2021 15:14:34 +0000 (17:14 +0200)
ffpreview.py

index 5a21620cf14f86c6d41b5e0fdc36efcc0a1d13f0..d1b0a0dcf94035cb4c0f2f701796645e1a21ef1e 100755 (executable)
@@ -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):