Skip to content

Commit d2651c9

Browse files
committed
Prefix (HTTP_TIMEOUT|USER_AGENT) to DEFAULT_foo
Constants; changing them does nothing. [ yapified by gitreformat (github/ghtdak) on Mon Nov 30 21:11:13 2015 ]
1 parent f5ab2fe commit d2651c9

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

bitcoin/rpc.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@
3434
from bitcoin.core.script import CScript
3535
from bitcoin.wallet import CBitcoinAddress
3636

37-
USER_AGENT = "AuthServiceProxy/0.1"
37+
DEFAULT_USER_AGENT = "AuthServiceProxy/0.1"
3838

39-
HTTP_TIMEOUT = 30
39+
DEFAULT_HTTP_TIMEOUT = 30
4040

4141
# (un)hexlify to/from unicode, needed for Python3
4242
unhexlify = binascii.unhexlify
@@ -60,7 +60,7 @@ def __init__(self,
6060
service_url=None,
6161
service_port=None,
6262
btc_conf_file=None,
63-
timeout=HTTP_TIMEOUT,
63+
timeout=DEFAULT_HTTP_TIMEOUT,
6464
_connection=None):
6565
"""Low-level JSON-RPC proxy
6666
@@ -142,7 +142,7 @@ def _call(self, service_name, *args):
142142
'id': self.__id_count})
143143
self.__conn.request('POST', self.__url.path, postdata,
144144
{'Host': self.__url.hostname,
145-
'User-Agent': USER_AGENT,
145+
'User-Agent': DEFAULT_USER_AGENT,
146146
'Authorization': self.__auth_header,
147147
'Content-type': 'application/json'})
148148

@@ -174,7 +174,7 @@ def _batch(self, rpc_call_list):
174174
postdata = json.dumps(list(rpc_call_list))
175175
self.__conn.request('POST', self.__url.path, postdata,
176176
{'Host': self.__url.hostname,
177-
'User-Agent': USER_AGENT,
177+
'User-Agent': DEFAULT_USER_AGENT,
178178
'Authorization': self.__auth_header,
179179
'Content-type': 'application/json'})
180180

@@ -198,7 +198,7 @@ def __init__(self,
198198
service_url=None,
199199
service_port=None,
200200
btc_conf_file=None,
201-
timeout=HTTP_TIMEOUT,
201+
timeout=DEFAULT_HTTP_TIMEOUT,
202202
**kwargs):
203203
"""Create a proxy to a bitcoin RPC service
204204

0 commit comments

Comments
 (0)