Commit 67ac65cf authored by sergiyb@chromium.org's avatar sergiyb@chromium.org

Renamed google.protobuf to protobuf26

R=pgervais@chromium.org

Review URL: https://codereview.chromium.org/1162993005

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@295512 0039d316-1c4b-4281-b951-d872f2087c98
parent f59415fb
...@@ -26,7 +26,7 @@ THIRD_PARTY_DIR = os.path.join(os.path.dirname(__file__), 'third_party') ...@@ -26,7 +26,7 @@ THIRD_PARTY_DIR = os.path.join(os.path.dirname(__file__), 'third_party')
sys.path.insert(0, THIRD_PARTY_DIR) sys.path.insert(0, THIRD_PARTY_DIR)
from cq_client import cq_pb2 from cq_client import cq_pb2
from google.protobuf import text_format from protobuf26 import text_format
def usage(more): def usage(more):
def hook(fn): def hook(fn):
......
# This file was originally generated by the protocol buffer compiler 2.6.1, but
# was subsequently manually edited to import protobuf26 instead of
# google.protobuf. If you need to re-generate this file, please make similar
# changes again and add this comment back. More details on why we chose to
# rename the package can be found in the file
# depot_tools/third_party/protobuf26/README.chromium
# Example CL updating the references:
# https://codereview.chromium.org/1162993005/
# Generated by the protocol buffer compiler. DO NOT EDIT! # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: cq.proto # source: cq.proto
import sys import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor from protobuf26 import descriptor as _descriptor
from google.protobuf import message as _message from protobuf26 import message as _message
from google.protobuf import reflection as _reflection from protobuf26 import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database from protobuf26 import symbol_database as _symbol_database
from google.protobuf import descriptor_pb2 from protobuf26 import descriptor_pb2
# @@protoc_insertion_point(imports) # @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default() _sym_db = _symbol_database.Default()
......
__import__('pkg_resources').declare_namespace(__name__)
This directory contains google.protobuf module version 2.6.0 build 0.
This directory contains google.protobuf module version 2.6.0 build 0.
sergiyb@: It has been manually renamed to protobuf26. This is needed to avoid
conflicts with a built-in google.protobuf module found on many developer
machines. The long-term solution to this problem, however, should be virtualenv.
Unfortunately due to limited time and lack of experience, it was not a
reasonable short-term solution.
If you need to update this package, please make sure that you replace all
the references to google.protobuf in the package itself with protobuf26, e.g.
from google.protobuf import text_format
import google.protobuf
becomes
from protobuf26 import text_format
import protobuf26
Bug tracking setting up virtualenv for depot_tools is https://crbug.com/496241.
...@@ -3,17 +3,17 @@ ...@@ -3,17 +3,17 @@
import sys import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor from protobuf26 import descriptor as _descriptor
from google.protobuf import message as _message from protobuf26 import message as _message
from google.protobuf import reflection as _reflection from protobuf26 import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database from protobuf26 import symbol_database as _symbol_database
from google.protobuf import descriptor_pb2 from protobuf26 import descriptor_pb2
# @@protoc_insertion_point(imports) # @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default() _sym_db = _symbol_database.Default()
import google.protobuf.descriptor_pb2 import protobuf26.descriptor_pb2
DESCRIPTOR = _descriptor.FileDescriptor( DESCRIPTOR = _descriptor.FileDescriptor(
......
...@@ -38,7 +38,7 @@ file, in types that make this information accessible in Python. ...@@ -38,7 +38,7 @@ file, in types that make this information accessible in Python.
__author__ = 'robinson@google.com (Will Robinson)' __author__ = 'robinson@google.com (Will Robinson)'
from google.protobuf.internal import api_implementation from protobuf26.internal import api_implementation
if api_implementation.Type() == 'cpp': if api_implementation.Type() == 'cpp':
...@@ -47,9 +47,9 @@ if api_implementation.Type() == 'cpp': ...@@ -47,9 +47,9 @@ if api_implementation.Type() == 'cpp':
import uuid import uuid
if api_implementation.Version() == 2: if api_implementation.Version() == 2:
from google.protobuf.pyext import _message from protobuf26.pyext import _message
else: else:
from google.protobuf.internal import cpp_message from protobuf26.internal import cpp_message
class Error(Exception): class Error(Exception):
...@@ -106,7 +106,7 @@ class DescriptorBase(object): ...@@ -106,7 +106,7 @@ class DescriptorBase(object):
""" """
if self._options: if self._options:
return self._options return self._options
from google.protobuf import descriptor_pb2 from protobuf26 import descriptor_pb2
try: try:
options_class = getattr(descriptor_pb2, self._options_class_name) options_class = getattr(descriptor_pb2, self._options_class_name)
except AttributeError: except AttributeError:
...@@ -774,7 +774,7 @@ def MakeDescriptor(desc_proto, package='', build_file_if_cpp=True): ...@@ -774,7 +774,7 @@ def MakeDescriptor(desc_proto, package='', build_file_if_cpp=True):
# definition in the C++ descriptor pool. To do this, we build a # definition in the C++ descriptor pool. To do this, we build a
# FileDescriptorProto with the same definition as this descriptor and build # FileDescriptorProto with the same definition as this descriptor and build
# it into the pool. # it into the pool.
from google.protobuf import descriptor_pb2 from protobuf26 import descriptor_pb2
file_descriptor_proto = descriptor_pb2.FileDescriptorProto() file_descriptor_proto = descriptor_pb2.FileDescriptorProto()
file_descriptor_proto.message_type.add().MergeFrom(desc_proto) file_descriptor_proto.message_type.add().MergeFrom(desc_proto)
......
...@@ -3,10 +3,10 @@ ...@@ -3,10 +3,10 @@
import sys import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor from protobuf26 import descriptor as _descriptor
from google.protobuf import message as _message from protobuf26 import message as _message
from google.protobuf import reflection as _reflection from protobuf26 import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database from protobuf26 import symbol_database as _symbol_database
# @@protoc_insertion_point(imports) # @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default() _sym_db = _symbol_database.Default()
......
...@@ -59,9 +59,9 @@ __author__ = 'matthewtoia@google.com (Matt Toia)' ...@@ -59,9 +59,9 @@ __author__ = 'matthewtoia@google.com (Matt Toia)'
import sys import sys
from google.protobuf import descriptor from protobuf26 import descriptor
from google.protobuf import descriptor_database from protobuf26 import descriptor_database
from google.protobuf import text_encoding from protobuf26 import text_encoding
def _NormalizeFullyQualifiedName(name): def _NormalizeFullyQualifiedName(name):
......
...@@ -36,7 +36,7 @@ import sys ...@@ -36,7 +36,7 @@ import sys
try: try:
# pylint: disable=g-import-not-at-top # pylint: disable=g-import-not-at-top
from google.protobuf.internal import _api_implementation from protobuf26.internal import _api_implementation
# The compile-time constants in the _api_implementation module can be used to # The compile-time constants in the _api_implementation module can be used to
# switch to a certain implementation of the Python API at build time. # switch to a certain implementation of the Python API at build time.
_api_version = _api_implementation.api_version _api_version = _api_implementation.api_version
......
...@@ -36,9 +36,9 @@ __author__ = 'petar@google.com (Petar Petrov)' ...@@ -36,9 +36,9 @@ __author__ = 'petar@google.com (Petar Petrov)'
import copy_reg import copy_reg
import operator import operator
from google.protobuf.internal import _net_proto2___python from protobuf26.internal import _net_proto2___python
from google.protobuf.internal import enum_type_wrapper from protobuf26.internal import enum_type_wrapper
from google.protobuf import message from protobuf26 import message
_LABEL_REPEATED = _net_proto2___python.LABEL_REPEATED _LABEL_REPEATED = _net_proto2___python.LABEL_REPEATED
...@@ -299,7 +299,7 @@ class ExtensionDict(object): ...@@ -299,7 +299,7 @@ class ExtensionDict(object):
self._values = {} self._values = {}
def __setitem__(self, extension, value): def __setitem__(self, extension, value):
from google.protobuf import descriptor from protobuf26 import descriptor
if not isinstance(extension, descriptor.FieldDescriptor): if not isinstance(extension, descriptor.FieldDescriptor):
raise KeyError('Bad extension %r.' % (extension,)) raise KeyError('Bad extension %r.' % (extension,))
cdescriptor = extension._cdescriptor cdescriptor = extension._cdescriptor
...@@ -311,7 +311,7 @@ class ExtensionDict(object): ...@@ -311,7 +311,7 @@ class ExtensionDict(object):
self._values[extension] = value self._values[extension] = value
def __getitem__(self, extension): def __getitem__(self, extension):
from google.protobuf import descriptor from protobuf26 import descriptor
if not isinstance(extension, descriptor.FieldDescriptor): if not isinstance(extension, descriptor.FieldDescriptor):
raise KeyError('Bad extension %r.' % (extension,)) raise KeyError('Bad extension %r.' % (extension,))
...@@ -329,7 +329,7 @@ class ExtensionDict(object): ...@@ -329,7 +329,7 @@ class ExtensionDict(object):
return ext return ext
def ClearExtension(self, extension): def ClearExtension(self, extension):
from google.protobuf import descriptor from protobuf26 import descriptor
if not isinstance(extension, descriptor.FieldDescriptor): if not isinstance(extension, descriptor.FieldDescriptor):
raise KeyError('Bad extension %r.' % (extension,)) raise KeyError('Bad extension %r.' % (extension,))
self._cmsg.ClearFieldByDescriptor(extension._cdescriptor) self._cmsg.ClearFieldByDescriptor(extension._cdescriptor)
...@@ -337,7 +337,7 @@ class ExtensionDict(object): ...@@ -337,7 +337,7 @@ class ExtensionDict(object):
del self._values[extension] del self._values[extension]
def HasExtension(self, extension): def HasExtension(self, extension):
from google.protobuf import descriptor from protobuf26 import descriptor
if not isinstance(extension, descriptor.FieldDescriptor): if not isinstance(extension, descriptor.FieldDescriptor):
raise KeyError('Bad extension %r.' % (extension,)) raise KeyError('Bad extension %r.' % (extension,))
return self._cmsg.HasFieldByDescriptor(extension._cdescriptor) return self._cmsg.HasFieldByDescriptor(extension._cdescriptor)
...@@ -627,7 +627,7 @@ def _AddMessageMethods(message_descriptor, cls): ...@@ -627,7 +627,7 @@ def _AddMessageMethods(message_descriptor, cls):
def __unicode__(self): def __unicode__(self):
# Lazy import to prevent circular import when text_format imports this file. # Lazy import to prevent circular import when text_format imports this file.
from google.protobuf import text_format from protobuf26 import text_format
return text_format.MessageToString(self, as_utf8=True).decode('utf-8') return text_format.MessageToString(self, as_utf8=True).decode('utf-8')
# Attach the local methods to the message class. # Attach the local methods to the message class.
......
...@@ -87,9 +87,9 @@ __author__ = 'kenton@google.com (Kenton Varda)' ...@@ -87,9 +87,9 @@ __author__ = 'kenton@google.com (Kenton Varda)'
import struct import struct
import sys ##PY25 import sys ##PY25
_PY2 = sys.version_info[0] < 3 ##PY25 _PY2 = sys.version_info[0] < 3 ##PY25
from google.protobuf.internal import encoder from protobuf26.internal import encoder
from google.protobuf.internal import wire_format from protobuf26.internal import wire_format
from google.protobuf import message from protobuf26 import message
# This will overflow and thus become IEEE-754 "infinity". We would use # This will overflow and thus become IEEE-754 "infinity". We would use
......
...@@ -73,7 +73,7 @@ __author__ = 'kenton@google.com (Kenton Varda)' ...@@ -73,7 +73,7 @@ __author__ = 'kenton@google.com (Kenton Varda)'
import struct import struct
import sys ##PY25 import sys ##PY25
_PY2 = sys.version_info[0] < 3 ##PY25 _PY2 = sys.version_info[0] < 3 ##PY25
from google.protobuf.internal import wire_format from protobuf26.internal import wire_format
# This will overflow and thus become IEEE-754 "infinity". We would use # This will overflow and thus become IEEE-754 "infinity". We would use
......
...@@ -68,16 +68,16 @@ import struct ...@@ -68,16 +68,16 @@ import struct
import weakref import weakref
# We use "as" to avoid name collisions with variables. # We use "as" to avoid name collisions with variables.
from google.protobuf.internal import containers from protobuf26.internal import containers
from google.protobuf.internal import decoder from protobuf26.internal import decoder
from google.protobuf.internal import encoder from protobuf26.internal import encoder
from google.protobuf.internal import enum_type_wrapper from protobuf26.internal import enum_type_wrapper
from google.protobuf.internal import message_listener as message_listener_mod from protobuf26.internal import message_listener as message_listener_mod
from google.protobuf.internal import type_checkers from protobuf26.internal import type_checkers
from google.protobuf.internal import wire_format from protobuf26.internal import wire_format
from google.protobuf import descriptor as descriptor_mod from protobuf26 import descriptor as descriptor_mod
from google.protobuf import message as message_mod from protobuf26 import message as message_mod
from google.protobuf import text_format from protobuf26 import text_format
_FieldDescriptor = descriptor_mod.FieldDescriptor _FieldDescriptor = descriptor_mod.FieldDescriptor
......
...@@ -51,11 +51,11 @@ __author__ = 'robinson@google.com (Will Robinson)' ...@@ -51,11 +51,11 @@ __author__ = 'robinson@google.com (Will Robinson)'
import sys ##PY25 import sys ##PY25
if sys.version < '2.6': bytes = str ##PY25 if sys.version < '2.6': bytes = str ##PY25
from google.protobuf.internal import api_implementation from protobuf26.internal import api_implementation
from google.protobuf.internal import decoder from protobuf26.internal import decoder
from google.protobuf.internal import encoder from protobuf26.internal import encoder
from google.protobuf.internal import wire_format from protobuf26.internal import wire_format
from google.protobuf import descriptor from protobuf26 import descriptor
_FieldDescriptor = descriptor.FieldDescriptor _FieldDescriptor = descriptor.FieldDescriptor
......
...@@ -33,8 +33,8 @@ ...@@ -33,8 +33,8 @@
__author__ = 'robinson@google.com (Will Robinson)' __author__ = 'robinson@google.com (Will Robinson)'
import struct import struct
from google.protobuf import descriptor from protobuf26 import descriptor
from google.protobuf import message from protobuf26 import message
TAG_TYPE_BITS = 3 # Number of bits used to hold type info in a proto tag. TAG_TYPE_BITS = 3 # Number of bits used to hold type info in a proto tag.
......
...@@ -44,10 +44,10 @@ my_proto_instance = message_classes['some.proto.package.MessageName']() ...@@ -44,10 +44,10 @@ my_proto_instance = message_classes['some.proto.package.MessageName']()
__author__ = 'matthewtoia@google.com (Matt Toia)' __author__ = 'matthewtoia@google.com (Matt Toia)'
import sys ##PY25 import sys ##PY25
from google.protobuf import descriptor_database from protobuf26 import descriptor_database
from google.protobuf import descriptor_pool from protobuf26 import descriptor_pool
from google.protobuf import message from protobuf26 import message
from google.protobuf import reflection from protobuf26 import reflection
class MessageFactory(object): class MessageFactory(object):
......
...@@ -48,24 +48,24 @@ this file*. ...@@ -48,24 +48,24 @@ this file*.
__author__ = 'robinson@google.com (Will Robinson)' __author__ = 'robinson@google.com (Will Robinson)'
from google.protobuf.internal import api_implementation from protobuf26.internal import api_implementation
from google.protobuf import descriptor as descriptor_mod from protobuf26 import descriptor as descriptor_mod
from google.protobuf import message from protobuf26 import message
_FieldDescriptor = descriptor_mod.FieldDescriptor _FieldDescriptor = descriptor_mod.FieldDescriptor
if api_implementation.Type() == 'cpp': if api_implementation.Type() == 'cpp':
if api_implementation.Version() == 2: if api_implementation.Version() == 2:
from google.protobuf.pyext import cpp_message from protobuf26.pyext import cpp_message
_NewMessage = cpp_message.NewMessage _NewMessage = cpp_message.NewMessage
_InitMessage = cpp_message.InitMessage _InitMessage = cpp_message.InitMessage
else: else:
from google.protobuf.internal import cpp_message from protobuf26.internal import cpp_message
_NewMessage = cpp_message.NewMessage _NewMessage = cpp_message.NewMessage
_InitMessage = cpp_message.InitMessage _InitMessage = cpp_message.InitMessage
else: else:
from google.protobuf.internal import python_message from protobuf26.internal import python_message
_NewMessage = python_message.NewMessage _NewMessage = python_message.NewMessage
_InitMessage = python_message.InitMessage _InitMessage = python_message.InitMessage
......
...@@ -60,7 +60,7 @@ Example usage: ...@@ -60,7 +60,7 @@ Example usage:
""" """
from google.protobuf import descriptor_pool from protobuf26 import descriptor_pool
class SymbolDatabase(object): class SymbolDatabase(object):
......
...@@ -39,9 +39,9 @@ __author__ = 'kenton@google.com (Kenton Varda)' ...@@ -39,9 +39,9 @@ __author__ = 'kenton@google.com (Kenton Varda)'
import cStringIO import cStringIO
import re import re
from google.protobuf.internal import type_checkers from protobuf26.internal import type_checkers
from google.protobuf import descriptor from protobuf26 import descriptor
from google.protobuf import text_encoding from protobuf26 import text_encoding
__all__ = ['MessageToString', 'PrintMessage', 'PrintField', __all__ = ['MessageToString', 'PrintMessage', 'PrintField',
'PrintFieldValue', 'Merge'] 'PrintFieldValue', 'Merge']
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment