From 32ebfb7dee18df80703c3fb005610e888f45ba38 Mon Sep 17 00:00:00 2001 From: Ville Rantanen Date: Fri, 5 Nov 2021 10:33:55 +0200 Subject: [PATCH] reformat --- setup.py | 16 ++++++++-------- tsmark/__init__.py | 2 +- tsmark/__main__.py | 1 + tsmark/video_annotator.py | 6 +++--- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/setup.py b/setup.py index 1294c1f..bd41581 100644 --- a/setup.py +++ b/setup.py @@ -1,12 +1,14 @@ from distutils.core import setup import os -def version_reader(path): - for line in open(path,"rt").read(1024).split("\n"): - if line.startswith("VERSION"): - return line.split("=")[1].strip().replace('"',"") -version = version_reader(os.path.join("tsmark","__init__.py")) +def version_reader(path): + for line in open(path, "rt").read(1024).split("\n"): + if line.startswith("VERSION"): + return line.split("=")[1].strip().replace('"', "") + + +version = version_reader(os.path.join("tsmark", "__init__.py")) setup( name="tsmark", packages=["tsmark"], @@ -20,7 +22,5 @@ setup( "tsmark=tsmark:main", ], }, - install_requires = [ - 'opencv-python==4.5.3.56' - ] + install_requires=["opencv-python==4.5.3.56"], ) diff --git a/tsmark/__init__.py b/tsmark/__init__.py index e745da2..ec13cce 100644 --- a/tsmark/__init__.py +++ b/tsmark/__init__.py @@ -1,3 +1,3 @@ from tsmark.video_annotator import main -VERSION = "0.1" +VERSION = "0.1" diff --git a/tsmark/__main__.py b/tsmark/__main__.py index b315c8f..8e8c43c 100644 --- a/tsmark/__main__.py +++ b/tsmark/__main__.py @@ -1,2 +1,3 @@ from tsmark.video_annotator import main + main() diff --git a/tsmark/video_annotator.py b/tsmark/video_annotator.py index db217e3..3f3cff0 100755 --- a/tsmark/video_annotator.py +++ b/tsmark/video_annotator.py @@ -276,14 +276,14 @@ def main(): if k & 0xFF == ord("z"): # move to previous ts for ts in reversed(sorted(stamps)): - if ts < nr-1: - nr = ts-1 + if ts < nr - 1: + nr = ts - 1 read_next = True break if k & 0xFF == ord("c"): # move to previous ts for ts in sorted(stamps): if ts > nr: - nr = ts-1 + nr = ts - 1 read_next = True break