示例#1
0
 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)
示例#2
0
 def __init__(self):
     if DEBUG == True :
         services = 'services/'
     else: 
         services = self.ROOT_URL
     JSONProxy.__init__(self, services, 
                        DataService.methods)
示例#3
0
 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"
     ])
示例#4
0
 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'])
示例#5
0
文件: Remote.py 项目: ncqgm/gnumed
 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"] )
示例#7
0
    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)
示例#8
0
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))
示例#9
0
 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)
示例#10
0
 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)
示例#11
0
 def __init__(self):
     JSONProxy.__init__(self, 'services/', DataService.methods, {'X-CSRFToken': getCookie('csrftoken')})
示例#12
0
 def __init__(self):
     JSONProxy.__init__(self, "/services/", ["getAllSongs", "addSong", "deleteSong", "getSong"])
示例#13
0
文件: WebPage.py 项目: Afey/pyjs
 def __init__(self):
     JSONProxy.__init__(self, "/services/pages/",
              ["getPage", "updatePage",
               "getPages", "addPage",
               "getPageByName",
               "deletePage"])
示例#14
0
 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"])
示例#17
0
 def __init__(self):
     JSONProxy.__init__(self, "/RPC2", SchoolbellRPC.methods)
示例#18
0
 def __init__(self):
     JSONProxy.__init__(
         self, "services/EchoService.py",
         ["echo", "reverse", "uppercase", "lowercase", "nonexistant"])
示例#19
0
 def __init__(self):
     JSONProxy.__init__(self, "/infoservice/EchoService.py",
                                 ["index"])
示例#20
0
 def __init__( self ):
     JSONProxy.__init__( self, "/services/mapservices", ["usernames", "points", "pointinfo", 'shakeevents'] )
示例#21
0
 def __init__(self):
     JSONProxy.__init__(self, "SchoolCalendarService.php", ["getPeople"])
示例#22
0
 def __init__(self):
     JSONProxy.__init__(self, '/json', ['find_one', 'insert'])
示例#23
0
 def __init__(self):
     JSONProxy.__init__(self, "test", [
         "echo", "reverse", "uppercase", "lowercase", "echo_client_info",
         "nonexistant"
     ])
示例#24
0
 def __init__(self):
     JSONProxy.__init__(self, "/services/wanted/", ["getItem", "getItems"])
示例#25
0
 def __init__(self):
     JSONProxy.__init__(self, "services/EchoService.py",
                                 ["index"])
示例#26
0
文件: model.py 项目: ygyangguang/pyjs
 def __init__(self):
     JSONProxy.__init__(self, "/services/", ["add_post",
         "get_posts", "update_post", "delete_post"])
示例#27
0
文件: WebPage.py 项目: brodybits/pyjs
 def __init__(self):
     JSONProxy.__init__(self, "/services/forms/",
              ["itemform",
              ])
 def __init__(self):
     JSONProxy.__init__(self, "/obj/handler", ["call", "methods"], True)
示例#29
0
文件: WebPage.py 项目: brodybits/pyjs
 def __init__(self):
     JSONProxy.__init__(self, "/services/wanted/",
              ["getItem", 
               "getItems"])
示例#30
0
 def __init__(self):
     JSONProxy.__init__(self, "/json", ["buses"])
示例#31
0
文件: server.py 项目: jdunck/Tickery
 def __init__(self):
     JSONProxy.__init__(self, '/tickery',
         ['nUsers', 'spideredScreennames', 'friendOf', 'intermediateQuery',
          'fluidDBQuery', 'simpleTweet',  'tweet', 'login', 'logout',
          'screenameFromCookie', 'friendsIds', 'follow', 'unfollow'])
示例#32
0
 def __init__(self):
     JSONProxy.__init__(self, "SchoolCalendarService.php", ["getPeople"])
示例#33
0
文件: Wiki.py 项目: brodybits/pyjs
 def __init__(self):
     JSONProxy.__init__(self, '/json', ['find_one','insert'])
示例#34
0
 def __init__(self):
     """ Constructs a new RegionNamesServicePython instance.
     """
     JSONProxy.__init__(self, "/json", ["get_geographical_region_names"])
示例#35
0
 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"])
示例#36
0
 def __init__(self):
     JSONProxy.__init__(self, "/infoservice/EchoService.py", [
         "get_midpanel_data", "get_rightpanel_datanames",
         "get_rightpanel_data"
     ])
示例#37
0
 def __init__(self):
     JSONProxy.__init__(self, "services/EchoService.py", ["echo", "reverse", "uppercase", "lowercase", "nonexistant"])
示例#38
0
    def __init__(self):
		JSONProxy.__init__(self, 'services/', DataService.methods)
示例#39
0
	def __init__(self, url):
		JSONProxy.__init__(self, url, ["fetch"])
示例#40
0
 def __init__(self):
     JSONProxy.__init__(self, "/services/pages/", [
         "getPage", "updatePage", "getPages", "addPage", "getPageByName",
         "deletePage"
     ])
示例#41
0
 def __init__(self):
     JSONProxy.__init__(self, "/services/forms/", [
         "itemform",
     ])
示例#42
0
文件: Email.py 项目: wkornewald/pyjs
 def __init__(self):
     JSONProxy.__init__(self, "/services/email.py", ["send"])
示例#43
0
 def __init__(self):
     JSONProxy.__init__(
         self, "services/LatBuilderService.py",
         ['latbuilder_exec', 'backend_version', 'array_from_expr'])
示例#44
0
 def __init__(self):
     JSONProxy.__init__(self, "/services/",
                        ["getTasks", "addTask", "deleteTask"])
示例#45
0
 def __init__(self):
     JSONProxy.__init__(self, 'process/')
示例#46
0
 def __init__(self):
     JSONProxy.__init__(self, "/maps/default/call/jsonrpc", ["getPoints"])
示例#47
0
	def __init__(self):
		JSONProxy.__init__(self, "/Accession/json", ["echo", "reverse", "uppercase", "lowercase"])
示例#48
0
 def __init__(self):
     """ Constructs a new RegionNamesServicePython instance.
     """
     JSONProxy.__init__(self, "/json", ["get_geographical_region_names"])
示例#49
0
文件: oldExample.py 项目: Afey/pyjs
 def __init__(self):
     JSONProxy.__init__(self, "/maps/default/call/jsonrpc", ["getPoints"])
示例#50
0
 def __init__(self):
     JSONProxy.__init__(self, "/obj/handler", ["call","methods"], True)
示例#51
0
 def __init__(self):
     if DEBUG == True:
         services = 'services/'
     else:
         services = self.ROOT_URL
     JSONProxy.__init__(self, services, DataService.methods)