Example #1
0
    def post(self, whose):
        token = request.get_json()['access_token']
        db = Dropbox(token)

        if whose == 'mine':
            start = time.clock()
            budgets = db.get_own_budgets()
            end = time.clock()
            flask_app.logger.debug("Get own budgets time elapsed: {time}s".format(time=(end - start)))
        elif whose == 'theirs':
            start = time.clock()
            budgets = db.get_their_budgets()
            end = time.clock()
            flask_app.logger.debug("Get their budgets time elapsed: {time}s".format(time=(end - start)))
        return budgets