本文整理汇总了Python中firebase.Firebase.set方法的典型用法代码示例。如果您正苦于以下问题:Python Firebase.set方法的具体用法?Python Firebase.set怎么用?Python Firebase.set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类firebase.Firebase
的用法示例。
在下文中一共展示了Firebase.set方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from firebase import Firebase [as 别名]
# 或者: from firebase.Firebase import set [as 别名]
def main():
BASE_URL = 'https://amber-fire-5569.firebaseio.com/Traffic/'
f = Firebase(BASE_URL)
results = f.get()
for key in results:
pprint(key)
pprint(results[key])
payload = results[key]
street1 = results[key]['intersection1']
street2 = results[key]['intersection2']
coords = intersection_to_coords(street1, street2)
print coords
try:
payload['Latitude'] = coords['Latitude']
except TypeError:
continue
payload['Longitude'] = coords['Longitude']
endpoint = Firebase(BASE_URL+key)
pprint(payload)
endpoint.set(payload)
示例2: update_groups
# 需要导入模块: from firebase import Firebase [as 别名]
# 或者: from firebase.Firebase import set [as 别名]
def update_groups():
gruposRef = Firebase(FIREBASE_BASE_URL+'groups')
gruposRef.delete();
results = json.load(urllib.urlopen(API_BASE_URL+"group/"))
for grupo in results['objects']:
grupoRef = Firebase(FIREBASE_BASE_URL+'groups/'+str(grupo['id']))
grupoRef.set(grupo)
示例3: pushFirefox
# 需要导入模块: from firebase import Firebase [as 别名]
# 或者: from firebase.Firebase import set [as 别名]
def pushFirefox(state):
f = Firebase('https://project1.firebaseio.com/state')
r = f.set(state)