本文整理汇总了Python中dropbox.Dropbox.get_budget_file方法的典型用法代码示例。如果您正苦于以下问题:Python Dropbox.get_budget_file方法的具体用法?Python Dropbox.get_budget_file怎么用?Python Dropbox.get_budget_file使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dropbox.Dropbox
的用法示例。
在下文中一共展示了Dropbox.get_budget_file方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: post
# 需要导入模块: from dropbox import Dropbox [as 别名]
# 或者: from dropbox.Dropbox import get_budget_file [as 别名]
def post(self):
method_start = time.clock()
flask_app.logger.info("Comparing budgets")
json = request.get_json()
token = json['access_token']
this_budget_path = json['this_budget_path']
other_budget_path = json['other_budget_path']
db = Dropbox(token)
start = time.clock()
this_json = db.get_budget_file(this_budget_path)
end = time.clock()
elapsed = end - start
flask_app.logger.debug("Get this budget time elapsed: {time}s".format(time=elapsed))
start = time.clock()
other_json = db.get_budget_file(other_budget_path)
end = time.clock()
elapsed = end - start
flask_app.logger.debug("Get other budget time elapsed: {time}s".format(time=elapsed))
this_target_category = json['this_target_category']
other_target_category = json['other_target_category']
start_date = json['comparison_start_date']
comparer = YnabBudgetComparer(this_json, this_target_category, other_json, other_target_category)
comparer.set_start_date(start_date)
start = time.clock()
missing_txns = comparer.get_missing_transactions()
end = time.clock()
flask_app.logger.debug("Find missing transactions time elapsed: {time}s".format(time=(end - start)))
method_finish = time.clock()
method_elapsed = method_finish - method_start
flask_app.logger.info("Finished comparing budgets. Time elapsed: {time}s".format(time=method_elapsed))
this_payees = comparer.get_this_payees()
other_payees = comparer.get_other_payees()
return {"this_missing": missing_txns[0], "other_missing": missing_txns[1],
"this_payees": this_payees, "other_payees": other_payees}