• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python client.RemotingService类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中pyamf.remoting.client.RemotingService的典型用法代码示例。如果您正苦于以下问题:Python RemotingService类的具体用法?Python RemotingService怎么用?Python RemotingService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了RemotingService类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: _connect

    def _connect(self):

        success = False
        try:
            self._check_host_url()
            client = RemotingService(self._host_url)
            self.dlg = ProgressDialog("Connecting to Cluster...", None, 0, 0, self)
            func = lambda: client.getService('clustercontrol')
            self.dlg.exec_(func)
            self._service = self.dlg.getTargetResult()
            self._check_api_version()
        except ConnectionError as e:
            msg = ("%s\nDo you want to turn off the cluster support?") %str(e)
            ret = QMessageBox.question(
                self, "Error", msg)
            if ret == QMessageBox.Yes:
                self._turn_off_cluster_support()
        except Exception as e:
            QMessageBox.critical(self, "Error", str(e))
        else:
            try:
                self.dlg.exec_(self._service.get_cecog_versions)
                cluster_versions = self.dlg.getTargetResult()
            except Exception as e:
                QMessageBox.critical(self, "Error", str(e))
            else:
                if not version in set(cluster_versions):
                    QMessageBox.warning(
                        self, "Warning",
                        ("Cluster does not support %s %s"
                         "Available versions: %s"
                         %(appname, version, ', '.join(cluster_versions))))
                else:
                    success = True
        return success
开发者ID:CellCognition,项目名称:cecog,代码行数:35,代码来源:cluster.py


示例2: _connect

    def _connect(self):
        self._check_host_url()

        success = False
        msg = 'Error on connecting to cluster control service on %s' % self._host_url
        try:
            client = RemotingService(self._host_url)
            self.dlg = ProgressDialog("connecting to cluster...", None, 0, 0, self)
            func = lambda: client.getService('clustercontrol')
            self.dlg.exec_(func)
            self._service = self.dlg.getTargetResult()
        except:
            exception(self, msg)
        else:
            try:
                self.dlg.exec_(self._service.get_cecog_versions)
                cluster_versions = self.dlg.getTargetResult()
            except Exception as e:
                exception(self, msg + '(%s)' %str(e))
            else:
                if not VERSION in set(cluster_versions):
                    warning(self, 'Cecog version %s not supported by the cluster' %
                            VERSION, 'Valid versions are: %s' \
                                % ', '.join(cluster_versions))
                else:
                    success = True
        return success
开发者ID:manerotoni,项目名称:cecog,代码行数:27,代码来源:cluster.py


示例3: get_amf

def get_amf(url, service, *args):
    # AMF remoting
    #gateway = RemotingService(url, pyamf.AMF0, user_agent='Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.43 Safari/537.31')

    r = None
    for i in range(10):
        DBG('attempt', i)
        squid = tm.choose_proxy(url)
        DBG('proxy', squid['name'])

        gateway = RemotingService(url, pyamf.AMF0, user_agent='Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.43 Safari/537.31', opener=urlopen_with_timeout)
        #gateway.setProxy('10.8.0.10:8888')
        gateway.setProxy('%s:%s' % (squid['ip'], int(squid['port'])))

        service_handle = gateway.getService(service)
        try:
            r = service_handle(*args)
            if r == '':
                print 'amf empty result', url, service, args
                ERR('amf empty result', url, service, args)
                continue

            break
        except:
            print 'amf failure', url, service, args, traceback.format_exc()
            ERR('amf failure', url, service, args, traceback.format_exc()) 

    if r == None:
        ERR(' *************** retry count exceeded', url, service, args)

    return r
开发者ID:beefjerky,项目名称:LightStormCrawler,代码行数:31,代码来源:page.py


示例4: main

