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

Side by Side Diff: third_party/protobuf26/text_format.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/text_encoding.py ('k') | no next file » | 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 21 matching lines...) Expand all
32 # 32 #
33 # Copyright 2007 Google Inc. All Rights Reserved. 33 # Copyright 2007 Google Inc. All Rights Reserved.
34 34
35 """Contains routines for printing protocol messages in text format.""" 35 """Contains routines for printing protocol messages in text format."""
36 36
37 __author__ = 'kenton@google.com (Kenton Varda)' 37 __author__ = 'kenton@google.com (Kenton Varda)'
38 38
39 import cStringIO 39 import cStringIO
40 import re 40 import re
41 41
42 from google.protobuf.internal import type_checkers 42 from protobuf26.internal import type_checkers
43 from google.protobuf import descriptor 43 from protobuf26 import descriptor
44 from google.protobuf import text_encoding 44 from protobuf26 import text_encoding
45 45
46 __all__ = ['MessageToString', 'PrintMessage', 'PrintField', 46 __all__ = ['MessageToString', 'PrintMessage', 'PrintField',
47 'PrintFieldValue', 'Merge'] 47 'PrintFieldValue', 'Merge']
48 48
49 49
50 _INTEGER_CHECKERS = (type_checkers.Uint32ValueChecker(), 50 _INTEGER_CHECKERS = (type_checkers.Uint32ValueChecker(),
51 type_checkers.Int32ValueChecker(), 51 type_checkers.Int32ValueChecker(),
52 type_checkers.Uint64ValueChecker(), 52 type_checkers.Uint64ValueChecker(),
53 type_checkers.Int64ValueChecker()) 53 type_checkers.Int64ValueChecker())
54 _FLOAT_INFINITY = re.compile('-?inf(?:inity)?f?', re.IGNORECASE) 54 _FLOAT_INFINITY = re.compile('-?inf(?:inity)?f?', re.IGNORECASE)
(...skipping 809 matching lines...) Expand 10 before | Expand all | Expand 10 after
864 'Enum type "%s" has no value named %s.' % ( 864 'Enum type "%s" has no value named %s.' % (
865 enum_descriptor.full_name, value)) 865 enum_descriptor.full_name, value))
866 else: 866 else:
867 # Numeric value. 867 # Numeric value.
868 enum_value = enum_descriptor.values_by_number.get(number, None) 868 enum_value = enum_descriptor.values_by_number.get(number, None)
869 if enum_value is None: 869 if enum_value is None:
870 raise ValueError( 870 raise ValueError(
871 'Enum type "%s" has no value with number %d.' % ( 871 'Enum type "%s" has no value with number %d.' % (
872 enum_descriptor.full_name, number)) 872 enum_descriptor.full_name, number))
873 return enum_value.number 873 return enum_value.number
OLDNEW
« no previous file with comments | « third_party/protobuf26/text_encoding.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698