~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/help_topics.py

  • Committer: Ian Clatworthy
  • Date: 2007-12-11 06:18:55 UTC
  • mto: (3119.1.1 ianc-integration)
  • mto: This revision was merged to the branch mainline in revision 3120.
  • Revision ID: ian.clatworthy@internode.on.net-20071211061855-6085v1kk7g03ypbk
move resource loading into a reusable function

Show diffs side-by-side

added added

removed removed

Lines of Context:
137
137
def _load_from_file(topic_name):
138
138
    """Load help from a file.
139
139
 
140
 
    Topics are expected to be in bzrlib/help_topics.
 
140
    Topics are expected to be txt files in bzrlib.help_topics.
141
141
    """
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_topics', 'en', topic_name + ".txt")
146
 
    return open(filename, 'rU').read()
 
142
    resource_name = "en/%s.txt" % (topic_name,)
 
143
    return osutils.resource_string('bzrlib.help_topics', resource_name)
147
144
 
148
145
 
149
146
def _help_on_revisionspec(name):