-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Replace xmlrpc with jsonrpclib in server and client
- Loading branch information
Showing
2 changed files
with
13 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,3 @@ | ||
from xmlrpc.client import ServerProxy | ||
from jsonrpclib import Server | ||
|
||
|
||
class Proxy: | ||
def __init__(self, url): | ||
self._xmlrpc_server_proxy = ServerProxy(url) | ||
def __getattr__(self, name): | ||
call_proxy = getattr(self._xmlrpc_server_proxy, name) | ||
def _call(*args, **kwargs): | ||
return call_proxy(args, kwargs) | ||
return _call | ||
|
||
|
||
proxy = Proxy('http://localhost:10000') | ||
proxy = Server("http://localhost:10000") |