# Path: record/model.py
# SUB_DL_BYTES = 1000000000000
# SUB_LENGTH_DAYS = 30
# SUB_PRICE_ISK = config.isk_price
# BW_MARGIN = 0.9
# class NotEnoughFundsError(Exception):
# class NodeList(list):
# class Node(object):
# class Exit(object):
# class Deposit(object):
# class User(object):
# class InviteKey(object):
# class BTCPrices(object):
# class BTCAddr(object):
# class APIKey(object):
# class DB(object):
#     def get(cls):
#     def best(cls, n=3):
#     def alive(cls):
#     def down(cls):
#     def disabled(cls):
#     def enabled(cls):
#     def __init__(self, name, ip, **kwargs):
#     def get(cls, name):
#     def auth(cls, name, key):
#     def new(cls, name, ip, is_exit=False,max_throughput=0):
#     def exists(cls, name):
#     def getall(cls):
#     def uptime(self):
#     def uptime(self, value):
#     def usercount(self):
#     def usercount(self, value):
#     def throughput_limit(self):
#     def within_limit(self):
#     def score(self):
#     def alive(self):
#     def down(self):
#     def heartbeat_age(self):
#     def update(self, usercount=0, selfcheck=False, throughput=0, total_throughput=0, uptime='0d 0h', cpu=0.0):
#     def save(self):
#     def __iter__(self):
#     def __str__(self):
#     def __repr__(self):
#     def __getitem__(self, key):
#     def __init__(self, name, ip, comments=""):
#     def new(cls, name, ip, comments=""):
#     def get(cls, name):
#     def getall(cls):
#     def save(self):
#     def __iter__(self):
#     def __dict__(self):
#     def __init__(self, **kwargs):
#     def vsk_amount(self):
#     def income(self):
#     def invoice(self):
#     def mkinvoice(self):
#     def save(self):
#     def new(cls, username, amount, method, **kwargs):
#     def get(cls, depositid):
#     def __init__(self, username, hashed_passwd, db, **kwargs):
#     def can_buy(self):
#     def gb_left(self):
#     def userdir(self):
#     def sub_active(self):
#     def save(self):
#     def deposit(self, amount):
#     def buy_sub(self):
#     def buy_sub_isk(self):
#     def buy_sub_btc(self):
#     def set_passwd(self, passwd):
#     def mkinstaller(self):
#     def mkkeys(self):
#     def btc_addr(self):
#     def auth(cls, username, passwd):
#     def new(cls, username, passwd, invkey=None, email='', mkinstaller=True):
#     def exists(cls, username):
#     def get(cls, username):
#     def __iter__(self):
#     def __init__(self, key):
#     def valid(self):
#     def new(cls):
#     def use(self):
#     def promo_key(self):
#     def __init__(self, price):
#     def update(cls):
#     def __init__(self, addr, usertag):
#     def save(self):
#     def new(cls, username):
#     def assign(cls, username):
#     def get(cls, addr):
#     def rm(self):
#     def __init__(self, key, name, status):
#     def __attrs__(self):
#     def save(self):
#     def good(self):
#     def new(cls, name, status="good"):
#     def get(cls, key):
#     def get_by_name(cls, name):
#     def auth(cls, key, name=""):
# def good_username(name):
# def good_password(passwd):
# def hashed(plain_passwd, method='sha512s', salt=None):
# def compare_passwd(plain_passwd, hashed_passwd):
# def dict_from_row(row):
#     def __init__(self, conn):
#     def get(cls):
#     def commit(self):
#     def save_user(self, username, hashed_passwd, email, dl_left, credit_isk, credit_btc, sub_end):
#     def select_user(self, username):
#     def get_api_key(self, key):
#     def get_api_key_by_name(self, name):
#     def save_api_key(self, key, name, status):
#     def add_invite_key(self, key):
#     def check_invite_key(self, key):
#     def use_invite_key(self, key):
#     def new_btc_isk(self, btc_isk, btc_price):
#     def save_btcaddrs(self, addr, usertag):
#     def add_btc_addr(self, addr, usertag=""):
#     def tag_new_btc_addr(self, tag):
#     def get_btc_addr(self, tag):
#     def get_btc_addr_tag(self, addr):
#     def rm_btc_addr(self, addr):
#     def get_btc_price(self):
#     def lb_save(self, name, ip, userc, heartb, score, selfc, throughp, cpu, uptime, total, maxt, enabled, is_exit):
#     def lb_get(self, name):
#     def lb_get_all(self):
#     def max_mailid(self):
#     def add_mailid(self, mailid):
#     def save_exit_supplement(self, name, ip, comments):
#     def get_exit_supplement(self, name):
#     def get_all_exit_supplements(self):
#     def save_deposit(self, deposit):
#     def select_deposit(self, depositid):
# def new_db(name):
# def mktables(conn):


import sys
from record import model
sys.path.append("..")

usage = """Imports a list of bitcoin addresses from a file.

Example:
 $ python import_btcaddrs.py file.txt

"""

if len(sys.argv) != 1:
    print usage
    sys.exit(1)

l = open(sys.argv[1], "r").readlines()
l = [a[:-1] for a in l]
for a in l:

