~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/help_topics.py

merge Alex's changes to support Windows installer and use bzrlib/help for topics

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
rendering on the screen naturally.
34
34
"""
35
35
 
36
 
from bzrlib import registry
 
36
import sys
 
37
 
 
38
import bzrlib
 
39
from bzrlib import (
 
40
    osutils,
 
41
    registry,
 
42
    )
37
43
 
38
44
 
39
45
# Section identifiers (map topics to the right place in the manual)
133
139
 
134
140
    The help is already expected to be in ReStructuredText format.
135
141
    """
136
 
    # FIXME ...
137
 
    bzr_dir = "."
138
 
    filename = "%s/doc/en/user-reference/%s.txt" % (bzr_dir,topic_name)
139
 
    lines = open(filename).readlines()
140
 
    return ''.join(lines)
 
142
    base = osutils.dirname(bzrlib.__file__)
 
143
    if getattr(sys, 'frozen', None):    # bzr.exe
 
144
        base = osutils.abspath(osutils.pathjoin(base, '..', '..'))
 
145
    filename = osutils.pathjoin(base, 'help', topic_name + ".txt")
 
146
    return open(filename, 'rU').read()
141
147
 
142
148
 
143
149
def _help_on_revisionspec(name):