def logs(self): from bob import settings def iterate_response(): root = os.path.expanduser(settings['bobb.log_dir']) for file_name in list_logs(root): yield str(os.path.relpath(file_name, root)) yield str('\n') return api.Response(app_iter=iterate_response())
def travis(self): try: result = forms.travis.WebhookForm(self.request.json) except ValueError: # http://docs.travis-ci.com/user/notifications/ # Webhooks are delivered with a application/x-www-form-urlencoded # content type using HTTP POST, with the body including a payload # parameter that contains the JSON webhook payload in a URL-encoded # format. result = forms.travis.WebhookForm( json.loads(self.request.POST['payload'])) logger.info(result) if result['build']: response = forms.queue_build(result['organization'], result['name'], result['branch']) else: response = 'nope nope nope' return api.Response(response)
def github(self): forms.github.WebhookForm(self.request.json) return api.Response('github.created')
def index(self): return api.Response('sub.index')
def index(self): return api.Response(__version__)
def index(self): return api.Response('bar.index')
def index(self): return api.Response('qux.index')
def options(self): return api.Response('foo.options')
def baz(self): return api.Response('baz.index')
def delete(self): return api.Response('foo.deleted')
def upsert(self): return api.Response('foo.upsert')
def update(self): return api.Response('foo.updated')
def create(self): return api.Response('foo.created')
def show(self): return api.Response(str(self.context.entity))
def index(self): return api.Response('foo.index')
def show(self): return api.Response('{}{}'.format(self.context.entity, self.context.parent.parent.entity))