Created
May 19, 2015 15:16
-
-
Save anonymous/41a31df9da14fa20cf26 to your computer and use it in GitHub Desktop.
bashgenerator_2015_05_19_17-16
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
def generate(from_file, x, y, filenames, type='.png'): | |
filenames = filenames.split() | |
yield "# this file is generated automatically." | |
yield "convert {0} local01.miff".format(from_file) | |
for i, filename in enumerate(filenames): | |
l = "convert local01.miff -crop {0}x{1}+{2}+0 {3}{4}" | |
yield l.format(x, y, i*x, filename, type) | |
yield "rm local01.miff" | |
icons = "VTX V2X XALL BIX PERP CCEN EXM" | |
file_strings = generate("RENDERED_icons.png", 32, 32, icons) | |
for l in file_strings: | |
print(l) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment