From 7c77f76f05edc1c55b3c9cc34118eea08a0e54b4 Mon Sep 17 00:00:00 2001 From: Alex Huddleston Date: Wed, 6 Jun 2018 09:25:58 -0500 Subject: [PATCH] Script works with hardcoded path. --- pleromoji.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/pleromoji.py b/pleromoji.py index f344611..b7a38a9 100644 --- a/pleromoji.py +++ b/pleromoji.py @@ -1,2 +1,29 @@ +import os +from os import listdir +from os.path import isfile, join + print("Hello, world!") +input_path = "./ms-emoji" + +real_path = os.path.dirname(os.path.realpath(input_path)) + +def pleromoji(current_path): + output_path = "" + output_shortcode = "" + output_line = "" + + for f in listdir(current_path): + if isfile(join(current_path, f)): + output_path = os.path.dirname(os.path.realpath(join(current_path, f))).replace(real_path, "") + "/" + f + output_path = "emoji" + output_path + + output_shortcode = f.replace(".png", "") + + output_line = output_shortcode + ", " + output_path + print(output_line) + else: + pleromoji(join(current_path,f)) + +pleromoji(input_path) +