import Pyro.core
import Pyro.util
import Pyro.naming
import sys
from RemoteObject import *

class Modifier:
    def __init__(self, subject_name):
        self.subject = get_remote_object(subject_name)

    def modify(self):
    # increment the state of the Subject
        state = self.subject.get_state()
        self.subject.set_state(state+1)

def main(script, subject_name='bob', *args):
    # create a modifier and use it to change the state of the Subject
    modifier = Modifier(subject_name)
    modifier.modify()

if __name__ == '__main__':
    main(*sys.argv)
