##// END OF EJS Templates
code: flake8 fixes
super-admin -
r1063:5823ab6c python3
parent child Browse files
Show More
@@ -24,6 +24,7 b' class StatsdClientClass(Singleton):'
24 24 setup_run = False
25 25 statsd_client = None
26 26 statsd = None
27 strict_mode_init = False
27 28
28 29 def __getattribute__(self, name):
29 30
@@ -31,8 +32,9 b' class StatsdClientClass(Singleton):'
31 32 if self.setup_run:
32 33 return super(StatsdClientClass, self).__getattribute__(name)
33 34 else:
35 if self.strict_mode_init:
36 raise StatsdClientNotInitialised(f"requested key was {name}")
34 37 return None
35 #raise StatsdClientNotInitialised("requested key was %s" % name)
36 38
37 39 return super(StatsdClientClass, self).__getattribute__(name)
38 40
@@ -40,6 +42,8 b' class StatsdClientClass(Singleton):'
40 42 """
41 43 Initialize the client
42 44 """
45 strict_init_mode = settings.pop('statsd_strict_init', False)
46
43 47 statsd = client_from_config(settings)
44 48 self.statsd = statsd
45 49 self.statsd_client = statsd
@@ -73,7 +73,7 b' def _create_auth_baton(pool):'
73 73 'svn_auth_get_ssl_client_cert_file_provider',
74 74 'svn_auth_get_windows_simple_provider',
75 75 'svn_auth_get_windows_ssl_server_trust_provider',
76 ]
76 ]
77 77
78 78 providers = []
79 79
@@ -90,7 +90,7 b' def _create_auth_baton(pool):'
90 90 client.get_ssl_client_cert_file_provider(),
91 91 client.get_ssl_client_cert_pw_file_provider(),
92 92 client.get_ssl_server_trust_file_provider(),
93 ]
93 ]
94 94
95 95 return core.svn_auth_open(providers, pool)
96 96
@@ -40,7 +40,7 b' from dulwich.repo import Repo as Dulwich'
40 40 from dulwich.server import update_server_info
41 41
42 42 from vcsserver import exceptions, settings, subprocessio
43 from vcsserver.str_utils import safe_str, safe_int
43 from vcsserver.str_utils import safe_str, safe_int, safe_bytes
44 44 from vcsserver.base import RepoFactory, obfuscate_qs, ArchiveNode, archive_repo
45 45 from vcsserver.hgcompat import (
46 46 hg_url as url_parser, httpbasicauthhandler, httpdigestauthhandler)
@@ -824,12 +824,12 b' class GitRemote(RemoteBase):'
824 824
825 825 @reraise_safe_exceptions
826 826 def init(self, wire):
827 repo_path = str_to_dulwich(wire['path'])
827 repo_path = safe_str(wire['path'])
828 828 self.repo = Repo.init(repo_path)
829 829
830 830 @reraise_safe_exceptions
831 831 def init_bare(self, wire):
832 repo_path = str_to_dulwich(wire['path'])
832 repo_path = safe_str(wire['path'])
833 833 self.repo = Repo.init_bare(repo_path)
834 834
835 835 @reraise_safe_exceptions
@@ -52,7 +52,7 b' class FileLikeObj(object): # pragma: no'
52 52 def environ():
53 53 """Delete coverage variables, as they make the tests fail."""
54 54 env = dict(os.environ)
55 for key in env.keys():
55 for key in list(env.keys()):
56 56 if key.startswith('COV_CORE_'):
57 57 del env[key]
58 58
@@ -29,7 +29,7 b' def demo_app(environ, start_response):'
29 29 input_data = safe_str(environ['wsgi.input'].read(1024))
30 30
31 31 data = [
32 f'Hello World!\n',
32 'Hello World!\n',
33 33 f'input_data={input_data}\n',
34 34 ]
35 35 for key, value in sorted(environ.items()):
General Comments 0
You need to be logged in to leave comments. Login now