<s> """<STR_LIT>""" <EOL> import os <EOL> from qisys import ui <EOL> import qisys . sh <EOL> import qisys . parsers <EOL> import qidoc . parsers <EOL> import qidoc . builder <EOL> def configure_parser ( parser ) : <EOL> qisys . parsers . worktree_parser ( parser ) <EOL> qisys . parsers . project_parser ( parser ) <EOL> group = parser . add_argument_group ( "<STR_LIT>" ) <EOL> group . add_argument ( "<STR_LIT>" , "<STR_LIT>" , help = "<STR_LIT>" , <EOL> action = "<STR_LIT:store_true>" ) <EOL> def do ( args ) : <EOL> doc_builder = qidoc . parsers . get_doc_builder ( args ) <EOL> doc_projects = doc_builder . get_dep_projects ( ) <EOL> doc_worktree = doc_builder . doc_worktree <EOL> to_clean = list ( ) <EOL> for doc_project in doc_projects : <EOL> try : <EOL> build_dir = doc_project . build_dir <EOL> except AttributeError : <EOL> continue <EOL> if not os . path . exists ( build_dir ) : <EOL> continue <EOL> if qisys . sh . is_empty ( build_dir ) : <EOL> qisys . sh . rm ( build_dir ) <EOL> continue <EOL> to_clean . append ( build_dir ) <EOL> if not to_clean : <EOL> ui . info ( ui . green , "<STR_LIT>" ) <EOL> return <EOL> if not args . force : <EOL> ui . info ( ui . green , "<STR_LIT>" , <EOL> ui . white , "<STR_LIT>" ) <EOL> for i , build_dir in enumerate ( to_clean ) : <EOL> if args . force : <EOL> ui . info_count ( i , len ( to_clean ) , <EOL> ui . green , "<STR_LIT>" , ui . reset , <EOL> build_dir ) <EOL> qisys . sh . rm ( build_dir ) <EOL> else : <EOL> ui . info_count ( i , len ( to_clean ) , build_dir ) </s>