def main():
    """
    Entry point for this client script.
    """
    url = 'http://%s:%d' % (host_info[0], host_info[1])
    client = RemotingService(url, logger=logging)
    print "Client running - pointing to server at %s" % url

    # at this point, calling the service gets us a dict of values
    user_service = client.getService('user')
    lenards = user_service.get_user('lenards')

    # in case you don't believe me - this shows I'm not lying
    logging.debug("isinstance(lenards, dict): %s" % isinstance(lenards, dict))

    # the User class attributes are not present at this point
    logging.debug("not hasattr(lenards, 'username'): %s" %
                  (not hasattr(lenards, 'username')))
    logging.debug("not hasattr(lenards, 'email'): %s" %
                  (not hasattr(lenards, 'email')))
    logging.debug("not hasattr(lenards, 'password'): %s" %
                  (not hasattr(lenards, 'password')))

    # but the values are there
    logging.debug("lenards['username'] == 'lenards': %s" %
                  (lenards['username'] == 'lenards'))
    logging.debug("lenards['email'] == '[email protected]': %s" %
                  (lenards['email'] == '[email protected]'))

    logging.debug("Output 'lenards': %s" % lenards)

    # if we register the class and the namespace, we get an object ref
    # (complete with attributes and such)
    logging.debug("Register UserDataTransferObject class...")
    pyamf.register_class(UserDataTransferObject, '%s.User' % AMF_NAMESPACE)

    logging.debug("Get a user from the server...")
    usr = user_service.get_user('lisa')

    # ensure it's the class we expect
    logging.debug("Ensure the class we got is our DTO, " +
                  "isinstance(usr, UserDataTransferObject): %s" %
                  isinstance(usr, UserDataTransferObject))

    # verify it has expected attributes
    logging.debug("Verify attributes present...")
    logging.debug("usr.username: %s" % usr.username)
    logging.debug("usr.email == '[email protected]': %s" %
                  (usr.email == '[email protected]'))
    logging.debug("usr.password == 'h1k3r': %s" %
                  (usr.password == 'h1k3r'))

    logging.debug("Output user returned: %s" % usr)

    # request an unknown user
    logging.debug("Try to get a user that does not exist...")
    george = user_service.get_user('george')

    logging.debug("Output returned: %s" % george)
开发者ID:cardmagic,项目名称:PyAMF,代码行数:59,代码来源:client.py


示例5: get_url

def get_url(video_id):
	utils.log("Fetching video URL for content ID %s..." % video_id)
	client = RemotingService('http://nrl.bigpondvideo.com/App/AmfPhp/gateway.php')
	service = client.getService('SEOPlayer')
	base_url = service.getMediaURL({'cid': video_id})
	base_url = get_javascript_url(base_url)
	utils.log("Base URL found: %s" % base_url)
	return base_url
开发者ID:jeffxor,项目名称:xbmc-addon-nrl-video,代码行数:8,代码来源:play.py


示例6: get_episode_url

 def get_episode_url(self,url,Id):
     client = RemotingService(url)
     vi = client.getService('Nrj_VideoInfos')
     mi = vi.mediaInfo(Id)
     if self.debug_mode:
         print "url_episode : "+mi["url"]
     url_episode = mi["url"]
     return url_episode 
开发者ID:JUL1EN094,项目名称:JUL1EN094-xbmc-addons,代码行数:8,代码来源:default.py


示例7: get_url

def get_url(url, mediaId):
    "appel à pyamf pour l'adresse de la vidéo"
    client = RemotingService(url)
    vi = client.getService('Nrj_VideoInfos')
    mi = vi.mediaInfo(mediaId)
    url_episode = mi["url"]
    titre = mi["title"].replace(' ','_') 
    return url_episode, titre 
开发者ID:pacomod,项目名称:replaydl,代码行数:8,代码来源:cherie25_nrj12.py


示例8: getAmfInfo

def getAmfInfo(url, userAgent, serviceName, methodName):
    import pyamf
    from pyamf.remoting.client import RemotingService
    from pyamf import remoting, amf3, util
    client = RemotingService(url, user_agent = userAgent)
    service = client.getService(serviceName)
    methodCall = getattr(service, methodName)
    return service.methodCall()
开发者ID:Jessicaaaaaa,项目名称:todits-xbmc,代码行数:8,代码来源:ibc.py


示例9: test_gateway

def test_gateway():
    logging.basicConfig(
        level=logging.DEBUG,
        format='%(asctime)s %(levelname)-5.5s [%(name)s] %(message)s'
    )
    
    gw = RemotingService('http://127.0.0.1:8000/interactivity/', logger=logging)
    service = gw.getService('interactivity')
    print service.loadClientConfig()
开发者ID:Dan-org,项目名称:interactivity,代码行数:9,代码来源:client.py


示例10: hello

def hello(request):
	logging.basicConfig(
    	level=logging.DEBUG,
		format='%(asctime)s %(levelname)-5.5s [%(name)s] %(message)s'
	)
	gw = RemotingService('http://127.0.0.1:8000/interactivity/', logger=logging)
	service = gw.getService('interactivity')
	output = service.hello()
    #print output
	return render(request, 'interactivity/hello.html', locals())
开发者ID:Dan-org,项目名称:interactivity,代码行数:10,代码来源:views.py


示例11: main

def main(host):
    gw = RemotingService('http://%s/gateway' % host)
    service = gw.getService('grocery')
    for store in loaddata.stores:
        service.create('RetailStore', dict(name=store))
    for key in loaddata.sections.keys():
        id = service.create('StoreSection', dict(name=key))
        for item in loaddata.sections[key]:
            service.create('ItemDescription', dict(store_section=id,
                                              description=item[0],
                                              is_default=item[1]))
