summaryrefslogtreecommitdiffhomepage
path: root/libs/ffsubsync/ffsubsync_gui.py
diff options
context:
space:
mode:
authormorpheus65535 <[email protected]>2022-01-23 23:07:52 -0500
committermorpheus65535 <[email protected]>2022-01-23 23:07:52 -0500
commit0c3c5a02a75bc61b6bf6e303de20e11741d2afac (patch)
tree30ae1d524ffe5d54172b7a4a8445d90c3461e659 /libs/ffsubsync/ffsubsync_gui.py
parent36bf0d219d0432c20e6314e0ce752b36f4d88e3c (diff)
downloadbazarr-0c3c5a02a75bc61b6bf6e303de20e11741d2afac.tar.gz
bazarr-0c3c5a02a75bc61b6bf6e303de20e11741d2afac.zip
Upgraded vendored Python dependencies to the latest versions and removed the unused dependencies.v1.0.3-beta.16
Diffstat (limited to 'libs/ffsubsync/ffsubsync_gui.py')
-rwxr-xr-xlibs/ffsubsync/ffsubsync_gui.py96
1 files changed, 56 insertions, 40 deletions
diff --git a/libs/ffsubsync/ffsubsync_gui.py b/libs/ffsubsync/ffsubsync_gui.py
index 9bf836512..1bdb45031 100755
--- a/libs/ffsubsync/ffsubsync_gui.py
+++ b/libs/ffsubsync/ffsubsync_gui.py
@@ -6,7 +6,7 @@ import sys
from gooey import Gooey, GooeyParser
-from .constants import (
+from ffsubsync.constants import (
RELEASE_URL,
WEBSITE,
DEV_WEBSITE,
@@ -17,11 +17,12 @@ from .constants import (
COPYRIGHT_YEAR,
SUBSYNC_RESOURCES_ENV_MAGIC,
)
+
# set the env magic so that we look for resources in the right place
if SUBSYNC_RESOURCES_ENV_MAGIC not in os.environ:
- os.environ[SUBSYNC_RESOURCES_ENV_MAGIC] = getattr(sys, '_MEIPASS', '')
-from .ffsubsync import run, add_cli_only_args
-from .version import get_version, update_available
+ os.environ[SUBSYNC_RESOURCES_ENV_MAGIC] = getattr(sys, "_MEIPASS", "")
+from ffsubsync.ffsubsync import run, add_cli_only_args
+from ffsubsync.version import get_version, update_available
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
@@ -29,65 +30,80 @@ logger = logging.getLogger(__name__)
_menu = [
{
- 'name': 'File',
- 'items': [
+ "name": "File",
+ "items": [
{
- 'type': 'AboutDialog',
- 'menuTitle': 'About',
- 'name': PROJECT_NAME,
- 'description': LONG_DESCRIPTION,
- 'version': get_version(),
- 'copyright': COPYRIGHT_YEAR,
- 'website': WEBSITE,
- 'developer': DEV_WEBSITE,
- 'license': PROJECT_LICENSE,
+ "type": "AboutDialog",
+ "menuTitle": "About",
+ "name": PROJECT_NAME,
+ "description": LONG_DESCRIPTION,
+ "version": get_version(),
+ "copyright": COPYRIGHT_YEAR,
+ "website": WEBSITE,
+ "developer": DEV_WEBSITE,
+ "license": PROJECT_LICENSE,
},
{
- 'type': 'Link',
- 'menuTitle': 'Download latest release',
- 'url': RELEASE_URL,
- }
- ]
+ "type": "Link",
+ "menuTitle": "Download latest release",
+ "url": RELEASE_URL,
+ },
+ ],
}
]
@Gooey(
program_name=PROJECT_NAME,
- image_dir=os.path.join(os.environ[SUBSYNC_RESOURCES_ENV_MAGIC], 'img'),
+ image_dir=os.path.join(os.environ[SUBSYNC_RESOURCES_ENV_MAGIC], "img"),
menu=_menu,
tabbed_groups=True,
progress_regex=r"(\d+)%",
- hide_progress_msg=True
+ hide_progress_msg=True,
)
def make_parser():
description = DESCRIPTION
if update_available():
description += '\nUpdate available! Please go to "File" -> "Download latest release" to update FFsubsync.'
parser = GooeyParser(description=description)
- main_group = parser.add_argument_group('Basic')
+ main_group = parser.add_argument_group("Basic")
+ main_group.add_argument(
+ "reference",
+ help="Reference (video or subtitles file) to which to synchronize input subtitles.",
+ widget="FileChooser",
+ )
+ main_group.add_argument("srtin", help="Input subtitles file", widget="FileChooser")
main_group.add_argument(
- 'reference',
- help='Reference (video or subtitles file) to which to synchronize input subtitles.',
- widget='FileChooser'
+ "-o",
+ "--srtout",
+ help="Output subtitles file (default=${srtin}.synced.srt).",
+ widget="FileSaver",
)
- main_group.add_argument('srtin', help='Input subtitles file', widget='FileChooser')
- main_group.add_argument('-o', '--srtout',
- help='Output subtitles file (default=${srtin}.synced.srt).',
- widget='FileSaver')
- advanced_group = parser.add_argument_group('Advanced')
+ advanced_group = parser.add_argument_group("Advanced")
# TODO: these are shared between gui and cli; don't duplicate this code
- advanced_group.add_argument('--merge-with-reference', '--merge', action='store_true',
- help='Merge reference subtitles with synced output subtitles.')
- advanced_group.add_argument('--make-test-case', '--create-test-case', action='store_true',
- help='If specified, create a test archive a few KiB in size '
- 'to send to the developer as a debugging aid.')
advanced_group.add_argument(
- '--reference-stream', '--refstream', '--reference-track', '--reftrack', default=None,
- help='Which stream/track in the video file to use as reference, '
- 'formatted according to ffmpeg conventions. For example, s:0 '
- 'uses the first subtitle track; a:3 would use the fourth audio track.'
+ "--merge-with-reference",
+ "--merge",
+ action="store_true",
+ help="Merge reference subtitles with synced output subtitles.",
+ )
+ advanced_group.add_argument(
+ "--make-test-case",
+ "--create-test-case",
+ action="store_true",
+ help="If specified, create a test archive a few KiB in size "
+ "to send to the developer as a debugging aid.",
+ )
+ advanced_group.add_argument(
+ "--reference-stream",
+ "--refstream",
+ "--reference-track",
+ "--reftrack",
+ default=None,
+ help="Which stream/track in the video file to use as reference, "
+ "formatted according to ffmpeg conventions. For example, s:0 "
+ "uses the first subtitle track; a:3 would use the fourth audio track.",
)
return parser