import phonedbsql
import sys
# -*- encoding: UTF-8 -*-


print 'loading db'
pb = phonedbsql.phonedb
print 'loaded db'
if len(sys.argv) > 1:
    print 'searching db for ' + sys.argv[1]
    list = pb.get_phonelist_by_text(sys.argv[1])
    if list:
        for item in list:
            print item
print 'searched db'
print 'saving db'
pb.save()
print 'saved db'


