def add_code(module, name): if pdf.module_exists(module): filename, ext = os.path.splitext(name) if ext in { '.h', '.hpp' } : add_inc(module, name) elif ext in { '.c', '.cc', '.cpp', '.cxx' }: add_src(module, name) elif ext == '': add_class(module, name) else: print('unsupported file extension') else: print('module %s does not exist or not complete' % module) pdf.module_exist_hint(module) print('you can add module by: %s' % add_module_cmd())
def add_module(module): if pdf.module_exists(module): print('module "%s" already exists' % module) else: pdf.create_module(module) # project dependent