

@cherrypy.expose
def pull(self, *paths, **_ignored):
    email_name = '/'.join(paths)
    try:
        res = _get_email_from_cms_service(self.settings, email_name)
        fs.save_file(res, self.settings.source, email_name)
        place_holders.generate_config(self.settings)
        place_holders._read_placeholders_file.cache_clear()
        messages = ['SUCCES', '']
    except service.TimeoutError as e:
        messages = ['ERROR', str(e)]
    except service.ServiceError as e:
        messages = ['ERROR', ('Service respond with: <code>%s</code><br/><code>%s</code>' % (e.status, e.text))]
    return self.edit_renderer.question(messages[0], messages[1], [['Go back', '/email/{}'.format(email_name)]])

dataset/ETHPy150Open KeepSafe/ks-email-parser/email_parser/gui/gui.py Server.pull/original