[Pkg-privacy-commits] [txtorcon] 85/96: pep8 fixes
Jérémy Bobbio
lunar at moszumanska.debian.org
Sun Sep 6 18:33:47 UTC 2015
This is an automated email from the git hooks/post-receive script.
lunar pushed a commit to branch master
in repository txtorcon.
commit b8722ef4be527dda7add5f21b62532c6c12fd256
Author: meejah <meejah at meejah.ca>
Date: Sun May 10 00:48:08 2015 -0600
pep8 fixes
---
test/test_torconfig.py | 1 +
test/test_torstate.py | 4 +---
txtorcon/endpoints.py | 2 +-
txtorcon/torconfig.py | 3 +--
txtorcon/torstate.py | 14 +++++++-------
5 files changed, 11 insertions(+), 13 deletions(-)
diff --git a/test/test_torconfig.py b/test/test_torconfig.py
index 4f676f2..278a1b1 100644
--- a/test/test_torconfig.py
+++ b/test/test_torconfig.py
@@ -1534,6 +1534,7 @@ client-name quux
descriptor-cookie asdlkjasdlfkjalsdkfffj==
'''
+
class HiddenServiceAuthTests(unittest.TestCase):
def test_parse_client_keys(self):
diff --git a/test/test_torstate.py b/test/test_torstate.py
index f3348b8..5b35f3b 100644
--- a/test/test_torstate.py
+++ b/test/test_torstate.py
@@ -373,16 +373,14 @@ class StateTests(unittest.TestCase):
"", # circuit-status
"", # stream-status
"", # address-mappings/all
- "entry-guards=\r\n$0000000000000000000000000000000000000000=name up\r\n$1111111111111111111111111111111111111111=foo up\r\n$9999999999999999999999999999999999999999=eman unusable 2012-01-01 22:00:00\r\n", # entry-guards
+ "entry-guards=\r\n$0000000000000000000000000000000000000000=name up\r\n$1111111111111111111111111111111111111111=foo up\r\n$9999999999999999999999999999999999999999=eman unusable 2012-01-01 22:00:00\r\n", # entry-guards
"99999", # process/pid
"??", # ip-to-country/0.0.0.0
]
)
-
state = yield TorState.from_protocol(protocol)
-
self.assertEqual(len(state.entry_guards), 2)
self.assertTrue('$0000000000000000000000000000000000000000' in state.entry_guards)
self.assertTrue('$1111111111111111111111111111111111111111' in state.entry_guards)
diff --git a/txtorcon/endpoints.py b/txtorcon/endpoints.py
index 1a383fb..8fa6239 100644
--- a/txtorcon/endpoints.py
+++ b/txtorcon/endpoints.py
@@ -400,7 +400,7 @@ class TCPHiddenServiceEndpoint(object):
info_callback.callback(None)
self.config.protocol.add_event_listener('INFO', info_event)
- if not self.hidden_service_dir in map(lambda hs: hs.dir, self.config.HiddenServices):
+ if self.hidden_service_dir not in map(lambda hs: hs.dir, self.config.HiddenServices):
self.hiddenservice = HiddenService(
self.config, self.hidden_service_dir,
['%d 127.0.0.1:%d' % (self.public_port, self.local_port)],
diff --git a/txtorcon/torconfig.py b/txtorcon/torconfig.py
index 519c0c8..41ed55a 100644
--- a/txtorcon/torconfig.py
+++ b/txtorcon/torconfig.py
@@ -798,7 +798,7 @@ def parse_client_keys(stream):
self.key = []
def create_key(self):
- if self.name != None:
+ if self.name is not None:
self.keys.append(HiddenServiceClientAuth(self.name, self.cookie, self.key))
self.reset()
@@ -814,7 +814,6 @@ def parse_client_keys(stream):
def add_key_line(self, line):
self.key.append(line)
-
from txtorcon.spaghetti import FSM, State, Transition
init = State('init')
got_name = State('got_name')
diff --git a/txtorcon/torstate.py b/txtorcon/torstate.py
index c25cd2d..c53fa2f 100644
--- a/txtorcon/torstate.py
+++ b/txtorcon/torstate.py
@@ -282,13 +282,13 @@ class TorState(object):
self._router = Router(self.protocol)
self._router.from_consensus = True
self._router.update(
- args[1], # nickname
- args[2], # idhash
- args[3], # orhash
- args[4] + ' ' + args[5], # modified (like '%Y-%m-%f %H:%M:%S')
- args[6], # ip address
- args[7], # ORPort
- args[8], # DirPort
+ args[1], # nickname
+ args[2], # idhash
+ args[3], # orhash
+ args[4] + ' ' + args[5], # modified (like '%Y-%m-%f %H:%M:%S')
+ args[6], # ip address
+ args[7], # ORPort
+ args[8], # DirPort
)
if self._router.id_hex in self.routers:
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/txtorcon.git
More information about the Pkg-privacy-commits
mailing list