components/resources/protobufs/binary_proto_generator.py
def _ImportProtoModules(self, paths):
    """Import the protobuf modules we need. |paths| is list of import paths"""
    for path in paths:
      # Put the path to our proto libraries in front, so that we don't use
      # system protobuf.
      sys.path.insert(1, path)

    if self._IsInVirtualEnv():
      # Add a custom module loader. When run in a virtualenv that has
      # google.protobuf installed, the site-package was getting searched first
      # despite that pyproto/ is at the start of the sys.path. The module
      # loaders in the meta_path precede all other imports (including even
      # builtins), which allows the proper google.protobuf from pyproto to be
      # found.
      sys.meta_path.append(GoogleProtobufModuleImporter(paths))

    import google.protobuf.text_format as text_format
    globals()['text_format'] = text_format
    self.ImportProtoModule()
Import the protobuf modules we need. |paths| is list of import paths
Import the protobuf modules we need. |paths| is list of import paths
Import the protobuf modules we need . |paths| is list of import paths
def _ImportProtoModules(self, paths):
    for path in paths:
      sys.path.insert(1, path)
    if self._IsInVirtualEnv():
      sys.meta_path.append(GoogleProtobufModuleImporter(paths))
    import google.protobuf.text_format as text_format
    globals()['text_format'] = text_format
    self.ImportProtoModule()
def _ImportProtoModules ( self , paths ) : for path in paths : sys . path . insert ( 1 , path ) if self . _IsInVirtualEnv ( ) : sys . meta_path . append ( GoogleProtobufModuleImporter ( paths ) ) import google . protobuf . text_format as text_format globals ( ) [ 'text_format' ] = text_format self . ImportProtoModule ( )
Import the protobuf modules we need.
Import the protobuf modules we need .
"""Import the protobuf modules we need. |paths| is list of import paths""" # Put the path to our proto libraries in front, so that we don't use # system protobuf. # Add a custom module loader. When run in a virtualenv that has # google.protobuf installed, the site-package was getting searched first # despite that pyproto/ is at the start of the sys.path. The module # loaders in the meta_path precede all other imports (including even # builtins), which allows the proper google.protobuf from pyproto to be # found.
self
paths