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