update contact list
This commit is contained in:
Binary file not shown.
+13
-7
@@ -52,17 +52,23 @@ class DataManager:
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
# Create a workbook and add a worksheet.
|
|
||||||
workbook = xlsxwriter.Workbook('sim_infos.xlsx')
|
|
||||||
worksheet = workbook.add_worksheet()
|
|
||||||
# Start from the first cell. Rows and columns are zero indexed.
|
# Start from the first cell. Rows and columns are zero indexed.
|
||||||
row = 0
|
sim_info_list = []
|
||||||
col = 0
|
|
||||||
for sim in params.firebase_store_manager.get_all_sim_infos().stream():
|
for sim in params.firebase_store_manager.get_all_sim_infos().stream():
|
||||||
print(sim)
|
print(sim)
|
||||||
sim_pojo = SimInfoPojo.from_firestore_dict(sim.to_dict())
|
sim_pojo = SimInfoPojo.from_firestore_dict(sim.to_dict())
|
||||||
|
sim_info_list.append(sim_pojo)
|
||||||
|
row = 0
|
||||||
|
col = 0
|
||||||
|
# Create a workbook and add a worksheet.
|
||||||
|
workbook = xlsxwriter.Workbook('sim_infos.xlsx')
|
||||||
|
worksheet = workbook.add_worksheet()
|
||||||
|
for info in sim_info_list:
|
||||||
# Iterate over the data and write it out row by row.
|
# Iterate over the data and write it out row by row.
|
||||||
worksheet.write(row, col, sim_pojo.phone[2:len(sim_pojo.phone)])
|
worksheet.write(row, col, info.phone[2:len(info.phone)])
|
||||||
worksheet.write(row, col + 1, sim_pojo.ccid)
|
worksheet.write(row, col + 1, info.ccid)
|
||||||
|
worksheet.write(row, col + 2, info.position)
|
||||||
row += 1
|
row += 1
|
||||||
workbook.close()
|
workbook.close()
|
||||||
|
|||||||
Binary file not shown.
@@ -18,7 +18,11 @@ class SimInfoPojo:
|
|||||||
def from_firestore_dict(source):
|
def from_firestore_dict(source):
|
||||||
phone = source['phone']
|
phone = source['phone']
|
||||||
ccid = source['ccid']
|
ccid = source['ccid']
|
||||||
|
update_at = None
|
||||||
|
if 'update_at' in source:
|
||||||
update_at = source['update_at']
|
update_at = source['update_at']
|
||||||
|
position = None
|
||||||
|
if 'position' in source:
|
||||||
position = source['position']
|
position = source['position']
|
||||||
result = SimInfoPojo(phone=phone, ccid=ccid, update_at=update_at, position=position)
|
result = SimInfoPojo(phone=phone, ccid=ccid, update_at=update_at, position=position)
|
||||||
result.id = id
|
result.id = id
|
||||||
|
|||||||
Reference in New Issue
Block a user