mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-01-25 13:49:20 +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..'
|
setup.py run_with_pythonpath -p -c 'misc/make-canary-files.py ARGS..'
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from past.builtins import cmp
|
|
||||||
|
|
||||||
import os, hashlib
|
import os, hashlib
|
||||||
from twisted.python import usage
|
from twisted.python import usage
|
||||||
from allmydata.immutable import upload
|
from allmydata.immutable import upload
|
||||||
from allmydata.util import base32
|
from allmydata.util import base32
|
||||||
|
|
||||||
|
def cmp(a, b):
|
||||||
|
return (a > b) - (a < b)
|
||||||
|
|
||||||
class Options(usage.Options):
|
class Options(usage.Options):
|
||||||
optParameters = [
|
optParameters = [
|
||||||
("convergence", "c", None, "path to NODEDIR/private/convergence"),
|
("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?)
|
# 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
|
import random
|
||||||
|
|
||||||
SERVER_CAPACITY = 10**12
|
SERVER_CAPACITY = 10**12
|
||||||
|
|
||||||
|
def cmp(a, b):
|
||||||
|
return (a > b) - (a < b)
|
||||||
|
|
||||||
class Server(object):
|
class Server(object):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.si = random.randrange(0, 2**31)
|
self.si = random.randrange(0, 2**31)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user