This repository has been archived on 2024-12-21. You can view files and clone it, but cannot push or open issues or pull requests.
PyBitmessage-2024-12-21/src/helper_addressbook.py
Kashiko Koibumi 96c764bd94
refined: read from and write to SQLite database in binary mode
This modification is a preparation for migration to Python3.
2024-05-27 22:43:01 +09:00

16 lines
371 B
Python

"""
Insert value into addressbook
"""
from bmconfigparser import config
from helper_sql import sqlExecute
from dbcompat import dbstr
def insert(address, label):
"""perform insert into addressbook"""
if address not in config.addresses():
return sqlExecute('''INSERT INTO addressbook VALUES (?,?)''', dbstr(label), dbstr(address)) == 1
return False