Created
October 9, 2012 19:38
-
-
Save ColtonPhillips/3860954 to your computer and use it in GitHub Desktop.
A simple python script to build embed tags for my flash music games
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[Embed(source = 'res/treble/a2.mp3')] public static const T_A2:Class; | |
#public static var bassArray:Array = [B_A, B_C, B_D, B_E, B_G, B_A1 ]; | |
import sys, string | |
def main(): | |
relative_path = sys.argv[1] | |
identifier = sys.argv[2] | |
underscore = "_" | |
if (identifier == "!"): | |
# no identifier used | |
identifier = "" | |
underscore = "" | |
key_list = sys.argv[3:] | |
for key in key_list: | |
print "[Embed(source = '" + relative_path + "/" + key + ".mp3')] public static const " + identifier + underscore + string.capitalize(key) + ":Class;" | |
if __name__ == "__main__": | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment