Skip to content

Instantly share code, notes, and snippets.

@ColtonPhillips
Created October 9, 2012 19:38
Show Gist options
  • Save ColtonPhillips/3860954 to your computer and use it in GitHub Desktop.
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
#[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