This commit is contained in:
j 2017-11-02 21:11:09 +00:00
parent bf88243423
commit 90537f2f0e
6 changed files with 9 additions and 8 deletions

View file

@ -60,11 +60,11 @@ def main():
parser.add_option('-l', '--timeline', dest='timeline', help='Timeline (image file to be read)') parser.add_option('-l', '--timeline', dest='timeline', help='Timeline (image file to be read)')
parser.add_option('-i', '--icon', dest='icon', help='Icon (image file to be written)') parser.add_option('-i', '--icon', dest='icon', help='Icon (image file to be written)')
(options, args) = parser.parse_args() (options, args) = parser.parse_args()
if options.icon == None: if options.icon is None:
parser.print_help() parser.print_help()
sys.exit() sys.exit()
render_icon(options.frame, options.timeline, options.icon) render_icon(options.frame, options.timeline, options.icon)
if __name__ == "__main__": if __name__ == "__main__":
main() main()

View file

@ -52,7 +52,7 @@ def main():
parser.add_option('-f', '--frames', dest='frames', help='Poster frames (image files to be read)', default='') parser.add_option('-f', '--frames', dest='frames', help='Poster frames (image files to be read)', default='')
parser.add_option('-o', '--icon', dest='icon', help='Icon (image file to be written)') parser.add_option('-o', '--icon', dest='icon', help='Icon (image file to be written)')
(options, args) = parser.parse_args() (options, args) = parser.parse_args()
if options.icon == None: if options.icon is None:
parser.print_help() parser.print_help()
sys.exit() sys.exit()
@ -60,6 +60,6 @@ def main():
render_list_icon(frames, options.icon) render_list_icon(frames, options.icon)
if __name__ == "__main__": if __name__ == "__main__":
main() main()

View file

@ -223,6 +223,6 @@ def main():
data = json.load(f) data = json.load(f)
render_poster(data, options.poster) render_poster(data, options.poster)
if __name__ == "__main__": if __name__ == "__main__":
main() main()

View file

@ -225,6 +225,6 @@ def main():
render_poster(data, options.poster) render_poster(data, options.poster)
if __name__ == "__main__": if __name__ == "__main__":
main() main()

View file

@ -67,6 +67,7 @@ def render_poster(data, poster):
drawText(poster_image, ((poster_width - text_size[0]) / 2, text_top + (text_height - text_size[1]) / 2), text, font_file, font_size, poster_color) drawText(poster_image, ((poster_width - text_size[0]) / 2, text_top + (text_height - text_size[1]) / 2), text, font_file, font_size, poster_color)
poster_image.save(poster) poster_image.save(poster)
def main(): def main():
parser = OptionParser() parser = OptionParser()
parser.add_option('-d', '--data', dest='data', help='json file with metadata', default=None) parser.add_option('-d', '--data', dest='data', help='json file with metadata', default=None)
@ -84,6 +85,6 @@ def main():
data = json.load(f) data = json.load(f)
render_poster(data, options.poster) render_poster(data, options.poster)
if __name__ == "__main__": if __name__ == "__main__":
main() main()

View file

@ -158,6 +158,6 @@ def main():
data = json.load(f) data = json.load(f)
render_poster(data, options.poster) render_poster(data, options.poster)
if __name__ == "__main__": if __name__ == "__main__":
main() main()