Esempio n. 1
0
    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())
Esempio n. 2
0
    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)
Esempio n. 3
0
 def github(self):
     forms.github.WebhookForm(self.request.json)
     return api.Response('github.created')
Esempio n. 4
0
 def index(self):
     return api.Response('sub.index')
Esempio n. 5
0
File: health.py Progetto: soitun/bob
 def index(self):
     return api.Response(__version__)
Esempio n. 6
0
 def index(self):
     return api.Response('bar.index')
Esempio n. 7
0
 def index(self):
     return api.Response('qux.index')
Esempio n. 8
0
 def options(self):
     return api.Response('foo.options')
Esempio n. 9
0
 def baz(self):
     return api.Response('baz.index')
Esempio n. 10
0
 def delete(self):
     return api.Response('foo.deleted')
Esempio n. 11
0
 def upsert(self):
     return api.Response('foo.upsert')
Esempio n. 12
0
 def update(self):
     return api.Response('foo.updated')
Esempio n. 13
0
 def create(self):
     return api.Response('foo.created')
Esempio n. 14
0
 def show(self):
     return api.Response(str(self.context.entity))
Esempio n. 15
0
 def index(self):
     return api.Response('foo.index')
Esempio n. 16
0
 def show(self):
     return api.Response('{}{}'.format(self.context.entity,
                                       self.context.parent.parent.entity))