redundant vars

This commit is contained in:
guidotheelen 2020-04-20 11:51:16 +02:00
parent c116ae0fe9
commit f1dbd50b05
3 changed files with 12 additions and 7 deletions

View file

@ -31,8 +31,6 @@ ZOPFLIPNG = zopflipng
OPTIPNG = optipng OPTIPNG = optipng
DOWNLOAD_DRIVE_PNGS = get_png_files_from_drive.py DOWNLOAD_DRIVE_PNGS = get_png_files_from_drive.py
DRIVE_FOLDER_NAME = Emoji_test_folder
DOWNLOAD_FOLDER = temp_download_folder
DOWNLOAD_REPORTING = --reporting DOWNLOAD_REPORTING = --reporting
EMOJI_BUILDER = third_party/color_emoji/emoji_builder.py EMOJI_BUILDER = third_party/color_emoji/emoji_builder.py
@ -158,8 +156,8 @@ ifdef MISSING_ADDER
endif endif
download_png_source: download_png_source:
ifdef DOWNLOAD_SOURCE ifdef DOWNLOAD
$(PYTHON) $(DOWNLOAD_DRIVE_PNGS) $(DRIVE_FOLDER_NAME) $(DOWNLOAD_FOLDER) $(DOWNLOAD_REPORTING) $(PYTHON) $(DOWNLOAD_DRIVE_PNGS) $(DOWNLOAD) $(DOWNLOAD_REPORTING)
endif endif
$(EMOJI_DIR) $(FLAGS_DIR) $(RESIZED_FLAGS_DIR) $(RENAMED_FLAGS_DIR) $(QUANTIZED_DIR) $(COMPRESSED_DIR): $(EMOJI_DIR) $(FLAGS_DIR) $(RESIZED_FLAGS_DIR) $(RENAMED_FLAGS_DIR) $(QUANTIZED_DIR) $(COMPRESSED_DIR):

View file

@ -16,6 +16,12 @@ especially if you are using zopflipng for compression. Intermediate products
(compressed image files, for example) will be put into a build subdirectory; the (compressed image files, for example) will be put into a build subdirectory; the
font will be at the top level. font will be at the top level.
## Adding external assets
It is possible to download your emoji artwork automatically from Google Drive. Make sure you got the credentials.json file included in the root of this project. You can get it [here](https://developers.google.com/drive/api/v3/quickstart/python). Click the `Enable Drive API` and make sure you select `Desktop app`. To start the download and the build process run:
`make DOWNLOAD=“Name_Of_The_Drive_Folder”`
## Using NotoColorEmoji ## Using NotoColorEmoji
NotoColorEmoji uses the CBDT/CBLC color font format, which is supported by Android NotoColorEmoji uses the CBDT/CBLC color font format, which is supported by Android

View file

@ -31,18 +31,19 @@ from googleapiclient.http import MediaIoBaseDownload
SCOPES = ["https://www.googleapis.com/auth/drive"] SCOPES = ["https://www.googleapis.com/auth/drive"]
def main(folder_name, output_dir, reporting=False): def main(folder_name="", reporting=False):
# Create a token.pickle file to store the users session # Create a token.pickle file to store the users session
service = get_service() service = get_service()
folder_name = input("Please enter the name of your drive folder: ") if folder_name == "":
folder_name = input("Please enter the name of your drive folder: ")
# Get the folder instance # Get the folder instance
folder_id = get_folder_id(service, folder_name) folder_id = get_folder_id(service, folder_name)
# Create output_dir # Create output_dir
output_dir = create_dir(output_dir) output_dir = create_dir("temp_download_folder")
# Get the file IDs # Get the file IDs
file_list = get_file_list(service, folder_id) file_list = get_file_list(service, folder_id)