update contact list
This commit is contained in:
Binary file not shown.
+13
-7
@@ -52,17 +52,23 @@ class DataManager:
|
||||
|
||||
|
||||
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.
|
||||
row = 0
|
||||
col = 0
|
||||
sim_info_list = []
|
||||
|
||||
for sim in params.firebase_store_manager.get_all_sim_infos().stream():
|
||||
print(sim)
|
||||
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.
|
||||
worksheet.write(row, col, sim_pojo.phone[2:len(sim_pojo.phone)])
|
||||
worksheet.write(row, col + 1, sim_pojo.ccid)
|
||||
worksheet.write(row, col, info.phone[2:len(info.phone)])
|
||||
worksheet.write(row, col + 1, info.ccid)
|
||||
worksheet.write(row, col + 2, info.position)
|
||||
row += 1
|
||||
workbook.close()
|
||||
|
||||
Binary file not shown.
+6
-2
@@ -18,8 +18,12 @@ class SimInfoPojo:
|
||||
def from_firestore_dict(source):
|
||||
phone = source['phone']
|
||||
ccid = source['ccid']
|
||||
update_at = source['update_at']
|
||||
position = source['position']
|
||||
update_at = None
|
||||
if 'update_at' in source:
|
||||
update_at = source['update_at']
|
||||
position = None
|
||||
if 'position' in source:
|
||||
position = source['position']
|
||||
result = SimInfoPojo(phone=phone, ccid=ccid, update_at=update_at, position=position)
|
||||
result.id = id
|
||||
return result
|
||||
|
||||
Reference in New Issue
Block a user