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

Side by Side Diff: third_party/protobuf26/symbol_database.py

Issue 1162993005: Renamed google.protobuf to protobuf26 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Addressed comments Created 5 years, 6 months 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/protobuf26/service_reflection.py ('k') | third_party/protobuf26/text_encoding.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 # Protocol Buffers - Google's data interchange format 1 # Protocol Buffers - Google's data interchange format
2 # Copyright 2008 Google Inc. All rights reserved. 2 # Copyright 2008 Google Inc. All rights reserved.
3 # http://code.google.com/p/protobuf/ 3 # http://code.google.com/p/protobuf/
4 # 4 #
5 # Redistribution and use in source and binary forms, with or without 5 # Redistribution and use in source and binary forms, with or without
6 # modification, are permitted provided that the following conditions are 6 # modification, are permitted provided that the following conditions are
7 # met: 7 # met:
8 # 8 #
9 # * Redistributions of source code must retain the above copyright 9 # * Redistributions of source code must retain the above copyright
10 # notice, this list of conditions and the following disclaimer. 10 # notice, this list of conditions and the following disclaimer.
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 # The database's underlying descriptor pool can be queried, so it's not 53 # The database's underlying descriptor pool can be queried, so it's not
54 # necessary to know a type's filename to be able to generate it: 54 # necessary to know a type's filename to be able to generate it:
55 filename = db.pool.FindFileContainingSymbol('MyMessage') 55 filename = db.pool.FindFileContainingSymbol('MyMessage')
56 my_message_instance = db.GetMessages([filename])['MyMessage']() 56 my_message_instance = db.GetMessages([filename])['MyMessage']()
57 57
58 # This functionality is also provided directly via a convenience method: 58 # This functionality is also provided directly via a convenience method:
59 my_message_instance = db.GetSymbol('MyMessage')() 59 my_message_instance = db.GetSymbol('MyMessage')()
60 """ 60 """
61 61
62 62
63 from google.protobuf import descriptor_pool 63 from protobuf26 import descriptor_pool
64 64
65 65
66 class SymbolDatabase(object): 66 class SymbolDatabase(object):
67 """A database of Python generated symbols. 67 """A database of Python generated symbols.
68 68
69 SymbolDatabase also models message_factory.MessageFactory. 69 SymbolDatabase also models message_factory.MessageFactory.
70 70
71 The symbol database can be used to keep a global registry of all protocol 71 The symbol database can be used to keep a global registry of all protocol
72 buffer types used within a program. 72 buffer types used within a program.
73 """ 73 """
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 for f in files: 176 for f in files:
177 result.update(self._symbols_by_file[f]) 177 result.update(self._symbols_by_file[f])
178 return result 178 return result
179 179
180 _DEFAULT = SymbolDatabase() 180 _DEFAULT = SymbolDatabase()
181 181
182 182
183 def Default(): 183 def Default():
184 """Returns the default SymbolDatabase.""" 184 """Returns the default SymbolDatabase."""
185 return _DEFAULT 185 return _DEFAULT
OLDNEW
« no previous file with comments | « third_party/protobuf26/service_reflection.py ('k') | third_party/protobuf26/text_encoding.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698