1
Fork 0

Added support for gifs

This commit is contained in:
Jake Howard 2015-08-25 16:09:58 +01:00
parent b060d85365
commit 5eec570a72

View file

@ -5,18 +5,19 @@ ASSETS_URL="https://raw.githubusercontent.com/RealOrangeOne/hipchat-emoticons-fo
def get_icon_name(path): def get_icon_name(path):
return get_filename(path).replace('.png', '') return get_filename(path).replace('.png', '').replace('.gif', '')
def get_filename(path): def get_filename(path):
return path.replace('assets/', '') return path.replace('assets/', '')
files = glob('assets/*.png') files = glob('assets/*.png', 'assets/*.gif')
images = [] images = []
for filename in files: for filename in files:
images.append({get_icon_name(filename): ASSETS_URL + get_filename(filename)}) images.append({get_icon_name(filename): ASSETS_URL + get_filename(filename)})
image_decoder = {"images":images} image_decoder = {"images":images}
image_decoder_json = json.dumps(image_decoder, indent=2, sort_keys=True) image_decoder_json = json.dumps(image_decoder, indent=2, sort_keys=True)