From 535c7d0cdce3e65e6c03306e36a877f5505e9cdf Mon Sep 17 00:00:00 2001 From: Boudewijn Date: Fri, 12 Apr 2013 12:15:41 +0200 Subject: [PATCH] Using git makes revision.py obsolete. --- authentication.py | 4 ---- bloomfilter.py | 4 ---- bootstrap.py | 4 ---- callback.py | 4 ---- candidate.py | 4 ---- community.py | 4 ---- conversion.py | 4 ---- crypto.py | 4 ---- database.py | 5 ----- debug.py | 4 ---- debugcommunity.py | 4 ---- decorator.py | 4 ---- destination.py | 4 ---- dispersy.py | 4 ---- dispersydatabase.py | 4 ---- distribution.py | 4 ---- endpoint.py | 4 ---- member.py | 4 ---- message.py | 4 ---- meta.py | 4 ---- payload.py | 4 ---- requestcache.py | 4 ---- resolution.py | 4 ---- revision.py | 11 ----------- script.py | 4 ---- singleton.py | 4 ---- statistics.py | 6 ------ timeline.py | 4 ---- 28 files changed, 122 deletions(-) delete mode 100644 revision.py diff --git a/authentication.py b/authentication.py index 77d94a55..5c9b1315 100644 --- a/authentication.py +++ b/authentication.py @@ -11,10 +11,6 @@ """ from .meta import MetaObject -from .revision import update_revision_information - -# update version information directly from SVN -update_revision_information("$HeadURL$", "$Revision$") class Authentication(MetaObject): """ diff --git a/bloomfilter.py b/bloomfilter.py index ccdd6ef0..e1960761 100644 --- a/bloomfilter.py +++ b/bloomfilter.py @@ -21,16 +21,12 @@ from binascii import hexlify, unhexlify from .decorator import Constructor, constructor -from .revision import update_revision_information if __debug__: from time import time from .dprint import dprint from .decorator import attach_profiler -# update version information directly from SVN -update_revision_information("$HeadURL$", "$Revision$") - class BloomFilter(Constructor): def _init_(self, m_size, k_functions, prefix, filter_): assert isinstance(m_size, int) diff --git a/bootstrap.py b/bootstrap.py index 6bf7c218..dbfbb7ff 100644 --- a/bootstrap.py +++ b/bootstrap.py @@ -2,10 +2,6 @@ from socket import gethostbyname from .candidate import BootstrapCandidate -from .revision import update_revision_information - -# update version information directly from SVN -update_revision_information("$HeadURL$", "$Revision$") _trackers = [(u"dispersy1.tribler.org", 6421), (u"dispersy2.tribler.org", 6422), diff --git a/callback.py b/callback.py index bf7b68e5..adae0b40 100644 --- a/callback.py +++ b/callback.py @@ -19,7 +19,6 @@ from .decorator import attach_profiler from .dprint import dprint -from .revision import update_revision_information if __debug__: from atexit import register as atexit_register @@ -30,9 +29,6 @@ # dprint warning when registered call, or generator call, should have run N seconds ago QUEUE_DELAY_FOR_WARNING = 1.0 -# update version information directly from SVN -update_revision_information("$HeadURL$", "$Revision$") - class Callback(object): if __debug__: @staticmethod diff --git a/candidate.py b/candidate.py index 1813778c..ba3be5ca 100644 --- a/candidate.py +++ b/candidate.py @@ -12,10 +12,6 @@ def is_address(address): assert address[1] >= 0, address[1] return True -# update version information directly from SVN -from .revision import update_revision_information -update_revision_information("$HeadURL$", "$Revision$") - # delay and lifetime values are chosen to ensure that a candidate will not exceed 60.0 or 30.0 # seconds. However, taking into account round trip time and processing delay we to use smaller # values without conflicting with the next 5.0 walk cycle. Hence, we pick 2.5 seconds below the diff --git a/community.py b/community.py index cda9d2e9..474ba7db 100644 --- a/community.py +++ b/community.py @@ -29,14 +29,10 @@ from .dprint import dprint from .member import DummyMember, Member, MemberFromId from .resolution import PublicResolution, LinearResolution, DynamicResolution -from .revision import update_revision_information from .statistics import CommunityStatistics from .timeline import Timeline from .candidate import WalkCandidate -# update version information directly from SVN -update_revision_information("$HeadURL$", "$Revision$") - class SyncCache(object): def __init__(self, time_low, time_high, modulo, offset, bloom_filter): self.time_low = time_low diff --git a/conversion.py b/conversion.py index 005861e0..c8bb16ce 100644 --- a/conversion.py +++ b/conversion.py @@ -12,7 +12,6 @@ from .distribution import FullSyncDistribution, LastSyncDistribution, DirectDistribution from .message import DelayPacketByMissingMember, DropPacket, Message from .resolution import PublicResolution, LinearResolution, DynamicResolution -from .revision import update_revision_information if __debug__: from .authentication import Authentication @@ -22,9 +21,6 @@ from .dprint import dprint from .resolution import Resolution -# update version information directly from SVN -update_revision_information("$HeadURL$", "$Revision$") - class Conversion(object): """ A Conversion object is used to convert incoming packets to a different, possibly more recent, diff --git a/crypto.py b/crypto.py index 99350062..71280e7b 100644 --- a/crypto.py +++ b/crypto.py @@ -6,10 +6,6 @@ @contact: dispersy@frayja.com """ -# update version information directly from SVN -from .revision import update_revision_information -update_revision_information("$HeadURL$", "$Revision$") - if False: # # disable crypto diff --git a/database.py b/database.py index 080d2342..f7aa1471 100644 --- a/database.py +++ b/database.py @@ -12,7 +12,6 @@ import sqlite3 from .dprint import dprint -from .revision import update_revision_information from .singleton import Singleton if __debug__: @@ -28,10 +27,6 @@ while exists(DB_DEBUG_FILE): DB_DEBUG_FILE="database_queries_%d.txt" % randint(1,9999999) - -# update version information directly from SVN -update_revision_information("$HeadURL$", "$Revision$") - class IgnoreCommits(Exception): """ Ignore all commits made within the body of a 'with database:' clause. diff --git a/debug.py b/debug.py index dc5cc1ba..cd908292 100644 --- a/debug.py +++ b/debug.py @@ -13,10 +13,6 @@ from .dprint import dprint from .member import Member from .message import Message -from .revision import update_revision_information - -# update version information directly from SVN -update_revision_information("$HeadURL$", "$Revision$") class DebugOnlyMember(Member): _cache = OrderedDict() diff --git a/debugcommunity.py b/debugcommunity.py index 227379da..c7878e6f 100644 --- a/debugcommunity.py +++ b/debugcommunity.py @@ -12,10 +12,6 @@ from .message import Message, DropPacket, DelayMessageByProof from .payload import Payload from .resolution import PublicResolution, LinearResolution, DynamicResolution -from .revision import update_revision_information - -# update version information directly from SVN -update_revision_information("$HeadURL$", "$Revision$") # # Node diff --git a/decorator.py b/decorator.py index 0885c9fa..7bfe6742 100644 --- a/decorator.py +++ b/decorator.py @@ -4,10 +4,6 @@ from .dprint import dprint -# update version information directly from SVN -from .revision import update_revision_information -update_revision_information("$HeadURL$", "$Revision$") - class Constructor(object): """ Allow a class to have multiple constructors. The right one will diff --git a/destination.py b/destination.py index 46aadf97..8a0d8daa 100644 --- a/destination.py +++ b/destination.py @@ -1,8 +1,4 @@ from .meta import MetaObject -from .revision import update_revision_information - -# update version information directly from SVN -update_revision_information("$HeadURL$", "$Revision$") class Destination(MetaObject): class Implementation(MetaObject.Implementation): diff --git a/dispersy.py b/dispersy.py index 01c6cb6f..a91199a0 100644 --- a/dispersy.py +++ b/dispersy.py @@ -72,14 +72,10 @@ from .payload import SignatureRequestPayload, SignatureResponsePayload from .requestcache import Cache, RequestCache from .resolution import PublicResolution, LinearResolution -from .revision import update_revision_information from .statistics import DispersyStatistics from .singleton import Singleton from .singleton import cleanup as cleanup_singletons -# update version information directly from SVN -update_revision_information("$HeadURL$", "$Revision$") - # the callback identifier for the task that periodically takes a step CANDIDATE_WALKER_CALLBACK_ID = "dispersy-candidate-walker" diff --git a/dispersydatabase.py b/dispersydatabase.py index 54dd7d87..6655e2e2 100644 --- a/dispersydatabase.py +++ b/dispersydatabase.py @@ -17,10 +17,6 @@ from .distribution import FullSyncDistribution from .dprint import dprint -from .revision import update_revision_information - -# update version information directly from SVN -update_revision_information("$HeadURL$", "$Revision$") LATEST_VERSION = 16 diff --git a/distribution.py b/distribution.py index babef5d2..4c705d64 100644 --- a/distribution.py +++ b/distribution.py @@ -1,8 +1,4 @@ from .meta import MetaObject -from .revision import update_revision_information - -# update version information directly from SVN -update_revision_information("$HeadURL$", "$Revision$") """ Each Privilege can be distributed, usualy through the transfer of a message, in different ways. diff --git a/endpoint.py b/endpoint.py index abd2667b..b5203b53 100644 --- a/endpoint.py +++ b/endpoint.py @@ -11,14 +11,10 @@ import threading from .candidate import Candidate -from .revision import update_revision_information if __debug__: from .dprint import dprint -# update version information directly from SVN -update_revision_information("$HeadURL$", "$Revision$") - if sys.platform == 'win32': SOCKET_BLOCK_ERRORCODE = 10035 # WSAEWOULDBLOCK else: diff --git a/member.py b/member.py index 09579df9..6a7d3426 100644 --- a/member.py +++ b/member.py @@ -8,15 +8,11 @@ from .dispersydatabase import DispersyDatabase from .crypto import ec_from_private_bin, ec_from_public_bin, ec_signature_length, ec_verify, ec_sign -from .revision import update_revision_information if __debug__: from .dprint import dprint from .crypto import ec_check_public_bin, ec_check_private_bin -# update version information directly from SVN -update_revision_information("$HeadURL$", "$Revision$") - def cleanup(): """ Removes all member caches. diff --git a/message.py b/message.py index 719e46df..21e9badb 100644 --- a/message.py +++ b/message.py @@ -1,13 +1,9 @@ from .member import DummyMember from .meta import MetaObject -from .revision import update_revision_information if __debug__: from .dprint import dprint -# update version information directly from SVN -update_revision_information("$HeadURL$", "$Revision$") - # # Exceptions # diff --git a/meta.py b/meta.py index a6213485..b14e5e42 100644 --- a/meta.py +++ b/meta.py @@ -1,10 +1,6 @@ import inspect from .dprint import dprint -from .revision import update_revision_information - -# update version information directly from SVN -update_revision_information("$HeadURL$", "$Revision$") class MetaObject(object): class Implementation(object): diff --git a/payload.py b/payload.py index 5f94cd64..e063be13 100644 --- a/payload.py +++ b/payload.py @@ -1,7 +1,6 @@ from hashlib import sha1 from .meta import MetaObject -from .revision import update_revision_information if __debug__: from .bloomfilter import BloomFilter @@ -15,9 +14,6 @@ def is_address(address): assert address[1] >= 0, address[1] return True -# update version information directly from SVN -update_revision_information("$HeadURL$", "$Revision$") - class Payload(MetaObject): class Implementation(MetaObject.Implementation): pass diff --git a/requestcache.py b/requestcache.py index a26a5ecd..7910a6e4 100644 --- a/requestcache.py +++ b/requestcache.py @@ -1,14 +1,10 @@ from random import random -from .revision import update_revision_information if __debug__: def identifier_to_string(identifier): return identifier.encode("HEX") if isinstance(identifier, str) else identifier from .dprint import dprint -# update version information directly from SVN -update_revision_information("$HeadURL$", "$Revision$") - class Cache(object): timeout_delay = 10.0 cleanup_delay = 10.0 diff --git a/resolution.py b/resolution.py index e9a1b4b4..26bcdd66 100644 --- a/resolution.py +++ b/resolution.py @@ -1,8 +1,4 @@ from .meta import MetaObject -from .revision import update_revision_information - -# update version information directly from SVN -update_revision_information("$HeadURL$", "$Revision$") class Resolution(MetaObject): class Implementation(MetaObject.Implementation): diff --git a/revision.py b/revision.py deleted file mode 100644 index 1445d2c7..00000000 --- a/revision.py +++ /dev/null @@ -1,11 +0,0 @@ -_revision_information = {} - -def update_revision_information(url, revision): - if not (url == "$HeadURL$" and revision == "$Revision$"): - _revision_information[url[10:-2]] = int(revision[11:-2]) - -def get_revision_information(): - return _revision_information - -def get_revision(): - return max(_revision_information.itervalues()) diff --git a/script.py b/script.py index f2982e44..2f690f6e 100644 --- a/script.py +++ b/script.py @@ -27,12 +27,8 @@ from .member import Member from .message import BatchConfiguration, Message, DelayMessageByProof, DropMessage from .resolution import PublicResolution, LinearResolution -from .revision import update_revision_information from .tool.lencoder import log, make_valid_key -# update version information directly from SVN -update_revision_information("$HeadURL$", "$Revision$") - def assert_(value, *args): if not value: raise AssertionError(*args) diff --git a/singleton.py b/singleton.py index 38f193af..c5b6ad6c 100644 --- a/singleton.py +++ b/singleton.py @@ -9,10 +9,6 @@ from random import sample from threading import RLock -# update version information directly from SVN -from .revision import update_revision_information -update_revision_information("$HeadURL$", "$Revision$") - def cleanup(): """ Removes all singleton instances from existing Singleton subclasses diff --git a/statistics.py b/statistics.py index d5ad990e..f0538a0c 100644 --- a/statistics.py +++ b/statistics.py @@ -1,10 +1,5 @@ from time import time -from .revision import update_revision_information, get_revision_information - -# update version information directly from SVN -update_revision_information("$HeadURL: https://svn.tribler.org/dispersy/branches/20120612-27046-mainbranch/dispersy.py $", "$Revision: 28434 $") - class Statistics(): @staticmethod def dict_inc(dictionary, key, value=1L): @@ -25,7 +20,6 @@ def __init__(self, dispersy): self.connection_type = None self.database_version = dispersy.database.database_version self.lan_address = None - self.revision = get_revision_information() self.start = self.timestamp = time() # nr packets received diff --git a/timeline.py b/timeline.py index da654acc..a80e1245 100644 --- a/timeline.py +++ b/timeline.py @@ -7,14 +7,10 @@ from .authentication import MemberAuthentication, DoubleMemberAuthentication from .resolution import PublicResolution, LinearResolution, DynamicResolution -from .revision import update_revision_information if __debug__: from .dprint import dprint -# update version information directly from SVN -update_revision_information("$HeadURL$", "$Revision$") - class Timeline(object): def __init__(self, community): if __debug__: