File: client.py

package info (click to toggle)
pyro5 5.16-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,124 kB
  • sloc: python: 14,328; makefile: 161; sh: 66; javascript: 62
file content (17 lines) | stat: -rw-r--r-- 565 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from Pyro5.api import Proxy
import Pyro5.errors


uri = input("Enter the URI of the thirdparty library object: ").strip()
with Proxy(uri) as remote:
    print(remote.method("how are you?"))

    try:
        print(remote.weird())
    except Pyro5.errors.SerializeError:
        print("couldn't call weird() due to serialization error of the result value! (is ok)")

    try:
        print(remote.private())    # we can call this if full class is exposed...
    except AttributeError:
        print("couldn't call private(), it doesn't seem to be exposed! (is ok)")