File: client.py

package info (click to toggle)
pyro4 4.82-2
  • links: PTS
  • area: main
  • in suites: bookworm
  • size: 2,528 kB
  • sloc: python: 17,736; makefile: 169; sh: 113; javascript: 62
file content (23 lines) | stat: -rw-r--r-- 664 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from __future__ import print_function
import sys

import Pyro4
import Pyro4.errors


if sys.version_info < (3, 0):
    input = raw_input

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

    try:
        print(remote.weird())
    except Pyro4.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)")