[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [stem/master] Localize protocol attributes into a LinkProtocol class
commit 7f7f1714f54326c6f75f5abf42ec8fa059003f11
Merge: 7b3df73f 526dc8b2
Author: Damian Johnson <atagar@xxxxxxxxxxxxxx>
Date: Sat Jun 16 16:44:32 2018 -0700
Localize protocol attributes into a LinkProtocol class
Several constants vary depending on our link protocol version. Rather than
encoding a bunch of 'x if link_protocol > y else z' conditionals centralizing
this in a LinkProtocol class.
LinkPrococol.for_version() normalizes an integer *or* LinkProtocol into a
LinkProtocol.
Pattern we should follow is:
* Public methods should always accept an integer.
* Any time we use or store a link protocol version it's normalized to a
LinkPrococol class.
stem/client/__init__.py | 16 +++++-----------
stem/client/cell.py | 20 +++++++++++---------
stem/client/datatype.py | 30 ++++++++++++++++++++++++++++++
3 files changed, 46 insertions(+), 20 deletions(-)
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits