2020-09-08 09:55:26 +00:00
|
|
|
"""
|
|
|
|
Insert value into addressbook
|
|
|
|
"""
|
|
|
|
|
2020-12-23 19:42:18 +00:00
|
|
|
from bmconfigparser import BMConfigParser
|
2021-01-05 11:25:02 +00:00
|
|
|
from helper_sql import sqlExecute
|
2020-09-08 09:55:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
def insert(address, label):
|
|
|
|
"""perform insert into addressbook"""
|
|
|
|
|
2021-01-05 11:25:02 +00:00
|
|
|
if address not in BMConfigParser().addresses():
|
2020-12-23 19:42:18 +00:00
|
|
|
return sqlExecute('''INSERT INTO addressbook VALUES (?,?)''', label, address) == 1
|
|
|
|
return False
|