ros-infrastructure / rosdoc_lite

A light-weight version of rosdoc that does not rely on ROS infrastructure for crawling packages.
10 stars 31 forks source link

Doesn't like ros devel spaces #44

Closed stonier closed 10 years ago

stonier commented 10 years ago

Just noticed you can't embed rosdoc_lite in a source workspace. In rdcore.py:

def get_templates_dir():
    return pkg_resources.resource_filename(_PACKAGE_NAME, _TEMPLATES_DIR)

This causes it to run off looking for an installed location - for a devel workspace, this generates the error later in the script:

Cannot locate template file '/mnt/zaphod/code/ros/rocon/devel/lib/python2.7/dist-packages/rosdoc_lite/templates/landing.template'
Traceback (most recent call last):
  File "<string>", line 248, in main
  File "<string>", line 194, in generate_docs
  File "/mnt/zaphod/code/ros/rocon/src/rosdoc_lite/src/rosdoc_lite/landing_page.py", line 109, in generate_landing_page
    template = rdcore.load_tmpl('landing.template')
  File "/mnt/zaphod/code/ros/rocon/src/rosdoc_lite/src/rosdoc_lite/rdcore.py", line 140, in load_tmpl

Would the slightly more hackish, but robust against devel and install workspaces work?

def get_templates_dir():
    return os.path.join(os.path.dirname(__file__), _TEMPLATES_DIR)
jack-oquin commented 10 years ago

Does that change fix the problem?

If so, I have no objection to making it.

stonier commented 10 years ago

Indeed - was using it in an indigo source workspace today to do rocon_uri sphinx docs. I can make a pull request tomorrow morning.

jack-oquin commented 10 years ago

OK, thanks.