# Path: record/model.py
# SUB_DL_BYTES = 1000000000000
# SUB_LENGTH_DAYS = 30
# SUB_PRICE_ISK = config.isk_price
# BW_MARGIN = 0.9
# class NotEnoughFundsError(Exception):
# class NodeList(list):
# class Node(object):
# class Exit(object):
# class Deposit(object):
# class User(object):
# class InviteKey(object):
# class BTCPrices(object):
# class BTCAddr(object):
# class APIKey(object):
# class DB(object):
#     def get(cls):
#     def best(cls, n=3):
#     def alive(cls):
#     def down(cls):
#     def disabled(cls):
#     def enabled(cls):
#     def __init__(self, name, ip, **kwargs):
#     def get(cls, name):
#     def auth(cls, name, key):
#     def new(cls, name, ip, is_exit=False,max_throughput=0):
#     def exists(cls, name):
#     def getall(cls):
#     def uptime(self):
#     def uptime(self, value):
#     def usercount(self):
#     def usercount(self, value):
#     def throughput_limit(self):
#     def within_limit(self):
#     def score(self):
#     def alive(self):
#     def down(self):
#     def heartbeat_age(self):
#     def update(self, usercount=0, selfcheck=False, throughput=0, total_throughput=0, uptime='0d 0h', cpu=0.0):
#     def save(self):
#     def __iter__(self):
#     def __str__(self):
#     def __repr__(self):
#     def __getitem__(self, key):
#     def __init__(self, name, ip, comments=""):
#     def new(cls, name, ip, comments=""):
#     def get(cls, name):
#     def getall(cls):
#     def save(self):
#     def __iter__(self):
#     def __dict__(self):
#     def __init__(self, **kwargs):
#     def vsk_amount(self):
#     def income(self):
#     def invoice(self):
#     def mkinvoice(self):
#     def save(self):
#     def new(cls, username, amount, method, **kwargs):
#     def get(cls, depositid):
#     def __init__(self, username, hashed_passwd, db, **kwargs):
#     def can_buy(self):
#     def gb_left(self):
#     def userdir(self):
#     def sub_active(self):
#     def save(self):
#     def deposit(self, amount):
#     def buy_sub(self):
#     def buy_sub_isk(self):
#     def buy_sub_btc(self):
#     def set_passwd(self, passwd):
#     def mkinstaller(self):
#     def mkkeys(self):
#     def btc_addr(self):
#     def auth(cls, username, passwd):
#     def new(cls, username, passwd, invkey=None, email='', mkinstaller=True):
#     def exists(cls, username):
#     def get(cls, username):
#     def __iter__(self):
#     def __init__(self, key):
#     def valid(self):
#     def new(cls):
#     def use(self):
#     def promo_key(self):
#     def __init__(self, price):
#     def update(cls):
#     def __init__(self, addr, usertag):
#     def save(self):
#     def new(cls, username):
#     def assign(cls, username):
#     def get(cls, addr):
#     def rm(self):
#     def __init__(self, key, name, status):
#     def __attrs__(self):
#     def save(self):
#     def good(self):
#     def new(cls, name, status="good"):
#     def get(cls, key):
#     def get_by_name(cls, name):
#     def auth(cls, key, name=""):
# def good_username(name):
# def good_password(passwd):
# def hashed(plain_passwd, method='sha512s', salt=None):
# def compare_passwd(plain_passwd, hashed_passwd):
# def dict_from_row(row):
#     def __init__(self, conn):
#     def get(cls):
#     def commit(self):
#     def save_user(self, username, hashed_passwd, email, dl_left, credit_isk, credit_btc, sub_end):
#     def select_user(self, username):
#     def get_api_key(self, key):
#     def get_api_key_by_name(self, name):
#     def save_api_key(self, key, name, status):
#     def add_invite_key(self, key):
#     def check_invite_key(self, key):
#     def use_invite_key(self, key):
#     def new_btc_isk(self, btc_isk, btc_price):
#     def save_btcaddrs(self, addr, usertag):
#     def add_btc_addr(self, addr, usertag=""):
#     def tag_new_btc_addr(self, tag):
#     def get_btc_addr(self, tag):
#     def get_btc_addr_tag(self, addr):
#     def rm_btc_addr(self, addr):
#     def get_btc_price(self):
#     def lb_save(self, name, ip, userc, heartb, score, selfc, throughp, cpu, uptime, total, maxt, enabled, is_exit):
#     def lb_get(self, name):
#     def lb_get_all(self):
#     def max_mailid(self):
#     def add_mailid(self, mailid):
#     def save_exit_supplement(self, name, ip, comments):
#     def get_exit_supplement(self, name):
#     def get_all_exit_supplements(self):
#     def save_deposit(self, deposit):
#     def select_deposit(self, depositid):
# def new_db(name):
# def mktables(conn):


# Path: utils/import_btcaddrs.py
import sys
from record import model

sys.path.append("..")

usage = """Imports a list of bitcoin addresses from a file.

Example:
 $ python import_btcaddrs.py file.txt

"""

if len(sys.argv) != 1:
    print usage
    sys.exit(1)

l = open(sys.argv[1], "r").readlines()
l = [a[:-1] for a in l]
for a in l:

    model.DB.get().add_btc_addr(a)