support mobile serial
This commit is contained in:
@@ -1,8 +1,9 @@
|
|||||||
import datetime
|
import datetime
|
||||||
import random
|
import random
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
import xlsxwriter
|
import xlsxwriter
|
||||||
from src.person_name.cython_extract_methods import filter_already_validated_contacts, read_pinyin_list_from_file
|
# from src.person_name.cython_extract_methods import filter_already_validated_contacts, read_pinyin_list_from_file
|
||||||
|
|
||||||
from src.db.mongo_manager import MONGO_STORE_MANAGER
|
from src.db.mongo_manager import MONGO_STORE_MANAGER
|
||||||
from src.pojo.contact_pojo import ContactPojo
|
from src.pojo.contact_pojo import ContactPojo
|
||||||
@@ -13,7 +14,7 @@ DEFAULT_SERIAL = "47e7e36b"
|
|||||||
|
|
||||||
|
|
||||||
def upload_contacts_list():
|
def upload_contacts_list():
|
||||||
_contacts_to_book = read_contacts("/Users/lpan/Desktop/contact_list_2024-09-28.xlsx")
|
_contacts_to_book = read_contacts(str(Path.home()) + "/Desktop/contact_list_2024-10-03.xlsx")
|
||||||
return _contacts_to_book
|
return _contacts_to_book
|
||||||
|
|
||||||
|
|
||||||
@@ -203,14 +204,14 @@ if __name__ == '__main__':
|
|||||||
# contacts_to_book = upload_contacts_list()
|
# contacts_to_book = upload_contacts_list()
|
||||||
# MONGO_STORE_MANAGER.upload_contact_list(contacts_to_book)
|
# MONGO_STORE_MANAGER.upload_contact_list(contacts_to_book)
|
||||||
# print("start at {}".format(datetime.datetime.now()))
|
# print("start at {}".format(datetime.datetime.now()))
|
||||||
generate_valid_contact_list_for_day(segment_number=2)
|
# generate_valid_contact_list_for_day(segment_number=2)
|
||||||
# generate_contact_from_mail_list("/Users/lpan/Downloads/邮箱及密码.xlsx")
|
# generate_contact_from_mail_list("/Users/lpan/Downloads/邮箱及密码.xlsx")
|
||||||
# print("end at {}".format(datetime.datetime.now()))
|
# print("end at {}".format(datetime.datetime.now()))
|
||||||
# update_contact_list_not_received_mail()
|
# update_contact_list_not_received_mail()
|
||||||
# generate_valid_contact_list_for_day(segment_number=2)
|
# generate_valid_contact_list_for_day(segment_number=2)
|
||||||
# get_old_validated_contact_list()
|
# get_old_validated_contact_list()
|
||||||
# print("end at {}".format(datetime.datetime.now()))
|
# print("end at {}".format(datetime.datetime.now()))
|
||||||
# generate_all_contact_list()
|
generate_all_contact_list()
|
||||||
# merge_contact_list_files(
|
# merge_contact_list_files(
|
||||||
# ["/Users/lpan/Desktop/contact_list_all_old_not_used_contact.xlsx",
|
# ["/Users/lpan/Desktop/contact_list_all_old_not_used_contact.xlsx",
|
||||||
# "/Users/lpan/Desktop/contact_list_2024-06-26.xlsx"])
|
# "/Users/lpan/Desktop/contact_list_2024-06-26.xlsx"])
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ class ContactPojo:
|
|||||||
ip_address: str
|
ip_address: str
|
||||||
isp: str = None
|
isp: str = None
|
||||||
ua: str = ""
|
ua: str = ""
|
||||||
|
serial: str = ""
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return "phone:{}, passport:{}, last_name:{}, first_name:{}, mail:{}, store:{}, ip_country:{},isp:{}".format(
|
return "phone:{}, passport:{}, last_name:{}, first_name:{}, mail:{}, store:{}, ip_country:{},isp:{}".format(
|
||||||
@@ -45,7 +46,8 @@ class ContactPojo:
|
|||||||
u'mail': self.mail,
|
u'mail': self.mail,
|
||||||
u'store': self.store,
|
u'store': self.store,
|
||||||
u'ip_country': self.ip_country,
|
u'ip_country': self.ip_country,
|
||||||
u'ua': self.ua
|
u'ua': self.ua,
|
||||||
|
u'serial': self.serial
|
||||||
}
|
}
|
||||||
return dest
|
return dest
|
||||||
|
|
||||||
@@ -74,5 +76,8 @@ class ContactPojo:
|
|||||||
result = ContactPojo(phone_number=phone, passport_number=passport, mail=email,
|
result = ContactPojo(phone_number=phone, passport_number=passport, mail=email,
|
||||||
last_name=last_name, first_name=first_name, store=store)
|
last_name=last_name, first_name=first_name, store=store)
|
||||||
result.ip_country = ip_country
|
result.ip_country = ip_country
|
||||||
|
if source.get('serial'):
|
||||||
|
serial = source['serial']
|
||||||
|
result.serial = serial
|
||||||
result.ua = ua
|
result.ua = ua
|
||||||
return result
|
return result
|
||||||
|
|||||||
@@ -58,6 +58,9 @@ def read_contacts(file_name) -> list:
|
|||||||
first_name=first_name,
|
first_name=first_name,
|
||||||
passport_number=contact_dict['passport'],
|
passport_number=contact_dict['passport'],
|
||||||
mail=contact_dict['email'], store=store)
|
mail=contact_dict['email'], store=store)
|
||||||
|
if contact_dict.get('serial') is not None:
|
||||||
|
serial = contact_dict['serial']
|
||||||
|
contact.serial = serial
|
||||||
contact.ip_country = ip_country
|
contact.ip_country = ip_country
|
||||||
contact.ua = ua
|
contact.ua = ua
|
||||||
contact_list.append(contact)
|
contact_list.append(contact)
|
||||||
|
|||||||
Reference in New Issue
Block a user