Load input

def interpret(self, msg):
        """ Load input """
        slides = msg.get('slides', [])
        self.cache = msg.get('folder')
        self.gallery = msg.get('gallery', '..')

        with open(self.cache + '/slides.txt', 'w') as logfile:
            for ix, item in enumerate(slides):
                image = self.prepare_image(item)
                filename = self.cache_image(item, image)

                text = item.get('caption', '')

                # do not write text for heading images
                if item.get('heading'):
                    text = ''
                    
                if text:
                    with open(filename + '.txt', 'w') as caption:
                        caption.write(text)
                print('%s,%d' % (filename, item.get('time', 0)), file=logfile)