comparison tasks/task_generate_doc.py @ 22:5fd933e238bb

massive refactoring from camelCase -> snake_case. See backend commit log for more details
author Goffi <goffi@goffi.org>
date Mon, 22 May 2023 09:11:54 +0200
parents a24d362796be
children e4002775d750
comparison
equal deleted inserted replaced
21:67487063f421 22:5fd933e238bb
15 DOC_DIRS_DEFAULT = ('doc', 'docs') 15 DOC_DIRS_DEFAULT = ('doc', 'docs')
16 16
17 def prepare(self): 17 def prepare(self):
18 to_watch = set() 18 to_watch = set()
19 # root documentation 19 # root documentation
20 self.doc_path = self.getConfig("doc_path") 20 self.doc_path = self.config_get("doc_path")
21 if self.doc_path is not None: 21 if self.doc_path is not None:
22 to_watch.add(self.doc_path) 22 to_watch.add(self.doc_path)
23 # sub docs will be generated before the root documentation 23 # sub docs will be generated before the root documentation
24 self.sub_docs = self.getConfig("sub_docs_dict", value_type="path") 24 self.sub_docs = self.config_get("sub_docs_dict", value_type="path")
25 if self.sub_docs is not None: 25 if self.sub_docs is not None:
26 for d in list(self.sub_docs.values()): 26 for d in list(self.sub_docs.values()):
27 to_watch.add(d) 27 to_watch.add(d)
28 self.WATCH_DIRS = list(to_watch) 28 self.WATCH_DIRS = list(to_watch)
29 29
42 site_name = self.site_name)) 42 site_name = self.site_name))
43 return 43 return
44 44
45 # we first generate the sub documentations 45 # we first generate the sub documentations
46 for name, sub_doc_path in list(self.sub_docs.items()): 46 for name, sub_doc_path in list(self.sub_docs.items()):
47 sub_dir = regex.pathEscape(name or '') 47 sub_dir = regex.path_escape(name or '')
48 build_path = os.path.join(self.build_path, 'doc', sub_dir) 48 build_path = os.path.join(self.build_path, 'doc', sub_dir)
49 await self.runCommand( 49 await self.runCommand(
50 sys.executable, "-m", "sphinx", sub_doc_path, build_path, 50 sys.executable, "-m", "sphinx", sub_doc_path, build_path,
51 ) 51 )
52 52