def __init__(self, server="mod_python"): methods = ["echo", "reverse", "uppercase", "lowercase", "nonexistant"] if server == "mod_python": JSONProxy.__init__(self, "services/EchoService.py", methods) elif server == "flask": JSONProxy.__init__( self, "http://localhost:5000/json_echo/", methods)
def __init__(self): if DEBUG == True : services = 'services/' else: services = self.ROOT_URL JSONProxy.__init__(self, services, DataService.methods)
def __init__(self): JSONProxy.__init__(self, "No service name", [ "YAML_echo", "YAML_AMS_Connect", "YAML_AMS_Comm_attach", "YAML_AMS_Comm_get_memory_list", "YAML_AMS_Memory_attach", "YAML_AMS_Memory_get_field_list", "YAML_AMS_Memory_get_field_info", "YAML_AMS_Memory_set_field_info", "YAML_AMS_Memory_update_send_begin" ])
def __init__(self): JSONProxy.__init__(self, '/admin/tickery', ['getQueueWidth', 'setQueueWidth', 'queueSize', 'queuePaused', 'pause', 'resume', 'getQueued', 'getUnderway', 'setMaxRequestsLimit', 'getMaxRequestsLimit', 'setFriendsLimit', 'getFriendsLimit', 'setResultsLimit', 'getResultsLimit', 'directAddUser', 'bulkAddUsers', 'cancel'])
def __init__(self): JSONProxy.__init__(self, "/JSON", ["login", "logout", "get_doc_types", "get_schema_version", "get_documents", "get_provider_inbox_data", "get_patient_messages", "doSomething", "search_patient"])
def __init__(self): # Since this is a singleton, throw an exception if the constructor is called # explicitly. if GlibRPCService._onlyInstance!=None : raise Exception( "GlibRPCService is a singleton class. Call 'GlibRPCService.instance()' to get the only running instance" ) JSONProxy.__init__(self, "services/GlibControlProxy.py", ["getStates","connectedCBCNames", "I2CRegisterValues","setI2CRegisterValues","saveI2cRegisterValues","loadI2cRegisterValues", "startProcesses","killProcesses","boardIsReachable", "stopTakingData","startSCurveRun","startOccupancyCheck","startTrimCalibration", "getDataTakingStatus","getOccupancies","createHistogram","saveHistograms"] )
def onModuleLoad(self): self.TEXT_WAITING = "Waiting for response..." self.TEXT_ERROR = "Server Error" self.remote = JSONProxy("../api", ["hello"]) self.status = Label() self.text_box = TextBox() self.button_send = Button("Send", self) buttons = HorizontalPanel() buttons.add(self.button_send) buttons.setSpacing(8) info = """<h2>JSON-RPC Example</h2> <p>This example demonstrates the calling of server services with <a href="http://json-rpc.org/">JSON-RPC</a>. </p> <p>Enter your name below.</p>""" panel = VerticalPanel() panel.add(HTML(info)) panel.add(self.text_box) #panel.add(method_panel) panel.add(buttons) panel.add(self.status) RootPanel().add(panel)
class JSONRPCExample: def onModuleLoad(self): self.TEXT_WAITING = "Waiting for response..." self.TEXT_ERROR = "Server Error" self.remote = JSONProxy("../api", ["hello"]) self.status = Label() self.text_box = TextBox() self.button_send = Button("Send", self) buttons = HorizontalPanel() buttons.add(self.button_send) buttons.setSpacing(8) info = """<h2>JSON-RPC Example</h2> <p>This example demonstrates the calling of server services with <a href="http://json-rpc.org/">JSON-RPC</a>. </p> <p>Enter your name below.</p>""" panel = VerticalPanel() panel.add(HTML(info)) panel.add(self.text_box) #panel.add(method_panel) panel.add(buttons) panel.add(self.status) RootPanel().add(panel) def onClick(self, sender): self.status.setText(self.TEXT_WAITING) text = self.text_box.getText() id = self.remote.hello(text, self) def onRemoteResponse(self, response, request_info): self.status.setText(response) def onRemoteError(self, code, errobj, request_info): # onRemoteError gets the HTTP error code or 0 and # errobj is an jsonrpc 2.0 error dict: # { # 'code': jsonrpc-error-code (integer) , # 'message': jsonrpc-error-message (string) , # 'data' : extra-error-data # } message = errobj['message'] if code != 0: self.status.setText("HTTP error %d: %s" % (code, message)) else: code = errobj['code'] self.status.setText("JSONRPC Error %s: %s" % (code, message))
def __init__(self, server="mod_python", flask_view_type="function"): methods = ["echo", "reverse", "uppercase", "lowercase", "nonexistant"] if server == "mod_python": JSONProxy.__init__(self, "services/EchoService.py", methods) elif server == "flask": if(flask_view_type == "function"): JSONProxy.__init__( self, "http://localhost:5000/json_echo/", methods) elif(flask_view_type == "class"): JSONProxy.__init__( self, "http://localhost:5000/json_echo_class", methods) elif(flask_view_type == "celery"): methods.append("get_result") JSONProxy.__init__( self, "http://localhost:5000/json_celery_class", methods)
def __init__(self, server="mod_python", flask_view_type="function"): methods = ["echo", "reverse", "uppercase", "lowercase", "nonexistant"] if server == "mod_python": JSONProxy.__init__(self, "services/EchoService.py", methods) elif server == "flask": if (flask_view_type == "function"): JSONProxy.__init__(self, "http://localhost:5000/json_echo/", methods) elif (flask_view_type == "class"): JSONProxy.__init__(self, "http://localhost:5000/json_echo_class", methods) elif (flask_view_type == "celery"): methods.append("get_result") JSONProxy.__init__(self, "http://localhost:5000/json_celery_class", methods)
def __init__(self): JSONProxy.__init__(self, 'services/', DataService.methods, {'X-CSRFToken': getCookie('csrftoken')})
def __init__(self): JSONProxy.__init__(self, "/services/", ["getAllSongs", "addSong", "deleteSong", "getSong"])
def __init__(self): JSONProxy.__init__(self, "/services/pages/", ["getPage", "updatePage", "getPages", "addPage", "getPageByName", "deletePage"])
def __init__(self): JSONProxy.__init__(self, 'process/')
def __init__(self): JSONProxy.__init__(self, "/echo", ["echo", "reverse", "uppercase", "lowercase", "nonexistant"])
def __init__(self): ## services/mloctavealgorithms.py counts from output folder JSONProxy.__init__(self, "services/mlOctaveAlgorithms.py", ["callMethod", "test"])
def __init__(self): JSONProxy.__init__(self, "/RPC2", SchoolbellRPC.methods)
def __init__(self): JSONProxy.__init__( self, "services/EchoService.py", ["echo", "reverse", "uppercase", "lowercase", "nonexistant"])
def __init__(self): JSONProxy.__init__(self, "/infoservice/EchoService.py", ["index"])
def __init__( self ): JSONProxy.__init__( self, "/services/mapservices", ["usernames", "points", "pointinfo", 'shakeevents'] )
def __init__(self): JSONProxy.__init__(self, "SchoolCalendarService.php", ["getPeople"])
def __init__(self): JSONProxy.__init__(self, '/json', ['find_one', 'insert'])
def __init__(self): JSONProxy.__init__(self, "test", [ "echo", "reverse", "uppercase", "lowercase", "echo_client_info", "nonexistant" ])
def __init__(self): JSONProxy.__init__(self, "/services/wanted/", ["getItem", "getItems"])
def __init__(self): JSONProxy.__init__(self, "services/EchoService.py", ["index"])
def __init__(self): JSONProxy.__init__(self, "/services/", ["add_post", "get_posts", "update_post", "delete_post"])
def __init__(self): JSONProxy.__init__(self, "/services/forms/", ["itemform", ])
def __init__(self): JSONProxy.__init__(self, "/obj/handler", ["call", "methods"], True)
def __init__(self): JSONProxy.__init__(self, "/json", ["buses"])
def __init__(self): JSONProxy.__init__(self, '/tickery', ['nUsers', 'spideredScreennames', 'friendOf', 'intermediateQuery', 'fluidDBQuery', 'simpleTweet', 'tweet', 'login', 'logout', 'screenameFromCookie', 'friendsIds', 'follow', 'unfollow'])
def __init__(self): JSONProxy.__init__(self, '/json', ['find_one','insert'])
def __init__(self): """ Constructs a new RegionNamesServicePython instance. """ JSONProxy.__init__(self, "/json", ["get_geographical_region_names"])
def __init__(self): JSONProxy.__init__(self, "No service name", ["YAML_echo", "YAML_AMS_Connect", "YAML_AMS_Comm_attach", "YAML_AMS_Comm_get_memory_list","YAML_AMS_Memory_attach","YAML_AMS_Memory_get_field_list","YAML_AMS_Memory_get_field_info"])
def __init__(self): JSONProxy.__init__(self, "/infoservice/EchoService.py", [ "get_midpanel_data", "get_rightpanel_datanames", "get_rightpanel_data" ])
def __init__(self): JSONProxy.__init__(self, "services/EchoService.py", ["echo", "reverse", "uppercase", "lowercase", "nonexistant"])
def __init__(self): JSONProxy.__init__(self, 'services/', DataService.methods)
def __init__(self, url): JSONProxy.__init__(self, url, ["fetch"])
def __init__(self): JSONProxy.__init__(self, "/services/pages/", [ "getPage", "updatePage", "getPages", "addPage", "getPageByName", "deletePage" ])
def __init__(self): JSONProxy.__init__(self, "/services/forms/", [ "itemform", ])
def __init__(self): JSONProxy.__init__(self, "/services/email.py", ["send"])
def __init__(self): JSONProxy.__init__( self, "services/LatBuilderService.py", ['latbuilder_exec', 'backend_version', 'array_from_expr'])
def __init__(self): JSONProxy.__init__(self, "/services/", ["getTasks", "addTask", "deleteTask"])
def __init__(self): JSONProxy.__init__(self, "/maps/default/call/jsonrpc", ["getPoints"])
def __init__(self): JSONProxy.__init__(self, "/Accession/json", ["echo", "reverse", "uppercase", "lowercase"])
def __init__(self): JSONProxy.__init__(self, "/obj/handler", ["call","methods"], True)
def __init__(self): if DEBUG == True: services = 'services/' else: services = self.ROOT_URL JSONProxy.__init__(self, services, DataService.methods)