开发者ID:kruser,项目名称:zualoo,代码行数:11,代码来源:load.py


示例12: process_channel

def process_channel(channel_id, tags):
	client = RemotingService('http://afl.bigpondvideo.com/App/AmfPhp/gateway.php')	
	service = client.getService('Miscellaneous')
	params = {'navId':channel_id, 'startRecord':'0', 'howMany':'15', 'platformId':'1', 'phpFunction':'getClipList', 'asFunction':'publishClipList'}
	videos_list = get_service_data(service, 'getClipList', params)
	if videos_list:
		for video_item in videos_list[0]['items']:
			try:
				parse_video(video_item['content'], tags)
			except:
				logging.error("Error parsing video: %s\n%s" % (video_item['content']['contentId'], sys.exc_info()[:2]))
开发者ID:andybotting,项目名称:afl-video,代码行数:11,代码来源:utils.py


示例13: __init__

class mobileservices:
    #Initialize this class
    def __init__(self,acc,settingsmanager):
        self.usemobileservices = settingsmanager.getvalue("Settings","usemobileservices")

        if   self.usemobileservices == 'on':
            self.acc = acc
            self.pyamfhandler = RemotingService('http://www.neopets.com/amfphp/gateway.php')
            self.pyamfhandler.opener =self.acc.opener.open
            self.token = self.domobilelogin()
            print "Mobile login token = " + str(self.token)

    def getnp(self):
        #Get Np on hand
        MobileService = self.pyamfhandler.getService('MobileService')
        html = MobileService.getUser(self.acc.user,self.token)
        thenp = html['neopoints']

        return thenp

    def domobilelogin(self):
        #print self.acc.user
        #print self.acc.pw
        print "Performing mobile auth"
        MobileService = self.pyamfhandler.getService('MobileService')
        html = MobileService.auth(self.acc.user,self.acc.pw)
        #print html
        self.activepetname =html['user']['active_pet']

        return html['token']



    def setactivepet(self,petname):


        PetService = self.pyamfhandler.getService('PetService')

        #activepetname
        html = PetService.setActivePet(petname,self.acc.user,self.token)

        return html



    def getpetlist(self):


        MobileService = self.pyamfhandler.getService('MobileService')

        html = MobileService.getPets(self.acc.user,self.token)

        return html
开发者ID:Methrend,项目名称:NeoAuto,代码行数:53,代码来源:mobileservices.py


示例14: getsmil

def getsmil(vid):
        gw = RemotingService(url='http://video.nbcuni.com/amfphp/gateway.php',
                     referer='http://www.nbc.com/assets/video/3-0/swf/NBCVideoApp.swf',
                     user_agent='Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.7) Gecko/2009021910 Firefox/3.0.7)',
                     )
        ClipAll_service = gw.getService('getClipInfo.getClipAll')
        geo  ="US"
        num1 = "632"
        num2 = "-1"
        response = ClipAll_service(vid,geo,num1,num2)
        url = 'http://video.nbcuni.com/' + response['clipurl']
        return url
开发者ID:AbsMate,项目名称:bluecop-xbmc-repo,代码行数:12,代码来源:nbc.py


示例15: exportToICal

 def exportToICal(self, event_id):
   from pyamf.remoting.client import RemotingService  # @UnresolvedImport
   from icalendar import Calendar, Event, vDatetime  # @UnresolvedImport
   import uuid, os
   
   client = RemotingService(self.application.app_settings["url"]+"/"+self.application.app_config["connection"]["npi_service"])
   service = client.getService("default")
   
   events = service.loadTable_amf(self.getCredentials(), "models.event", "id="+str(event_id), None)
   if events.__class__.__name__!="ArrayCollection": 
     wx.MessageBox(str(events), "saveDataSet", wx.OK | wx.ICON_ERROR)
     return
   elif len(events)>0:
     event = events[0]
           
     cal = Calendar()
     cal.add('prodid', '-//nervatura.com/NONSGML Nervatura Calendar//EN')
     cal.add('version', '2.0')
     clevent = Event()
     if event["uid"]!=None:
       clevent['uid'] = event["uid"]
     else:
       clevent['uid'] = uuid.uuid4()
     if event["fromdate"]!=None:
       clevent['dtstart'] = vDatetime(event["fromdate"]).ical()
     if event["todate"]!=None:
       clevent['dtend'] = vDatetime(event["todate"]).ical()  
     if event["subject"]!=None:
       clevent['summary'] = event["subject"]
     if event["place"]!=None:
       clevent['location'] = event["place"]
     if event["eventgroup"]!=None:
       groups = service.loadTable_amf(self.getCredentials(), "models.groups", "id="+str(event["eventgroup"]), None)
       if groups.__class__.__name__=="ArrayCollection":
         if len(groups)>0:
           clevent['category'] = groups[0].groupvalue
     if event["description"]!=None:
       clevent['description'] = event["description"]  
     cal.add_component(clevent)
     
     wildcard = "iCal files (*.ical)|"     \
          "All files (*.*)|*.*"
     dlg = wx.FileDialog(
           self, message="Event export", 
           defaultDir=(os.getenv('USERPROFILE') or os.getenv('HOME')), 
           defaultFile=str(event["calnumber"]).replace("/", "_"), wildcard=wildcard, style=wx.SAVE)
     dlg.SetFilterIndex(0)
     if dlg.ShowModal() == wx.ID_OK:
       icalfile = open(dlg.GetPath()+".ical", 'w')
       icalfile.write(cal.as_string())
       icalfile.close()
     dlg.Destroy()
