Bug #728

python sandbox unusable with includes

Added by J. Wienke over 12 years ago. Updated over 12 years ago.

Status:ResolvedStart date:11/22/2011
Priority:HighDue date:
Assignee:-% Done:

100%

Category:-
Target version:-

Description

>>> from rstsandbox.geometry.Pose_pb2 import Pose
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "build/bdist.linux-x86_64/egg/rstsandbox/geometry/Pose_pb2.py", line 10, in <module>
ImportError: No module named Translation_pb2

If you look at the generated code you see absolute includes:

# Generated by the protocol buffer compiler.  DO NOT EDIT!

from google.protobuf import descriptor
from google.protobuf import message
from google.protobuf import reflection
from google.protobuf import descriptor_pb2
# @@protoc_insertion_point(imports)

import rst.geometry.Translation_pb2
import rst.geometry.Rotation_pb2

DESCRIPTOR = descriptor.FileDescriptor(
  name='rst/geometry/Pose.proto',
  package='rst.geometry',
  serialized_pb='\n\x17rst/geometry/Pose.proto\x12\x0crst.geometry\x1a\x1erst/geometry/Translation.proto\x1a\x1brst/geometry/Rotation.proto\"`\n\x04Pose\x12.\n\x0btranslation\x18\x01 \x02(\x0b\x32\x19.rst.geometry.Translation\x12(\n\x08rotation\x18\x02 \x02(\x0b\x32\x16.rst.geometry.RotationB\nB\x08PoseType')

So we need to somehow have all includes without the rst-prefix to work in this rst vs. rstsandbox module distinction in python or remove the separate sandbox module again in python... both solution are not nice.

Jan, any idea on this?

Associated revisions

Revision 31a9deec
Added by J. Wienke over 12 years ago

Integrate a hack to load the sandbox modules into the rsb module for being able to resolve names. Proposed by Jan

fixes #728

History

#1 Updated by J. Moringen over 12 years ago

Can't we copy submodules and classes from the rstsandbox module into the dictionary of the rst module when rstsandbox is imported?

#2 Updated by J. Wienke over 12 years ago

Do you see a solution how this can be done easily? I need it within the next hour ;)

#3 Updated by J. Wienke over 12 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100

Applied in changeset r173.

Also available in: Atom PDF