From 6b1dd0d413505a9b5d03341b7215d0255898fd33 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sun, 12 Apr 2015 12:00:02 +0800 Subject: [PATCH] s3_config should be in lib.config --- script/lib/config.py | 11 +++++++++++ script/lib/util.py | 11 ----------- script/upload-checksums.py | 3 ++- script/upload-index-json.py | 4 ++-- script/upload-node-headers.py | 4 ++-- script/upload-windows-pdb.py | 3 ++- 6 files changed, 19 insertions(+), 17 deletions(-) diff --git a/script/lib/config.py b/script/lib/config.py index a45822aa1727..7fb314ac9a27 100644 --- a/script/lib/config.py +++ b/script/lib/config.py @@ -47,6 +47,17 @@ def get_target_arch(): return 'x64' +def s3_config(): + config = (os.environ.get('ATOM_SHELL_S3_BUCKET', ''), + os.environ.get('ATOM_SHELL_S3_ACCESS_KEY', ''), + os.environ.get('ATOM_SHELL_S3_SECRET_KEY', '')) + message = ('Error: Please set the $ATOM_SHELL_S3_BUCKET, ' + '$ATOM_SHELL_S3_ACCESS_KEY, and ' + '$ATOM_SHELL_S3_SECRET_KEY environment variables') + assert all(len(c) for c in config), message + return config + + def enable_verbose_mode(): print 'Running in verbose mode' global verbose_mode diff --git a/script/lib/util.py b/script/lib/util.py index 698da95080a4..886415898591 100644 --- a/script/lib/util.py +++ b/script/lib/util.py @@ -176,17 +176,6 @@ def parse_version(version): return vs + ['0'] * (4 - len(vs)) -def s3_config(): - config = (os.environ.get('ATOM_SHELL_S3_BUCKET', ''), - os.environ.get('ATOM_SHELL_S3_ACCESS_KEY', ''), - os.environ.get('ATOM_SHELL_S3_SECRET_KEY', '')) - message = ('Error: Please set the $ATOM_SHELL_S3_BUCKET, ' - '$ATOM_SHELL_S3_ACCESS_KEY, and ' - '$ATOM_SHELL_S3_SECRET_KEY environment variables') - assert all(len(c) for c in config), message - return config - - def s3put(bucket, access_key, secret_key, prefix, key_prefix, files): args = [ 's3put', diff --git a/script/upload-checksums.py b/script/upload-checksums.py index b0378d834bc7..19b6643c6d92 100755 --- a/script/upload-checksums.py +++ b/script/upload-checksums.py @@ -5,7 +5,8 @@ import hashlib import os import tempfile -from lib.util import download, rm_rf, s3_config, s3put +from lib.config import s3_config +from lib.util import download, rm_rf, s3put DIST_URL = 'https://atom.io/download/atom-shell/' diff --git a/script/upload-index-json.py b/script/upload-index-json.py index 52f441b70194..6bec55f2a98a 100755 --- a/script/upload-index-json.py +++ b/script/upload-index-json.py @@ -3,8 +3,8 @@ import os import sys -from lib.config import PLATFORM -from lib.util import execute, s3_config, s3put, scoped_cwd +from lib.config import PLATFORM, s3_config +from lib.util import execute, s3put, scoped_cwd SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) diff --git a/script/upload-node-headers.py b/script/upload-node-headers.py index 136da07d938b..86335b2b63db 100755 --- a/script/upload-node-headers.py +++ b/script/upload-node-headers.py @@ -7,8 +7,8 @@ import shutil import sys import tarfile -from lib.config import PLATFORM, get_target_arch -from lib.util import execute, safe_mkdir, scoped_cwd, s3_config, s3put +from lib.config import PLATFORM, get_target_arch, s3_config +from lib.util import execute, safe_mkdir, scoped_cwd, s3put SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) diff --git a/script/upload-windows-pdb.py b/script/upload-windows-pdb.py index b76fb7a09934..71c0c672dbe9 100755 --- a/script/upload-windows-pdb.py +++ b/script/upload-windows-pdb.py @@ -3,7 +3,8 @@ import os import glob -from lib.util import execute, rm_rf, safe_mkdir, s3put, s3_config +from lib.config import s3_config +from lib.util import execute, rm_rf, safe_mkdir, s3put SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))