Package _setup :: Package dev :: Module userdoc
[hide private]
[frames] | no frames]

Source Code for Module _setup.dev.userdoc

 1  # -*- coding: ascii -*- 
 2  # 
 3  # Copyright 2009, 2010 
 4  # Andr\xe9 Malo or his licensors, as applicable 
 5  # 
 6  # Licensed under the Apache License, Version 2.0 (the "License"); 
 7  # you may not use this file except in compliance with the License. 
 8  # You may obtain a copy of the License at 
 9  # 
10  #     http://www.apache.org/licenses/LICENSE-2.0 
11  # 
12  # Unless required by applicable law or agreed to in writing, software 
13  # distributed under the License is distributed on an "AS IS" BASIS, 
14  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
15  # See the License for the specific language governing permissions and 
16  # limitations under the License. 
17  """ 
18  =================== 
19   User doc builders 
20  =================== 
21   
22  User doc builders. 
23  """ 
24  __author__ = u"Andr\xe9 Malo" 
25  __docformat__ = "restructuredtext en" 
26   
27  import os as _os 
28   
29  from _setup import shell as _shell 
30  from _setup import term as _term 
31   
32   
33 -def sphinx(**kwargs):
34 """ Run sphinx """ 35 prog = _shell.frompath('sphinx-build') 36 if prog is None: 37 _term.red("sphinx-build not found") 38 return False 39 40 env = dict(_os.environ) 41 42 argv = [ 43 prog, '-a', 44 '-d', _os.path.join(kwargs['build'], 'doctrees'), 45 '-b', 'html', 46 kwargs['source'], 47 kwargs['target'], 48 ] 49 50 return not _shell.spawn(*argv, **{'env': env})
51