

@cherrypy.expose
def push(self, *paths, **_ignored):
    email_name = '/'.join(paths)
    email_path = os.path.join(self.settings.source, email_name)
    try:
        res = _push_email_to_cms_service(self.settings, email_name, email_path)
        messages = ['SUCCES', res]
    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.push/original