Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(281)

Side by Side Diff: third_party/logilab/common/corbautils.py

Issue 739393004: Revert "Revert "pylint: upgrade to 1.3.1"" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools/
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « third_party/logilab/common/configuration.py ('k') | third_party/logilab/common/daemon.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved. 1 # copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
2 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr 2 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
3 # 3 #
4 # This file is part of logilab-common. 4 # This file is part of logilab-common.
5 # 5 #
6 # logilab-common is free software: you can redistribute it and/or modify it unde r 6 # logilab-common is free software: you can redistribute it and/or modify it unde r
7 # the terms of the GNU Lesser General Public License as published by the Free 7 # the terms of the GNU Lesser General Public License as published by the Free
8 # Software Foundation, either version 2.1 of the License, or (at your option) an y 8 # Software Foundation, either version 2.1 of the License, or (at your option) an y
9 # later version. 9 # later version.
10 # 10 #
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 is mapped to 65 is mapped to
66 'corbaname::hostname#logilab.rootmodule/chatbot.application/chatter.server' 66 'corbaname::hostname#logilab.rootmodule/chatbot.application/chatter.server'
67 67
68 The get_object_reference() function can be used to resolve such a URL. 68 The get_object_reference() function can be used to resolve such a URL.
69 """ 69 """
70 context = get_root_context() 70 context = get_root_context()
71 for id, kind in namepath[:-1]: 71 for id, kind in namepath[:-1]:
72 name = [CosNaming.NameComponent(id, kind)] 72 name = [CosNaming.NameComponent(id, kind)]
73 try: 73 try:
74 context = context.bind_new_context(name) 74 context = context.bind_new_context(name)
75 except CosNaming.NamingContext.AlreadyBound, ex: 75 except CosNaming.NamingContext.AlreadyBound as ex:
76 context = context.resolve(name)._narrow(CosNaming.NamingContext) 76 context = context.resolve(name)._narrow(CosNaming.NamingContext)
77 assert context is not None, \ 77 assert context is not None, \
78 'test context exists but is not a NamingContext' 78 'test context exists but is not a NamingContext'
79 79
80 id, kind = namepath[-1] 80 id, kind = namepath[-1]
81 name = [CosNaming.NameComponent(id, kind)] 81 name = [CosNaming.NameComponent(id, kind)]
82 try: 82 try:
83 context.bind(name, object._this()) 83 context.bind(name, object._this())
84 except CosNaming.NamingContext.AlreadyBound, ex: 84 except CosNaming.NamingContext.AlreadyBound as ex:
85 context.rebind(name, object._this()) 85 context.rebind(name, object._this())
86 86
87 def activate_POA(): 87 def activate_POA():
88 """ 88 """
89 This methods activates the Portable Object Adapter. 89 This methods activates the Portable Object Adapter.
90 You need to call it to enable the reception of messages in your code, 90 You need to call it to enable the reception of messages in your code,
91 on both the client and the server. 91 on both the client and the server.
92 """ 92 """
93 orb = get_orb() 93 orb = get_orb()
94 poa = orb.resolve_initial_references('RootPOA') 94 poa = orb.resolve_initial_references('RootPOA')
(...skipping 13 matching lines...) Expand all
108 See register_object_name() for examples URLs 108 See register_object_name() for examples URLs
109 """ 109 """
110 return get_orb().string_to_object(url) 110 return get_orb().string_to_object(url)
111 111
112 def get_object_string(host, namepath): 112 def get_object_string(host, namepath):
113 """given an host name and a name path as described in register_object_name, 113 """given an host name and a name path as described in register_object_name,
114 return a corba string identifier 114 return a corba string identifier
115 """ 115 """
116 strname = '/'.join(['.'.join(path_elt) for path_elt in namepath]) 116 strname = '/'.join(['.'.join(path_elt) for path_elt in namepath])
117 return 'corbaname::%s#%s' % (host, strname) 117 return 'corbaname::%s#%s' % (host, strname)
OLDNEW
« no previous file with comments | « third_party/logilab/common/configuration.py ('k') | third_party/logilab/common/daemon.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698