开发者ID:nervatura,项目名称:nerva2py,代码行数:52,代码来源:fMain.py


示例16: test_gateway_available

 def test_gateway_available(self):
     '''
     Tests to make sure we can connect to the gateway
     '''
     logging.basicConfig(
         level=logging.DEBUG,
         format='%(asctime)s %(levelname)-5.5s [%(name)s] %(message)s'
     )
     gw = RemotingService('http://127.0.0.1:8000/interactivity/', logger=logging)
     service = gw.getService('interactivity')
     output = service.hello()
     #print output
     self.assertEqual(1,1)
开发者ID:Dan-org,项目名称:interactivity,代码行数:13,代码来源:tests.py


示例17: task_request

def task_request(obj, domain, method):
    if method == 'register':
        try:
            gw = RemotingService(domain+'sync/', amf_version=AMF3)
            service = gw.getService('SyncService')
            http_data = service.register(obj)

            return http_data
        except Exception, e:
            # set the admin phone nos as global variable in the settings and make message_as_sms() loop over the nos.
            data = {'subject': 'Offline Registration Error', 'message': e, 'phone': '08137474080'}
            message_as_email(data)
            return
开发者ID:Chitrank-Dixit,项目名称:kibati-arooko,代码行数:13,代码来源:tasks.py


示例18: getrtmp

def getrtmp():
        #rtmpurl = 'rtmp://cp37307.edgefcs.net:443/ondemand'
        gw = RemotingService(url='http://video.nbcuni.com/amfphp/gateway.php',
                     referer='http://video.nbcuni.com/embed/player_3-x/External.swf',
                     user_agent='Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.7) Gecko/2009021910 Firefox/3.0.7)',
                     )
        ClipAll_service = gw.getService('getConfigInfo.getConfigAll')
        #Not sure where this number is coming from need to look further at action script.
        num1 = "19100"
        response = ClipAll_service(num1)
        rtmphost= response['akamaiHostName'] 
        app = response['akamaiAppName']
        rtmpurl = 'rtmp://'+rtmphost+':443/'+app
        return rtmpurl
开发者ID:AbsMate,项目名称:bluecop-xbmc-repo,代码行数:14,代码来源:scifi_tv.py


示例19: getBattlesData

def getBattlesData():
    data = []
    client = RemotingService('http://dracula.irq.ru/Gateway.aspx')
    service = client.getService('MafiaAMF.AMFService')
    resp = service.dispatch(params1,"AMFService.ClanFightListGet",[{}],False)
    if resp.has_key("data"):
        data = resp["data"]
    if data.has_key("Answer"):
        data = data["Answer"]
    if data.has_key("OtherData"):
        data = data["OtherData"]
    if data.has_key("ClanWarsList"):
        data = data["ClanWarsList"]
    return data
开发者ID:denis-pinaev,项目名称:games,代码行数:14,代码来源:battleClan2.py


示例20: getClanList

def getClanList():
    data = {}
    client = RemotingService('http://odnvamp.irq.ru/Gateway.aspx')
    service = client.getService('MafiaAMF.AMFService')
    resp = service.dispatch(params1,"AMFService.ClanListGet",[{"IsFight":False}],False)
    if resp.has_key("data"):
        data = resp["data"]
    if data.has_key("Answer"):
        data = data["Answer"]
    if data.has_key("OtherData"):
        data = data["OtherData"]
    if data.has_key("ClanList"):
       data = data["ClanList"]
    return data
开发者ID:denis-pinaev,项目名称:games,代码行数:14,代码来源:_OK_clan_info.py



注:本文中的pyamf.remoting.client.RemotingService类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python gateway.expose_request函数代码示例发布时间:2022-05-25
下一篇:
Python remoting.encode函数代码示例发布时间:2022-05-25
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap