projects
/
pyassuan.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
client: add Unix-socket handling to .connect() and .disconnect().
[pyassuan.git]
/
bin
/
get-info.py
diff --git
a/bin/get-info.py
b/bin/get-info.py
index bba87c35cc2d27193f8b7e1d208f9cb285620ff1..9f0f50f04479ee3df6d1fb788740a6027af6621a 100755
(executable)
--- a/
bin/get-info.py
+++ b/
bin/get-info.py
@@
-19,8
+19,6
@@
"""Simple pinentry program for getting server info.
"""
"""Simple pinentry program for getting server info.
"""
-import socket as _socket
-
from pyassuan import __version__
from pyassuan import client as _client
from pyassuan import common as _common
from pyassuan import __version__
from pyassuan import client as _client
from pyassuan import common as _common
@@
-47,11
+45,7
@@
if __name__ == '__main__':
client.logger.setLevel(max(
logging.DEBUG, client.logger.level - 10*args.verbose))
client.logger.setLevel(max(
logging.DEBUG, client.logger.level - 10*args.verbose))
- socket = _socket.socket(_socket.AF_UNIX, _socket.SOCK_STREAM)
- socket.connect(args.filename)
- client.input = socket.makefile('rb')
- client.output = socket.makefile('wb')
- client.connect()
+ client.connect(socket_path=args.filename)
try:
response = client.read_response()
assert response.type == 'OK', response
try:
response = client.read_response()
assert response.type == 'OK', response
@@
-68,5
+62,3
@@
if __name__ == '__main__':
finally:
client.make_request(_common.Request('BYE'))
client.disconnect()
finally:
client.make_request(_common.Request('BYE'))
client.disconnect()
- socket.shutdown(_socket.SHUT_RDWR)
- socket.close()