~ubuntu-branches/ubuntu/maverick/bzr/maverick

« back to all changes in this revision

Viewing changes to bzrlib/doc_generate/__init__.py

  • Committer: Bazaar Package Importer
  • Author(s): Jelmer Vernooij
  • Date: 2009-07-21 11:25:12 UTC
  • mfrom: (1.4.1 upstream) (8.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20090721112512-dzfg8hfhqddf1dwj
* New upstream release.
 + Fixes compatibility with Python 2.4. Closes: #537708

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Copyright (C) 2005 Canonical Ltd
 
2
#
 
3
# This program is free software; you can redistribute it and/or modify
 
4
# it under the terms of the GNU General Public License as published by
 
5
# the Free Software Foundation; either version 2 of the License, or
 
6
# (at your option) any later version.
 
7
#
 
8
# This program is distributed in the hope that it will be useful,
 
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
11
# GNU General Public License for more details.
 
12
#
 
13
# You should have received a copy of the GNU General Public License
 
14
# along with this program; if not, write to the Free Software
 
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
16
 
 
17
 
 
18
import sys
 
19
 
 
20
 
 
21
def get_module(target):
 
22
    mod_name = "bzrlib.doc_generate.autodoc_%s" % (target)
 
23
    mod = __import__(mod_name)
 
24
    components = mod_name.split('.')
 
25
    for comp in components[1:]:
 
26
        mod = getattr(mod, comp)
 
27
    return mod
 
28