mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-23 06:42:26 +00:00
vendor cmp()
This commit is contained in:
parent
5105112475
commit
4ac60c5c86
@ -51,13 +51,14 @@ system where Tahoe is installed, or in a source tree with setup.py like this:
|
||||
setup.py run_with_pythonpath -p -c 'misc/make-canary-files.py ARGS..'
|
||||
"""
|
||||
|
||||
from past.builtins import cmp
|
||||
|
||||
import os, hashlib
|
||||
from twisted.python import usage
|
||||
from allmydata.immutable import upload
|
||||
from allmydata.util import base32
|
||||
|
||||
def cmp(a, b):
|
||||
return (a > b) - (a < b)
|
||||
|
||||
class Options(usage.Options):
|
||||
optParameters = [
|
||||
("convergence", "c", None, "path to NODEDIR/private/convergence"),
|
||||
|
@ -2,13 +2,13 @@
|
||||
|
||||
# WARNING. There is a bug in this script so that it does not simulate the actual Tahoe Two server selection algorithm that it was intended to simulate. See http://allmydata.org/trac/tahoe-lafs/ticket/302 (stop permuting peerlist, use SI as offset into ring instead?)
|
||||
|
||||
|
||||
from past.builtins import cmp
|
||||
|
||||
import random
|
||||
|
||||
SERVER_CAPACITY = 10**12
|
||||
|
||||
def cmp(a, b):
|
||||
return (a > b) - (a < b)
|
||||
|
||||
class Server(object):
|
||||
def __init__(self):
|
||||
self.si = random.randrange(0, 2**31)
|
||||
|
Loading…
Reference in New Issue
Block a user