~bzr-pqm/bzr/bzr.dev

4070.11.16 by Martin Pool
Fix copyrights and remove assert statement from doc_generate
1
# Copyright (C) 2005 Canonical Ltd
1887.1.1 by Adeodato Simó
Do not separate paragraphs in the copyright statement with blank lines,
2
#
1551.3.11 by Aaron Bentley
Merge from Robert
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.
1887.1.1 by Adeodato Simó
Do not separate paragraphs in the copyright statement with blank lines,
7
#
1551.3.11 by Aaron Bentley
Merge from Robert
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.
1887.1.1 by Adeodato Simó
Do not separate paragraphs in the copyright statement with blank lines,
12
#
1551.3.11 by Aaron Bentley
Merge from Robert
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
4183.7.1 by Sabin Iacob
update FSF mailing address
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
1551.3.11 by Aaron Bentley
Merge from Robert
16
6379.6.3 by Jelmer Vernooij
Use absolute_import.
17
from __future__ import absolute_import
1551.3.11 by Aaron Bentley
Merge from Robert
18
19
20
def get_module(target):
4070.11.12 by Martin Pool
Move tools.doc_generate into bzrlib
21
    mod_name = "bzrlib.doc_generate.autodoc_%s" % (target)
1551.3.11 by Aaron Bentley
Merge from Robert
22
    mod = __import__(mod_name)
23
    components = mod_name.split('.')
24
    for comp in components[1:]:
25
        mod = getattr(mod, comp)
26
    return mod
27