The branch, frodo has been updated
via 2d7bc228c2b5a94bb2f4040158c2da3b0cdd5c1f (commit)
from 531c8602c814f9ab27d1871afa20570459d0a7ab (commit)
- Log -----------------------------------------------------------------
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/scripts;a=commit;h=2d7bc228c2b5a94bb2f4040158c2da3b0cdd5c1f
commit 2d7bc228c2b5a94bb2f4040158c2da3b0cdd5c1f
Author: Martijn Kaijser <[email protected]>
Date: Wed Oct 16 10:13:15 2013 +0200
[script.module.protobuf] 2.5.0
diff --git a/script.module.protobuf/addon.xml b/script.module.protobuf/addon.xml
index 957f590..cf2e220 100644
--- a/script.module.protobuf/addon.xml
+++ b/script.module.protobuf/addon.xml
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="script.module.protobuf"
name="protobuf"
- version="2.4.2"
+ version="2.5.0"
provider-name="Valentin-Costel HÄloiu">
<requires>
- <import addon="xbmc.python" version="2.0"/>
+ <import addon="xbmc.python" version="2.1.0"/>
</requires>
<extension point="xbmc.python.module"
library="lib" />
@@ -13,5 +13,6 @@
<description>Packed for XBMC from
http://code.google.com/p/protobuf</description>
<license>New BSD License</license>
<platform>all</platform>
+ <source>http://code.google.com/p/protobuf</source>
</extension>
</addon>
diff --git a/script.module.protobuf/lib/google/protobuf/descriptor.py
b/script.module.protobuf/lib/google/protobuf/descriptor.py
index cf609be..eb13eda 100644
--- a/script.module.protobuf/lib/google/protobuf/descriptor.py
+++ b/script.module.protobuf/lib/google/protobuf/descriptor.py
@@ -39,13 +39,20 @@ from google.protobuf.internal import api_implementation
if api_implementation.Type() == 'cpp':
- from google.protobuf.internal import cpp_message
+ if api_implementation.Version() == 2:
+ from google.protobuf.internal.cpp import _message
+ else:
+ from google.protobuf.internal import cpp_message
class Error(Exception):
"""Base error for this module."""
+class TypeTransformationError(Error):
+ """Error transforming between python proto type and corresponding C++
type."""
+
+
class DescriptorBase(object):
"""Descriptors base class.
@@ -72,6 +79,18 @@ class DescriptorBase(object):
# Does this descriptor have non-default options?
self.has_options = options is not None
+ def _SetOptions(self, options, options_class_name):
+ """Sets the descriptor's options
+
+ This function is used in generated proto2 files to update descriptor
+ options. It must not be used outside proto2.
+ """
+ self._options = options
+ self._options_class_name = options_class_name
+
+ # Does this descriptor have non-default options?
+ self.has_options = options is not None
+
def GetOptions(self):
"""Retrieves descriptor options.
@@ -250,6 +269,24 @@ class Descriptor(_NestedDescriptorBase):
self._serialized_start = serialized_start
self._serialized_end = serialized_end
+ def EnumValueName(self, enum, value):
+ """Returns the string name of an enum value.
+
+ This is just a small helper method to simplify a common operation.
+
+ Args:
+ enum: string name of the Enum.
+ value: int, value of the enum.
+
+ Returns:
+ string name of the enum value.
+
+ Raises:
+ KeyError if either the Enum doesn't exist or the value is not a valid
+ value for the enum.
+ """
+ return self.enum_types_by_name[enum].values_by_number[value].name
+
def CopyToProto(self, proto):
"""Copies this to a descriptor_pb2.DescriptorProto.
@@ -275,7 +312,7 @@ class FieldDescriptor(DescriptorBase):
"""Descriptor for a single field in a .proto file.
- A FieldDescriptor instance has the following attriubtes:
+ A FieldDescriptor instance has the following attributes:
name: (str) Name of this field, exactly as it appears in .proto.
full_name: (str) Name of this field, including containing scope. This is
@@ -358,6 +395,27 @@ class FieldDescriptor(DescriptorBase):
CPPTYPE_MESSAGE = 10
MAX_CPPTYPE = 10
+ _PYTHON_TO_CPP_PROTO_TYPE_MAP = {
+ TYPE_DOUBLE: CPPTYPE_DOUBLE,
+ TYPE_FLOAT: CPPTYPE_FLOAT,
+ TYPE_ENUM: CPPTYPE_ENUM,
+ TYPE_INT64: CPPTYPE_INT64,
+ TYPE_SINT64: CPPTYPE_INT64,
+ TYPE_SFIXED64: CPPTYPE_INT64,
+ TYPE_UINT64: CPPTYPE_UINT64,
+ TYPE_FIXED64: CPPTYPE_UINT64,
+ TYPE_INT32: CPPTYPE_INT32,
+ TYPE_SFIXED32: CPPTYPE_INT32,
+ TYPE_SINT32: CPPTYPE_INT32,
+ TYPE_UINT32: CPPTYPE_UINT32,
+ TYPE_FIXED32: CPPTYPE_UINT32,
+ TYPE_BYTES: CPPTYPE_STRING,
+ TYPE_STRING: CPPTYPE_STRING,
+ TYPE_BOOL: CPPTYPE_BOOL,
+ TYPE_MESSAGE: CPPTYPE_MESSAGE,
+ TYPE_GROUP: CPPTYPE_MESSAGE
+ }
+
# Must be consistent with C++ FieldDescriptor::Label enum in
# descriptor.h.
#
@@ -395,12 +453,38 @@ class FieldDescriptor(DescriptorBase):
self.extension_scope = extension_scope
if api_implementation.Type() == 'cpp':
if is_extension:
- self._cdescriptor = cpp_message.GetExtensionDescriptor(full_name)
+ if api_implementation.Version() == 2:
+ self._cdescriptor = _message.GetExtensionDescriptor(full_name)
+ else:
+ self._cdescriptor = cpp_message.GetExtensionDescriptor(full_name)
else:
- self._cdescriptor = cpp_message.GetFieldDescriptor(full_name)
+ if api_implementation.Version() == 2:
+ self._cdescriptor = _message.GetFieldDescriptor(full_name)
+ else:
+ self._cdescriptor = cpp_message.GetFieldDescriptor(full_name)
else:
self._cdescriptor = None
+ @staticmethod
+ def ProtoTypeToCppProtoType(proto_type):
+ """Converts from a Python proto type to a C++ Proto Type.
+
+ The Python ProtocolBuffer classes specify both the 'Python' datatype and
the
+ 'C++' datatype - and they're not the same. This helper method should
+ translate from one to another.
+
+ Args:
+ proto_type: the Python proto type (descriptor.FieldDescriptor.TYPE_*)
+ Returns:
+ descriptor.FieldDescriptor.CPPTYPE_*, the C++ type.
+ Raises:
+ TypeTransformationError: when the Python proto type isn't known.
+ """
+ try:
+ return FieldDescriptor._PYTHON_TO_CPP_PROTO_TYPE_MAP[proto_type]
+ except KeyError:
+ raise TypeTransformationError('Unknown proto_type: %s' % proto_type)
+
class EnumDescriptor(_NestedDescriptorBase):
@@ -577,7 +661,10 @@ class FileDescriptor(DescriptorBase):
self.serialized_pb = serialized_pb
if (api_implementation.Type() == 'cpp' and
self.serialized_pb is not None):
- cpp_message.BuildFile(self.serialized_pb)
+ if api_implementation.Version() == 2:
+ _message.BuildFile(self.serialized_pb)
+ else:
+ cpp_message.BuildFile(self.serialized_pb)
def CopyToProto(self, proto):
"""Copies this to a descriptor_pb2.FileDescriptorProto.
@@ -596,3 +683,31 @@ def _ParseOptions(message, string):
"""
message.ParseFromString(string)
return message
+
+
+def MakeDescriptor(desc_proto, package=''):
+ """Make a protobuf Descriptor given a DescriptorProto protobuf.
+
+ Args:
+ desc_proto: The descriptor_pb2.DescriptorProto protobuf message.
+ package: Optional package name for the new message Descriptor (string).
+
+ Returns:
+ A Descriptor for protobuf messages.
+ """
+ full_message_name = [desc_proto.name]
+ if package: full_message_name.insert(0, package)
+ fields = []
+ for field_proto in desc_proto.field:
+ full_name = '.'.join(full_message_name + [field_proto.name])
+ field = FieldDescriptor(
+ field_proto.name, full_name, field_proto.number - 1,
+ field_proto.number, field_proto.type,
+ FieldDescriptor.ProtoTypeToCppProtoType(field_proto.type),
+ field_proto.label, None, None, None, None, False, None,
+ has_default_value=False)
+ fields.append(field)
+
+ desc_name = '.'.join(full_message_name)
+ return Descriptor(desc_proto.name, desc_name, None, None, fields,
+ [], [], [])
diff --git
a/script.module.protobuf/lib/google/protobuf/internal/api_implementation.py
b/script.module.protobuf/lib/google/protobuf/internal/api_implementation.py
index b3e412e..ce02a32 100644
--- a/script.module.protobuf/lib/google/protobuf/internal/api_implementation.py
+++ b/script.module.protobuf/lib/google/protobuf/internal/api_implementation.py
@@ -56,9 +56,32 @@ if _implementation_type != 'python':
# _implementation_type = 'python'
+# This environment variable can be used to switch between the two
+# 'cpp' implementations. Right now only 1 and 2 are valid values. Any
+# other value will be ignored.
+_implementation_version_str = os.getenv(
+ 'PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION_VERSION',
+ '1')
+
+
+if _implementation_version_str not in ('1', '2'):
+ raise ValueError(
+ "unsupported PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION_VERSION: '" +
+ _implementation_version_str + "' (supported versions: 1, 2)"
+ )
+
+
+_implementation_version = int(_implementation_version_str)
+
+
+
# Usage of this function is discouraged. Clients shouldn't care which
# implementation of the API is in use. Note that there is no guarantee
# that differences between APIs will be maintained.
# Please don't use this function if possible.
def Type():
return _implementation_type
+
+# See comment on 'Type' above.
+def Version():
+ return _implementation_version
diff --git a/script.module.protobuf/lib/google/protobuf/internal/containers.py
b/script.module.protobuf/lib/google/protobuf/internal/containers.py
index 097a3c2..34b35f8 100644
--- a/script.module.protobuf/lib/google/protobuf/internal/containers.py
+++ b/script.module.protobuf/lib/google/protobuf/internal/containers.py
@@ -78,8 +78,13 @@ class BaseContainer(object):
def __repr__(self):
return repr(self._values)
- def sort(self, sort_function=cmp):
- self._values.sort(sort_function)
+ def sort(self, *args, **kwargs):
+ # Continue to support the old sort_function keyword argument.
+ # This is expected to be a rare occurrence, so use LBYL to avoid
+ # the overhead of actually catching KeyError.
+ if 'sort_function' in kwargs:
+ kwargs['cmp'] = kwargs.pop('sort_function')
+ self._values.sort(*args, **kwargs)
class RepeatedScalarFieldContainer(BaseContainer):
@@ -235,6 +240,11 @@ class RepeatedCompositeFieldContainer(BaseContainer):
"""
self.extend(other._values)
+ def remove(self, elem):
+ """Removes an item from the list. Similar to list.remove()."""
+ self._values.remove(elem)
+ self._message_listener.Modified()
+
def __getslice__(self, start, stop):
"""Retrieves the subset of items from between the specified indices."""
return self._values[start:stop]
diff --git a/script.module.protobuf/lib/google/protobuf/internal/cpp_message.py
b/script.module.protobuf/lib/google/protobuf/internal/cpp_message.py
index 3f42650..23ab9ba 100644
--- a/script.module.protobuf/lib/google/protobuf/internal/cpp_message.py
+++ b/script.module.protobuf/lib/google/protobuf/internal/cpp_message.py
@@ -34,8 +34,10 @@ Descriptor objects at runtime backed by the protocol buffer
C++ API.
__author__ = '[email protected] (Petar Petrov)'
+import copy_reg
import operator
from google.protobuf.internal import _net_proto2___python
+from google.protobuf.internal import enum_type_wrapper
from google.protobuf import message
@@ -156,10 +158,12 @@ class RepeatedScalarContainer(object):
def __hash__(self):
raise TypeError('unhashable object')
- def sort(self, sort_function=cmp):
- values = self[slice(None, None, None)]
- values.sort(sort_function)
- self._cmsg.AssignRepeatedScalar(self._cfield_descriptor, values)
+ def sort(self, *args, **kwargs):
+ # Maintain compatibility with the previous interface.
+ if 'sort_function' in kwargs:
+ kwargs['cmp'] = kwargs.pop('sort_function')
+ self._cmsg.AssignRepeatedScalar(self._cfield_descriptor,
+ sorted(self, *args, **kwargs))
def RepeatedScalarProperty(cdescriptor):
@@ -202,6 +206,12 @@ class RepeatedCompositeContainer(object):
for message in elem_seq:
self.add().MergeFrom(message)
+ def remove(self, value):
+ # TODO(protocol-devel): This is inefficient as it needs to generate a
+ # message pointer for each message only to do index(). Move this to a C++
+ # extension function.
+ self.__delitem__(self[slice(None, None, None)].index(value))
+
def MergeFrom(self, other):
for message in other[:]:
self.add().MergeFrom(message)
@@ -236,27 +246,29 @@ class RepeatedCompositeContainer(object):
def __hash__(self):
raise TypeError('unhashable object')
- def sort(self, sort_function=cmp):
- messages = []
- for index in range(len(self)):
- # messages[i][0] is where the i-th element of the new array has to come
- # from.
- # messages[i][1] is where the i-th element of the old array has to go.
- messages.append([index, 0, self[index]])
- messages.sort(lambda x,y: sort_function(x[2], y[2]))
+ def sort(self, cmp=None, key=None, reverse=False, **kwargs):
+ # Maintain compatibility with the old interface.
+ if cmp is None and 'sort_function' in kwargs:
+ cmp = kwargs.pop('sort_function')
- # Remember which position each elements has to move to.
- for i in range(len(messages)):
- messages[messages[i][0]][1] = i
+ # The cmp function, if provided, is passed the results of the key function,
+ # so we only need to wrap one of them.
+ if key is None:
+ index_key = self.__getitem__
+ else:
+ index_key = lambda i: key(self[i])
+
+ # Sort the list of current indexes by the underlying object.
+ indexes = range(len(self))
+ indexes.sort(cmp=cmp, key=index_key, reverse=reverse)
# Apply the transposition.
- for i in range(len(messages)):
- from_position = messages[i][0]
- if i == from_position:
+ for dest, src in enumerate(indexes):
+ if dest == src:
continue
- self._cmsg.SwapRepeatedFieldElements(
- self._cfield_descriptor, i, from_position)
- messages[messages[i][1]][0] = from_position
+ self._cmsg.SwapRepeatedFieldElements(self._cfield_descriptor, dest, src)
+ # Don't swap the same value twice.
+ indexes[src] = src
def RepeatedCompositeProperty(cdescriptor, message_type):
@@ -359,11 +371,12 @@ class ExtensionDict(object):
return None
-def NewMessage(message_descriptor, dictionary):
+def NewMessage(bases, message_descriptor, dictionary):
"""Creates a new protocol message *class*."""
_AddClassAttributesForNestedExtensions(message_descriptor, dictionary)
_AddEnumValues(message_descriptor, dictionary)
_AddDescriptors(message_descriptor, dictionary)
+ return bases
def InitMessage(message_descriptor, cls):
@@ -372,6 +385,7 @@ def InitMessage(message_descriptor, cls):
_AddInitMethod(message_descriptor, cls)
_AddMessageMethods(message_descriptor, cls)
_AddPropertiesForExtensions(message_descriptor, cls)
+ copy_reg.pickle(cls, lambda obj: (cls, (), obj.__getstate__()))
def _AddDescriptors(message_descriptor, dictionary):
@@ -387,7 +401,7 @@ def _AddDescriptors(message_descriptor, dictionary):
field.full_name)
dictionary['__slots__'] = list(dictionary['__descriptors'].iterkeys()) + [
- '_cmsg', '_owner', '_composite_fields', 'Extensions']
+ '_cmsg', '_owner', '_composite_fields', 'Extensions', '_HACK_REFCOUNTS']
def _AddEnumValues(message_descriptor, dictionary):
@@ -398,6 +412,7 @@ def _AddEnumValues(message_descriptor, dictionary):
dictionary: Class dictionary that should be populated.
"""
for enum_type in message_descriptor.enum_types:
+ dictionary[enum_type.name] = enum_type_wrapper.EnumTypeWrapper(enum_type)
for enum_value in enum_type.values:
dictionary[enum_value.name] = enum_value.number
@@ -439,28 +454,35 @@ def _AddInitMethod(message_descriptor, cls):
def Init(self, **kwargs):
"""Message constructor."""
cmessage = kwargs.pop('__cmessage', None)
- if cmessage is None:
- self._cmsg = NewCMessage(message_descriptor.full_name)
- else:
+ if cmessage:
self._cmsg = cmessage
+ else:
+ self._cmsg = NewCMessage(message_descriptor.full_name)
# Keep a reference to the owner, as the owner keeps a reference to the
# underlying protocol buffer message.
owner = kwargs.pop('__owner', None)
- if owner is not None:
+ if owner:
self._owner = owner
- self.Extensions = ExtensionDict(self)
+ if message_descriptor.is_extendable:
+ self.Extensions = ExtensionDict(self)
+ else:
+ # Reference counting in the C++ code is broken and depends on
+ # the Extensions reference to keep this object alive during unit
+ # tests (see b/4856052). Remove this once b/4945904 is fixed.
+ self._HACK_REFCOUNTS = self
self._composite_fields = {}
for field_name, field_value in kwargs.iteritems():
field_cdescriptor = self.__descriptors.get(field_name, None)
- if field_cdescriptor is None:
+ if not field_cdescriptor:
raise ValueError('Protocol message has no "%s" field.' % field_name)
if field_cdescriptor.label == _LABEL_REPEATED:
if field_cdescriptor.cpp_type == _CPPTYPE_MESSAGE:
+ field_name = getattr(self, field_name)
for val in field_value:
- getattr(self, field_name).add().MergeFrom(val)
+ field_name.add().MergeFrom(val)
else:
getattr(self, field_name).extend(field_value)
elif field_cdescriptor.cpp_type == _CPPTYPE_MESSAGE:
@@ -497,12 +519,34 @@ def _AddMessageMethods(message_descriptor, cls):
return self._cmsg.HasField(field_name)
def ClearField(self, field_name):
+ child_cmessage = None
if field_name in self._composite_fields:
+ child_field = self._composite_fields[field_name]
del self._composite_fields[field_name]
- self._cmsg.ClearField(field_name)
+
+ child_cdescriptor = self.__descriptors[field_name]
+ # TODO(anuraag): Support clearing repeated message fields as well.
+ if (child_cdescriptor.label != _LABEL_REPEATED and
+ child_cdescriptor.cpp_type == _CPPTYPE_MESSAGE):
+ child_field._owner = None
+ child_cmessage = child_field._cmsg
+
+ if child_cmessage is not None:
+ self._cmsg.ClearField(field_name, child_cmessage)
+ else:
+ self._cmsg.ClearField(field_name)
def Clear(self):
- return self._cmsg.Clear()
+ cmessages_to_release = []
+ for field_name, child_field in self._composite_fields.iteritems():
+ child_cdescriptor = self.__descriptors[field_name]
+ # TODO(anuraag): Support clearing repeated message fields as well.
+ if (child_cdescriptor.label != _LABEL_REPEATED and
+ child_cdescriptor.cpp_type == _CPPTYPE_MESSAGE):
+ child_field._owner = None
+ cmessages_to_release.append((child_cdescriptor, child_field._cmsg))
+ self._composite_fields.clear()
+ self._cmsg.Clear(cmessages_to_release)
def IsInitialized(self, errors=None):
if self._cmsg.IsInitialized():
@@ -514,8 +558,8 @@ def _AddMessageMethods(message_descriptor, cls):
def SerializeToString(self):
if not self.IsInitialized():
raise message.EncodeError(
- 'Message is missing required fields: ' +
- ','.join(self.FindInitializationErrors()))
+ 'Message %s is missing required fields: %s' % (
+ self._cmsg.full_name, ','.join(self.FindInitializationErrors())))
return self._cmsg.SerializeToString()
def SerializePartialToString(self):
@@ -534,7 +578,8 @@ def _AddMessageMethods(message_descriptor, cls):
def MergeFrom(self, msg):
if not isinstance(msg, cls):
raise TypeError(
- "Parameter to MergeFrom() must be instance of same class.")
+ "Parameter to MergeFrom() must be instance of same class: "
+ "expected %s got %s." % (cls.__name__, type(msg).__name__))
self._cmsg.MergeFrom(msg._cmsg)
def CopyFrom(self, msg):
@@ -581,6 +626,8 @@ def _AddMessageMethods(message_descriptor, cls):
raise TypeError('unhashable object')
def __unicode__(self):
+ # Lazy import to prevent circular import when text_format imports this
file.
+ from google.protobuf import text_format
return text_format.MessageToString(self, as_utf8=True).decode('utf-8')
# Attach the local methods to the message class.
diff --git a/script.module.protobuf/lib/google/protobuf/internal/decoder.py
b/script.module.protobuf/lib/google/protobuf/internal/decoder.py
index 55f746f..cb6f572 100644
--- a/script.module.protobuf/lib/google/protobuf/internal/decoder.py
+++ b/script.module.protobuf/lib/google/protobuf/internal/decoder.py
@@ -576,6 +576,7 @@ def MessageSetItemDecoder(extensions_by_number):
local_SkipField = SkipField
def DecodeItem(buffer, pos, end, message, field_dict):
+ message_set_item_start = pos
type_id = -1
message_start = -1
message_end = -1
@@ -614,6 +615,11 @@ def MessageSetItemDecoder(extensions_by_number):
# The only reason _InternalParse would return early is if it
encountered
# an end-group tag.
raise _DecodeError('Unexpected end-group tag.')
+ else:
+ if not message._unknown_fields:
+ message._unknown_fields = []
+ message._unknown_fields.append((MESSAGE_SET_ITEM_TAG,
+ buffer[message_set_item_start:pos]))
return pos
diff --git
a/script.module.protobuf/lib/google/protobuf/internal/python_message.py
b/script.module.protobuf/lib/google/protobuf/internal/python_message.py
index 66fca91..4bea57a 100644
--- a/script.module.protobuf/lib/google/protobuf/internal/python_message.py
+++ b/script.module.protobuf/lib/google/protobuf/internal/python_message.py
@@ -54,6 +54,7 @@ try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
+import copy_reg
import struct
import weakref
@@ -61,6 +62,7 @@ import weakref
from google.protobuf.internal import containers
from google.protobuf.internal import decoder
from google.protobuf.internal import encoder
+from google.protobuf.internal import enum_type_wrapper
from google.protobuf.internal import message_listener as message_listener_mod
from google.protobuf.internal import type_checkers
from google.protobuf.internal import wire_format
@@ -71,9 +73,10 @@ from google.protobuf import text_format
_FieldDescriptor = descriptor_mod.FieldDescriptor
-def NewMessage(descriptor, dictionary):
+def NewMessage(bases, descriptor, dictionary):
_AddClassAttributesForNestedExtensions(descriptor, dictionary)
_AddSlots(descriptor, dictionary)
+ return bases
def InitMessage(descriptor, cls):
@@ -96,6 +99,7 @@ def InitMessage(descriptor, cls):
_AddStaticMethods(cls)
_AddMessageMethods(descriptor, cls)
_AddPrivateHelperMethods(cls)
+ copy_reg.pickle(cls, lambda obj: (cls, (), obj.__getstate__()))
# Stateless helpers for GeneratedProtocolMessageType below.
@@ -145,6 +149,10 @@ def _VerifyExtensionHandle(message, extension_handle):
if not extension_handle.is_extension:
raise KeyError('"%s" is not an extension.' % extension_handle.full_name)
+ if not extension_handle.containing_type:
+ raise KeyError('"%s" is missing a containing_type.'
+ % extension_handle.full_name)
+
if extension_handle.containing_type is not message.DESCRIPTOR:
raise KeyError('Extension "%s" extends message type "%s", but this '
'message is of type "%s".' %
@@ -164,6 +172,7 @@ def _AddSlots(message_descriptor, dictionary):
dictionary['__slots__'] = ['_cached_byte_size',
'_cached_byte_size_dirty',
'_fields',
+ '_unknown_fields',
'_is_present_in_parent',
'_listener',
'_listener_for_children',
@@ -224,11 +233,14 @@ def _AddClassAttributesForNestedExtensions(descriptor,
dictionary):
def _AddEnumValues(descriptor, cls):
"""Sets class-level attributes for all enum fields defined in this message.
+ Also exporting a class-level object that can name enum values.
+
Args:
descriptor: Descriptor object for this message type.
cls: Class we're constructing for this message type.
"""
for enum_type in descriptor.enum_types:
+ setattr(cls, enum_type.name, enum_type_wrapper.EnumTypeWrapper(enum_type))
for enum_value in enum_type.values:
setattr(cls, enum_value.name, enum_value.number)
@@ -248,7 +260,7 @@ def _DefaultValueConstructorForField(field):
"""
if field.label == _FieldDescriptor.LABEL_REPEATED:
- if field.default_value != []:
+ if field.has_default_value and field.default_value != []:
raise ValueError('Repeated field default value not empty list: %s' % (
field.default_value))
if field.cpp_type == _FieldDescriptor.CPPTYPE_MESSAGE:
@@ -276,6 +288,8 @@ def _DefaultValueConstructorForField(field):
return MakeSubMessageDefault
def MakeScalarDefault(message):
+ # TODO(protobuf-team): This may be broken since there may not be
+ # default_value. Combine with has_default_value somehow.
return field.default_value
return MakeScalarDefault
@@ -287,6 +301,9 @@ def _AddInitMethod(message_descriptor, cls):
self._cached_byte_size = 0
self._cached_byte_size_dirty = len(kwargs) > 0
self._fields = {}
+ # _unknown_fields is () when empty for efficiency, and will be turned into
+ # a list if fields are added.
+ self._unknown_fields = ()
self._is_present_in_parent = False
self._listener = message_listener_mod.NullMessageListener()
self._listener_for_children = _Listener(self)
@@ -428,6 +445,8 @@ def _AddPropertiesForNonRepeatedScalarField(field, cls):
valid_values = set()
def getter(self):
+ # TODO(protobuf-team): This may be broken since there may not be
+ # default_value. Combine with has_default_value somehow.
return self._fields.get(field, default_value)
getter.__module__ = None
getter.__doc__ = 'Getter for %s.' % proto_field_name
@@ -462,13 +481,18 @@ def _AddPropertiesForNonRepeatedCompositeField(field,
cls):
# for non-repeated scalars.
proto_field_name = field.name
property_name = _PropertyName(proto_field_name)
+
+ # TODO(komarek): Can anyone explain to me why we cache the message_type this
+ # way, instead of referring to field.message_type inside of getter(self)?
+ # What if someone sets message_type later on (which makes for simpler
+ # dyanmic proto descriptor and class creation code).
message_type = field.message_type
def getter(self):
field_value = self._fields.get(field)
if field_value is None:
# Construct a new object to represent this field.
- field_value = message_type._concrete_class()
+ field_value = message_type._concrete_class() # use field.message_type?
field_value._SetListener(self._listener_for_children)
# Atomically check if another thread has preempted us and, if not, swap
@@ -620,6 +644,7 @@ def _AddClearMethod(message_descriptor, cls):
def Clear(self):
# Clear fields.
self._fields = {}
+ self._unknown_fields = ()
self._Modified()
cls.Clear = Clear
@@ -649,7 +674,16 @@ def _AddEqualsMethod(message_descriptor, cls):
if self is other:
return True
- return self.ListFields() == other.ListFields()
+ if not self.ListFields() == other.ListFields():
+ return False
+
+ # Sort unknown fields because their order shouldn't affect equality test.
+ unknown_fields = list(self._unknown_fields)
+ unknown_fields.sort()
+ other_unknown_fields = list(other._unknown_fields)
+ other_unknown_fields.sort()
+
+ return unknown_fields == other_unknown_fields
cls.__eq__ = __eq__
@@ -710,6 +744,9 @@ def _AddByteSizeMethod(message_descriptor, cls):
for field_descriptor, field_value in self.ListFields():
size += field_descriptor._sizer(field_value)
+ for tag_bytes, value_bytes in self._unknown_fields:
+ size += len(tag_bytes) + len(value_bytes)
+
self._cached_byte_size = size
self._cached_byte_size_dirty = False
self._listener_for_children.dirty = False
@@ -726,8 +763,8 @@ def _AddSerializeToStringMethod(message_descriptor, cls):
errors = []
if not self.IsInitialized():
raise message_mod.EncodeError(
- 'Message is missing required fields: ' +
- ','.join(self.FindInitializationErrors()))
+ 'Message %s is missing required fields: %s' % (
+ self.DESCRIPTOR.full_name,
','.join(self.FindInitializationErrors())))
return self.SerializePartialToString()
cls.SerializeToString = SerializeToString
@@ -744,6 +781,9 @@ def _AddSerializePartialToStringMethod(message_descriptor,
cls):
def InternalSerialize(self, write_bytes):
for field_descriptor, field_value in self.ListFields():
field_descriptor._encoder(write_bytes, field_value)
+ for tag_bytes, value_bytes in self._unknown_fields:
+ write_bytes(tag_bytes)
+ write_bytes(value_bytes)
cls._InternalSerialize = InternalSerialize
@@ -770,13 +810,18 @@ def _AddMergeFromStringMethod(message_descriptor, cls):
def InternalParse(self, buffer, pos, end):
self._Modified()
field_dict = self._fields
+ unknown_field_list = self._unknown_fields
while pos != end:
(tag_bytes, new_pos) = local_ReadTag(buffer, pos)
field_decoder = decoders_by_tag.get(tag_bytes)
if field_decoder is None:
+ value_start_pos = new_pos
new_pos = local_SkipField(buffer, new_pos, end, tag_bytes)
if new_pos == -1:
return pos
+ if not unknown_field_list:
+ unknown_field_list = self._unknown_fields = []
+ unknown_field_list.append((tag_bytes, buffer[value_start_pos:new_pos]))
pos = new_pos
else:
pos = field_decoder(buffer, new_pos, end, self, field_dict)
@@ -873,7 +918,8 @@ def _AddMergeFromMethod(cls):
def MergeFrom(self, msg):
if not isinstance(msg, cls):
raise TypeError(
- "Parameter to MergeFrom() must be instance of same class.")
+ "Parameter to MergeFrom() must be instance of same class: "
+ "expected %s got %s." % (cls.__name__, type(msg).__name__))
assert msg is not self
self._Modified()
@@ -898,6 +944,12 @@ def _AddMergeFromMethod(cls):
field_value.MergeFrom(value)
else:
self._fields[field] = value
+
+ if msg._unknown_fields:
+ if not self._unknown_fields:
+ self._unknown_fields = []
+ self._unknown_fields.extend(msg._unknown_fields)
+
cls.MergeFrom = MergeFrom
diff --git a/script.module.protobuf/lib/google/protobuf/message.py
b/script.module.protobuf/lib/google/protobuf/message.py
index 6f19f85..6ec2f8b 100644
--- a/script.module.protobuf/lib/google/protobuf/message.py
+++ b/script.module.protobuf/lib/google/protobuf/message.py
@@ -73,6 +73,7 @@ class Message(object):
return clone
def __eq__(self, other_msg):
+ """Recursively compares two messages by value and structure."""
raise NotImplementedError
def __ne__(self, other_msg):
@@ -83,9 +84,11 @@ class Message(object):
raise TypeError('unhashable object')
def __str__(self):
+ """Outputs a human-readable representation of the message."""
raise NotImplementedError
def __unicode__(self):
+ """Outputs a human-readable representation of the message."""
raise NotImplementedError
def MergeFrom(self, other_msg):
@@ -266,3 +269,12 @@ class Message(object):
via a previous _SetListener() call.
"""
raise NotImplementedError
+
+ def __getstate__(self):
+ """Support the pickle protocol."""
+ return dict(serialized=self.SerializePartialToString())
+
+ def __setstate__(self, state):
+ """Support the pickle protocol."""
+ self.__init__()
+ self.ParseFromString(state['serialized'])
diff --git a/script.module.protobuf/lib/google/protobuf/reflection.py
b/script.module.protobuf/lib/google/protobuf/reflection.py
index 1373c88..9570fd5 100644
--- a/script.module.protobuf/lib/google/protobuf/reflection.py
+++ b/script.module.protobuf/lib/google/protobuf/reflection.py
@@ -50,13 +50,20 @@ __author__ = '[email protected] (Will Robinson)'
from google.protobuf.internal import api_implementation
from google.protobuf import descriptor as descriptor_mod
+from google.protobuf import message
+
_FieldDescriptor = descriptor_mod.FieldDescriptor
if api_implementation.Type() == 'cpp':
- from google.protobuf.internal import cpp_message
- _NewMessage = cpp_message.NewMessage
- _InitMessage = cpp_message.InitMessage
+ if api_implementation.Version() == 2:
+ from google.protobuf.internal.cpp import cpp_message
+ _NewMessage = cpp_message.NewMessage
+ _InitMessage = cpp_message.InitMessage
+ else:
+ from google.protobuf.internal import cpp_message
+ _NewMessage = cpp_message.NewMessage
+ _InitMessage = cpp_message.InitMessage
else:
from google.protobuf.internal import python_message
_NewMessage = python_message.NewMessage
@@ -112,7 +119,7 @@ class GeneratedProtocolMessageType(type):
Newly-allocated class.
"""
descriptor = dictionary[GeneratedProtocolMessageType._DESCRIPTOR_KEY]
- _NewMessage(descriptor, dictionary)
+ bases = _NewMessage(bases, descriptor, dictionary)
superclass = super(GeneratedProtocolMessageType, cls)
new_class = superclass.__new__(cls, name, bases, dictionary)
@@ -140,3 +147,23 @@ class GeneratedProtocolMessageType(type):
_InitMessage(descriptor, cls)
superclass = super(GeneratedProtocolMessageType, cls)
superclass.__init__(name, bases, dictionary)
+
+
+def ParseMessage(descriptor, byte_str):
+ """Generate a new Message instance from this Descriptor and a byte string.
+
+ Args:
+ descriptor: Protobuf Descriptor object
+ byte_str: Serialized protocol buffer byte string
+
+ Returns:
+ Newly created protobuf Message object.
+ """
+
+ class _ResultClass(message.Message):
+ __metaclass__ = GeneratedProtocolMessageType
+ DESCRIPTOR = descriptor
+
+ new_msg = _ResultClass()
+ new_msg.ParseFromString(byte_str)
+ return new_msg
diff --git a/script.module.protobuf/lib/google/protobuf/text_format.py
b/script.module.protobuf/lib/google/protobuf/text_format.py
index c3a1cf6..24dd07f 100644
--- a/script.module.protobuf/lib/google/protobuf/text_format.py
+++ b/script.module.protobuf/lib/google/protobuf/text_format.py
@@ -43,10 +43,12 @@ __all__ = [ 'MessageToString', 'PrintMessage', 'PrintField',
'PrintFieldValue', 'Merge' ]
-# Infinity and NaN are not explicitly supported by Python pre-2.6, and
-# float('inf') does not work on Windows (pre-2.6).
-_INFINITY = 1e10000 # overflows, thus will actually be infinity.
-_NAN = _INFINITY * 0
+_INTEGER_CHECKERS = (type_checkers.Uint32ValueChecker(),
+ type_checkers.Int32ValueChecker(),
+ type_checkers.Uint64ValueChecker(),
+ type_checkers.Int64ValueChecker())
+_FLOAT_INFINITY = re.compile('-?inf(?:inity)?f?', re.IGNORECASE)
+_FLOAT_NAN = re.compile('nanf?', re.IGNORECASE)
class ParseError(Exception):
@@ -120,7 +122,11 @@ def PrintFieldValue(field, value, out, indent=0,
PrintMessage(value, out, indent + 2, as_utf8, as_one_line)
out.write(' ' * indent + '}')
elif field.cpp_type == descriptor.FieldDescriptor.CPPTYPE_ENUM:
- out.write(field.enum_type.values_by_number[value].name)
+ enum_value = field.enum_type.values_by_number.get(value, None)
+ if enum_value is not None:
+ out.write(enum_value.name)
+ else:
+ out.write(str(value))
elif field.cpp_type == descriptor.FieldDescriptor.CPPTYPE_STRING:
out.write('\"')
if type(value) is unicode:
@@ -271,24 +277,7 @@ def _MergeScalarField(tokenizer, message, field):
elif field.type == descriptor.FieldDescriptor.TYPE_BYTES:
value = tokenizer.ConsumeByteString()
elif field.type == descriptor.FieldDescriptor.TYPE_ENUM:
- # Enum can be specified by a number (the enum value), or by
- # a string literal (the enum name).
- enum_descriptor = field.enum_type
- if tokenizer.LookingAtInteger():
- number = tokenizer.ConsumeInt32()
- enum_value = enum_descriptor.values_by_number.get(number, None)
- if enum_value is None:
- raise tokenizer.ParseErrorPreviousToken(
- 'Enum type "%s" has no value with number %d.' % (
- enum_descriptor.full_name, number))
- else:
- identifier = tokenizer.ConsumeIdentifier()
- enum_value = enum_descriptor.values_by_name.get(identifier, None)
- if enum_value is None:
- raise tokenizer.ParseErrorPreviousToken(
- 'Enum type "%s" has no value named %s.' % (
- enum_descriptor.full_name, identifier))
- value = enum_value.number
+ value = tokenizer.ConsumeEnum(field)
else:
raise RuntimeError('Unknown field type %d' % field.type)
@@ -320,12 +309,6 @@ class _Tokenizer(object):
'\"([^\"\n\\\\]|\\\\.)*(\"|\\\\?$)|' # a double-quoted string
'\'([^\'\n\\\\]|\\\\.)*(\'|\\\\?$)') # a single-quoted string
_IDENTIFIER = re.compile('\w+')
- _INTEGER_CHECKERS = [type_checkers.Uint32ValueChecker(),
- type_checkers.Int32ValueChecker(),
- type_checkers.Uint64ValueChecker(),
- type_checkers.Int64ValueChecker()]
- _FLOAT_INFINITY = re.compile('-?inf(inity)?f?', re.IGNORECASE)
- _FLOAT_NAN = re.compile("nanf?", re.IGNORECASE)
def __init__(self, text_message):
self._text_message = text_message
@@ -394,17 +377,6 @@ class _Tokenizer(object):
if not self.TryConsume(token):
raise self._ParseError('Expected "%s".' % token)
- def LookingAtInteger(self):
- """Checks if the current token is an integer.
-
- Returns:
- True iff the current token is an integer.
- """
- if not self.token:
- return False
- c = self.token[0]
- return (c >= '0' and c <= '9') or c == '-' or c == '+'
-
def ConsumeIdentifier(self):
"""Consumes protocol message field identifier.
@@ -430,9 +402,9 @@ class _Tokenizer(object):
ParseError: If a signed 32bit integer couldn't be consumed.
"""
try:
- result = self._ParseInteger(self.token, is_signed=True, is_long=False)
+ result = ParseInteger(self.token, is_signed=True, is_long=False)
except ValueError, e:
- raise self._IntegerParseError(e)
+ raise self._ParseError(str(e))
self.NextToken()
return result
@@ -446,9 +418,9 @@ class _Tokenizer(object):
ParseError: If an unsigned 32bit integer couldn't be consumed.
"""
try:
- result = self._ParseInteger(self.token, is_signed=False, is_long=False)
+ result = ParseInteger(self.token, is_signed=False, is_long=False)
except ValueError, e:
- raise self._IntegerParseError(e)
+ raise self._ParseError(str(e))
self.NextToken()
return result
@@ -462,9 +434,9 @@ class _Tokenizer(object):
ParseError: If a signed 64bit integer couldn't be consumed.
"""
try:
- result = self._ParseInteger(self.token, is_signed=True, is_long=True)
+ result = ParseInteger(self.token, is_signed=True, is_long=True)
except ValueError, e:
- raise self._IntegerParseError(e)
+ raise self._ParseError(str(e))
self.NextToken()
return result
@@ -478,9 +450,9 @@ class _Tokenizer(object):
ParseError: If an unsigned 64bit integer couldn't be consumed.
"""
try:
- result = self._ParseInteger(self.token, is_signed=False, is_long=True)
+ result = ParseInteger(self.token, is_signed=False, is_long=True)
except ValueError, e:
- raise self._IntegerParseError(e)
+ raise self._ParseError(str(e))
self.NextToken()
return result
@@ -493,21 +465,10 @@ class _Tokenizer(object):
Raises:
ParseError: If a floating point number couldn't be consumed.
"""
- text = self.token
- if self._FLOAT_INFINITY.match(text):
- self.NextToken()
- if text.startswith('-'):
- return -_INFINITY
- return _INFINITY
-
- if self._FLOAT_NAN.match(text):
- self.NextToken()
- return _NAN
-
try:
- result = float(text)
+ result = ParseFloat(self.token)
except ValueError, e:
- raise self._FloatParseError(e)
+ raise self._ParseError(str(e))
self.NextToken()
return result
@@ -520,14 +481,12 @@ class _Tokenizer(object):
Raises:
ParseError: If a boolean value couldn't be consumed.
"""
- if self.token in ('true', 't', '1'):
- self.NextToken()
- return True
- elif self.token in ('false', 'f', '0'):
- self.NextToken()
- return False
- else:
- raise self._ParseError('Expected "true" or "false".')
+ try:
+ result = ParseBool(self.token)
+ except ValueError, e:
+ raise self._ParseError(str(e))
+ self.NextToken()
+ return result
def ConsumeString(self):
"""Consumes a string value.
@@ -567,7 +526,7 @@ class _Tokenizer(object):
"""
text = self.token
if len(text) < 1 or text[0] not in ('\'', '"'):
- raise self._ParseError('Exptected string.')
+ raise self._ParseError('Expected string.')
if len(text) < 2 or text[-1] != text[0]:
raise self._ParseError('String missing ending quote.')
@@ -579,36 +538,12 @@ class _Tokenizer(object):
self.NextToken()
return result
- def _ParseInteger(self, text, is_signed=False, is_long=False):
- """Parses an integer.
-
- Args:
- text: The text to parse.
- is_signed: True if a signed integer must be parsed.
- is_long: True if a long integer must be parsed.
-
- Returns:
- The integer value.
-
- Raises:
- ValueError: Thrown Iff the text is not a valid integer.
- """
- pos = 0
- if text.startswith('-'):
- pos += 1
-
- base = 10
- if text.startswith('0x', pos) or text.startswith('0X', pos):
- base = 16
- elif text.startswith('0', pos):
- base = 8
-
- # Do the actual parsing. Exception handling is propagated to caller.
- result = int(text, base)
-
- # Check if the integer is sane. Exceptions handled by callers.
- checker = self._INTEGER_CHECKERS[2 * int(is_long) + int(is_signed)]
- checker.CheckValue(result)
+ def ConsumeEnum(self, field):
+ try:
+ result = ParseEnum(field, self.token)
+ except ValueError, e:
+ raise self._ParseError(str(e))
+ self.NextToken()
return result
def ParseErrorPreviousToken(self, message):
@@ -626,13 +561,7 @@ class _Tokenizer(object):
def _ParseError(self, message):
"""Creates and *returns* a ParseError for the current token."""
return ParseError('%d:%d : %s' % (
- self._line + 1, self._column - len(self.token) + 1, message))
-
- def _IntegerParseError(self, e):
- return self._ParseError('Couldn\'t parse integer: ' + str(e))
-
- def _FloatParseError(self, e):
- return self._ParseError('Couldn\'t parse number: ' + str(e))
+ self._line + 1, self._column + 1, message))
def _StringParseError(self, e):
return self._ParseError('Couldn\'t parse string: ' + str(e))
@@ -679,13 +608,132 @@ def _CEscape(text, as_utf8):
return "".join([escape(c) for c in text])
-_CUNESCAPE_HEX = re.compile('\\\\x([0-9a-fA-F]{2}|[0-9a-fA-F])')
+_CUNESCAPE_HEX = re.compile(r'(\\+)x([0-9a-fA-F])(?![0-9a-fA-F])')
def _CUnescape(text):
def ReplaceHex(m):
- return chr(int(m.group(0)[2:], 16))
+ # Only replace the match if the number of leading back slashes is odd. i.e.
+ # the slash itself is not escaped.
+ if len(m.group(1)) & 1:
+ return m.group(1) + 'x0' + m.group(2)
+ return m.group(0)
+
# This is required because the 'string_escape' encoding doesn't
# allow single-digit hex escapes (like '\xf').
result = _CUNESCAPE_HEX.sub(ReplaceHex, text)
return result.decode('string_escape')
+
+
+def ParseInteger(text, is_signed=False, is_long=False):
+ """Parses an integer.
+
+ Args:
+ text: The text to parse.
+ is_signed: True if a signed integer must be parsed.
+ is_long: True if a long integer must be parsed.
+
+ Returns:
+ The integer value.
+
+ Raises:
+ ValueError: Thrown Iff the text is not a valid integer.
+ """
+ # Do the actual parsing. Exception handling is propagated to caller.
+ try:
+ result = int(text, 0)
+ except ValueError:
+ raise ValueError('Couldn\'t parse integer: %s' % text)
+
+ # Check if the integer is sane. Exceptions handled by callers.
+ checker = _INTEGER_CHECKERS[2 * int(is_long) + int(is_signed)]
+ checker.CheckValue(result)
+ return result
+
+
+def ParseFloat(text):
+ """Parse a floating point number.
+
+ Args:
+ text: Text to parse.
+
+ Returns:
+ The number parsed.
+
+ Raises:
+ ValueError: If a floating point number couldn't be parsed.
+ """
+ try:
+ # Assume Python compatible syntax.
+ return float(text)
+ except ValueError:
+ # Check alternative spellings.
+ if _FLOAT_INFINITY.match(text):
+ if text[0] == '-':
+ return float('-inf')
+ else:
+ return float('inf')
+ elif _FLOAT_NAN.match(text):
+ return float('nan')
+ else:
+ # assume '1.0f' format
+ try:
+ return float(text.rstrip('f'))
+ except ValueError:
+ raise ValueError('Couldn\'t parse float: %s' % text)
+
+
+def ParseBool(text):
+ """Parse a boolean value.
+
+ Args:
+ text: Text to parse.
+
+ Returns:
+ Boolean values parsed
+
+ Raises:
+ ValueError: If text is not a valid boolean.
+ """
+ if text in ('true', 't', '1'):
+ return True
+ elif text in ('false', 'f', '0'):
+ return False
+ else:
+ raise ValueError('Expected "true" or "false".')
+
+
+def ParseEnum(field, value):
+ """Parse an enum value.
+
+ The value can be specified by a number (the enum value), or by
+ a string literal (the enum name).
+
+ Args:
+ field: Enum field descriptor.
+ value: String value.
+
+ Returns:
+ Enum value number.
+
+ Raises:
+ ValueError: If the enum value could not be parsed.
+ """
+ enum_descriptor = field.enum_type
+ try:
+ number = int(value, 0)
+ except ValueError:
+ # Identifier.
+ enum_value = enum_descriptor.values_by_name.get(value, None)
+ if enum_value is None:
+ raise ValueError(
+ 'Enum type "%s" has no value named %s.' % (
+ enum_descriptor.full_name, value))
+ else:
+ # Numeric value.
+ enum_value = enum_descriptor.values_by_number.get(number, None)
+ if enum_value is None:
+ raise ValueError(
+ 'Enum type "%s" has no value with number %d.' % (
+ enum_descriptor.full_name, number))
+ return enum_value.number
-----------------------------------------------------------------------
Summary of changes:
script.module.protobuf/addon.xml | 5 +-
.../lib/google/protobuf/descriptor.py | 125 ++-
.../lib/google/protobuf/descriptor_database.py | 120 ++
.../lib/google/protobuf/descriptor_pb2.py | 1080 ------------
.../lib/google/protobuf/descriptor_pool.py | 527 ++++++
.../google/protobuf/internal/api_implementation.py | 23 +
.../lib/google/protobuf/internal/containers.py | 14 +-
.../lib/google/protobuf/internal/cpp_message.py | 117 +-
.../lib/google/protobuf/internal/decoder.py | 6 +
.../protobuf/internal/descriptor_database_test.py | 63 +
.../google/protobuf/internal/enum_type_wrapper.py | 89 +
.../google/protobuf/internal/more_extensions.proto | 58 +
.../internal/more_extensions_dynamic.proto | 49 +
.../google/protobuf/internal/more_messages.proto | 51 +
.../lib/google/protobuf/internal/python_message.py | 66 +-
.../lib/google/protobuf/message.py | 12 +
.../lib/google/protobuf/message_factory.py | 113 ++
.../lib/google/protobuf/pyext/python-proto2.cc | 1717 ++++++++++++++++++++
.../lib/google/protobuf/pyext/python_descriptor.cc | 337 ++++
.../lib/google/protobuf/pyext/python_descriptor.h | 87 +
.../lib/google/protobuf/pyext/python_protobuf.cc | 63 +
.../lib/google/protobuf/pyext/python_protobuf.h | 57 +
.../lib/google/protobuf/reflection.py | 35 +-
.../lib/google/protobuf/text_format.py | 266 ++--
24 files changed, 3836 insertions(+), 1244 deletions(-)
create mode 100644
script.module.protobuf/lib/google/protobuf/descriptor_database.py
delete mode 100644 script.module.protobuf/lib/google/protobuf/descriptor_pb2.py
create mode 100644
script.module.protobuf/lib/google/protobuf/descriptor_pool.py
create mode 100644
script.module.protobuf/lib/google/protobuf/internal/descriptor_database_test.py
create mode 100644
script.module.protobuf/lib/google/protobuf/internal/enum_type_wrapper.py
create mode 100644
script.module.protobuf/lib/google/protobuf/internal/more_extensions.proto
create mode 100644
script.module.protobuf/lib/google/protobuf/internal/more_extensions_dynamic.proto
create mode 100644
script.module.protobuf/lib/google/protobuf/internal/more_messages.proto
create mode 100644
script.module.protobuf/lib/google/protobuf/message_factory.py
create mode 100644
script.module.protobuf/lib/google/protobuf/pyext/python-proto2.cc
create mode 100644
script.module.protobuf/lib/google/protobuf/pyext/python_descriptor.cc
create mode 100644
script.module.protobuf/lib/google/protobuf/pyext/python_descriptor.h
create mode 100644
script.module.protobuf/lib/google/protobuf/pyext/python_protobuf.cc
create mode 100644
script.module.protobuf/lib/google/protobuf/pyext/python_protobuf.h
hooks/post-receive
--
Scripts
------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135031&iu=/4140/ostg.clktrk
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons