X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=apt_p2p_Khashmir%2Fdb.py;h=89ac04d844d4818da22a2d67446dfd8d825a44d2;hb=39b67214133f5e3c42a862cec9232872b51b70b5;hp=a7962566cc5a07eb99c0744b65eb81389f8b45bc;hpb=1b2b271f65329a6bfaf7a5c935b9971834662865;p=quix0rs-apt-p2p.git diff --git a/apt_p2p_Khashmir/db.py b/apt_p2p_Khashmir/db.py index a796256..89ac04d 100644 --- a/apt_p2p_Khashmir/db.py +++ b/apt_p2p_Khashmir/db.py @@ -103,7 +103,7 @@ class DB: c = self.conn.cursor() c.execute("DELETE FROM nodes WHERE id NOT NULL") for bucket in buckets: - for node in bucket.l: + for node in bucket.nodes: c.execute("INSERT INTO nodes VALUES (?, ?, ?)", (khash(node.id), node.host, node.port)) self.conn.commit() @@ -209,11 +209,11 @@ class TestDB(unittest.TestCase): dummy2.port = 12345 class bl: def __init__(self): - self.l = [] + self.nodes = [] bl1 = bl() - bl1.l.append(dummy()) + bl1.nodes.append(dummy()) bl2 = bl() - bl2.l.append(dummy2) + bl2.nodes.append(dummy2) buckets = [bl1, bl2] self.store.dumpRoutingTable(buckets) rt = self.store.getRoutingTable()