def func_test(): """Test if there is major format changes in cplusplus.com""" ifs = urllib.request.urlopen('http://www.cplusplus.com/printf') result = html2groff(fixupHTML(ifs.read()), 'printf') assert '.SH "NAME"' in result assert '.SH "TYPE"' in result assert '.SH "DESCRIPTION"' in result
def func_test(): """Test if there is major format changes in cplusplus.com""" ifs = urllib.request.urlopen('http://en.cppreference.com/w/cpp/container/vector') result = html2groff(fixupHTML(ifs.read()), 'std::vector') assert '.SH "NAME"' in result assert '.SH "SYNOPSIS"' in result assert '.SH "DESCRIPTION"' in result
def func_test(): """Test if there is major format changes in cplusplus.com""" ifs = urllib.request.urlopen("http://en.cppreference.com/w/cpp/container/vector") result = html2groff(fixupHTML(ifs.read()), "std::vector") assert '.SH "NAME"' in result assert '.SH "SYNOPSIS"' in result assert '.SH "DESCRIPTION"' in result
def cache_man_page(self, source, url, name): """callback to cache new man page""" # Skip if already exists, override if forced flag is true outname = self.get_page_path(source, name) if os.path.exists(outname) and not self.forced: return try: os.makedirs(os.path.join(environ.man_dir, source)) except OSError: pass # There are often some errors in the HTML, for example: missing closing # tag. We use fixupHTML to fix this. data = util.fixupHTML(urllib.request.urlopen(url).read()) formatter = importlib.import_module('cppman.formatter.%s' % source[:-4]) groff_text = formatter.html2groff(data, name) with gzip.open(outname, 'w') as f: f.write(groff_text.encode('utf-8'))
def test(): """Simple Text""" ifs = urllib.request.urlopen('http://en.cppreference.com/w/cpp/container/vector') print(html2groff(fixupHTML(ifs.read()), 'std::vector'), end=' ')
def test(): """Simple Text""" import bs4 ifs = urllib.request.urlopen("http://en.cppreference.com/w/cpp/container/vector") print(html2groff(fixupHTML(ifs.read()), "std::vector"), end=" ")
def test(): """Simple Text""" ifs = urllib.request.urlopen('http://www.cplusplus.com/vector') print(html2groff(fixupHTML(ifs.read()), 'std::vector'), end=' ')