From 5ba01256a483b8dad94f05d65750ef49576960b4 Mon Sep 17 00:00:00 2001 From: Aleksei Kuzmin Date: Tue, 11 Sep 2018 14:53:23 +0200 Subject: [PATCH] chore: fix pylint errors --- script/bump-version.py | 2 +- script/verify-ffmpeg.py | 19 ++++++++++++------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/script/bump-version.py b/script/bump-version.py index 180a83f8a858..fdb98d6d41c6 100755 --- a/script/bump-version.py +++ b/script/bump-version.py @@ -116,7 +116,7 @@ def increase_version(versions, index): def update_electron_gyp(version, suffix): - assert(False, "electron.gyp must not be used anymore. We build with GN now.") + assert False, "electron.gyp must not be used anymore. We build with GN now." pattern = re.compile(" *'version%' *: *'[0-9.]+(-beta[0-9.]*)?(-dev)?" + "(-nightly[0-9.]*)?'") diff --git a/script/verify-ffmpeg.py b/script/verify-ffmpeg.py index f6cea8a95e85..940a33f083f2 100755 --- a/script/verify-ffmpeg.py +++ b/script/verify-ffmpeg.py @@ -15,11 +15,12 @@ SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) def main(): args = parse_args() - initial_app_path = os.path.join(os.path.abspath(args.source_root), args.build_dir) + source_root = os.path.abspath(args.source_root) + initial_app_path = os.path.join(source_root, args.build_dir) app_path = create_app_copy(initial_app_path) # Those are the same in the original app and its copy. - # So it is ok to retrieve them from the original build dir and use in the copy. + # So it is ok to get them from the original build dir and use in the copy. product_name = gn(initial_app_path).args().get_string('electron_product_name') project_name = gn(initial_app_path).args().get_string('electron_project_name') @@ -39,7 +40,7 @@ def main(): ffmpeg_name = 'libffmpeg.so' # Copy ffmpeg without proprietary codecs into app. - ffmpeg_lib_path = os.path.join(os.path.abspath(args.source_root), args.ffmpeg_path, ffmpeg_name) + ffmpeg_lib_path = os.path.join(source_root, args.ffmpeg_path, ffmpeg_name) shutil.copy(ffmpeg_lib_path, ffmpeg_app_path) returncode = 0 @@ -60,10 +61,12 @@ def main(): # Create copy of app to install ffmpeg library without proprietary codecs into def create_app_copy(initial_app_path): app_path = os.path.join(os.path.dirname(initial_app_path), - os.path.basename(initial_app_path) + '-no-proprietary-codecs') + os.path.basename(initial_app_path) + + '-no-proprietary-codecs') if sys.platform == 'darwin': - product_name = gn(initial_app_path).args().get_string('electron_product_name') + product_name = gn(initial_app_path).args().get_string( + 'electron_product_name') app_name = '{0}.app'.format(product_name) initial_app_path = os.path.join(initial_app_path, app_name) app_path = os.path.join(app_path, app_name) @@ -75,14 +78,16 @@ def create_app_copy(initial_app_path): def parse_args(): parser = argparse.ArgumentParser(description='Test non-proprietary ffmpeg') parser.add_argument('-b', '--build-dir', - help='Path to an Electron build folder. Relative to the --source-root.', + help='Path to an Electron build folder. \ + Relative to the --source-root.', default=None, required=True) parser.add_argument('--source-root', default=SOURCE_ROOT, required=False) parser.add_argument('--ffmpeg-path', - help='Path to a folder with a ffmpeg lib. Relative to the --source-root.', + help='Path to a folder with a ffmpeg lib. \ + Relative to the --source-root.', default=None, required=True) return parser.parse_args()