def kw_docs(ctx): """Generates the library keyword documentation Documentation is generated by using the Libdoc tool. """ libdoc(str(Path('src/SeleniumLibrary')), str(Path('docs/SeleniumLibrary.html')))
def run(self): # We need to create some assets in the source tree first... from robot.libdoc import libdoc out_file = os.path.join(self.source_dir, 'robot-doc.html') libdoc('DrupalLibrary::None', out_file) # ... before running the regular Sphinx builder BuildDoc.run(self)
def create_libdoc(result_filepath, libname, python_paths, class_paths): import robot from robot import pythonpathsetter from robot.libdoc import libdoc __extend_classpath(class_paths) for path in python_paths + class_paths: pythonpathsetter.add_path(path) libdoc(libname, result_filepath, format='XML') for path in python_paths + class_paths: pythonpathsetter.remove_path(path)
def library_docs(ctx, name): """Generate standard library documentation. Args: name: Name of the library or ``all`` to generate docs for all libs. Name can be shortened as long as it is a unique prefix. For example, ``b`` is equivalent to ``BuiltIn`` and ``di`` equivalent to ``Dialogs``. """ libraries = ['BuiltIn', 'Collections', 'DateTime', 'Dialogs', 'OperatingSystem', 'Process', 'Screenshot', 'String', 'Telnet', 'XML'] name = name.lower() if name != 'all': libraries = [lib for lib in libraries if lib.lower().startswith(name)] if len(libraries) != 1: raise Exit(f"'{name}' is not a unique library prefix.") for lib in libraries: libdoc(lib, str(Path(f'doc/libraries/{lib}.html')))
def main(): libdoc(join(dirname(__file__),'..','src','Selenium2Library'), join(dirname(__file__),'Selenium2Library.html'))
# Copy Java library java_target_dir = os.path.join(os.path.dirname(__file__),'target') for file in os.listdir(java_target_dir): if fnmatch.fnmatch(file, 'robotremoteagent-*.jar'): jar_file = file jar_full_path = os.path.join(java_target_dir,jar_file) shutil.copy(jar_full_path, os.path.join(os.path.dirname(__file__),'src-python',library_name,'lib')) #version execfile(os.path.join(os.path.dirname(__file__), 'src-python', library_name, 'version.py')) #generate documentation from latest code if not os.path.exists('doc'): os.makedirs('doc') libdoc.libdoc('src-python/{0}'.format(library_name), 'doc/{0}.html'.format(library_name), version=VERSION) #generate the package setup.run_setup(VERSION, ['sdist']) #copy package to packages directory doc_files = glob.iglob(os.path.join(os.path.dirname(__file__), 'dist/*.*')) for file in doc_files: if os.path.isfile(file): shutil.copy(file, packages_dir) #tidy up build folders shutil.rmtree('dist') shutil.rmtree('doc') egg_info_folders = glob.iglob(os.path.join(os.path.dirname(__file__), 'src-python/*.egg-info')) for folder in egg_info_folders:
import sys import os from robot.libdoc import libdoc ROOT = os.path.dirname(os.path.abspath(__file__)) sys.path.insert(0, os.path.join(ROOT, 'src')) if __name__ == '__main__': ipath = os.path.join(ROOT, 'src', 'PysphereLibrary') opath_html = os.path.join(ROOT, 'doc', 'PysphereLibrary.html') opath_xml = os.path.join(ROOT, 'doc', 'PysphereLibrary.xml') try: libdoc(ipath, opath_html) libdoc(ipath, opath_xml) except: print __doc__
def main(): libdoc(join(dirname(__file__),'..','src','PyroLibrary'), join(dirname(__file__),'PyroLibrary.html'))
def _run_task(self): return libdoc( self.options['path'], self.options['output'], )
def make_file_documentation(source_file_path): """Generates the documentation for the file specified in the ``source_file_path`` argument.""" file_name = source_file_path.replace(RESOURCES_DIRECTORY, DOCUMENTATION_DIRECTORY) file_name = file_name.rsplit('.', 1)[0] doc_file = file_name + FORMAT_EXTENSION libdoc(source_file_path, doc_file)
def main(): libdoc(join(dirname(__file__), "..", "src", "SudsLibrary"), join(dirname(__file__), "SudsLibrary.html"))
def create_libdoc(name): ipath = os.path.join(ROOT, "src", "robot", "libraries", name + ".py") opath = os.path.join(ROOT, "doc", "libraries", name + ".html") libdoc(ipath, opath)
def create_libdoc(name): libdoc(name, join(ROOT, 'doc', 'libraries', name+'.html'))
#!/usr/bin/env python from os.path import abspath, dirname, join from robot.libdoc import libdoc docdir = dirname(abspath(__file__)) libpath = join(docdir, '..', 'src', 'SeleniumLibrary') outpath = join(docdir, 'SeleniumLibrary.html') libdoc(libpath, outpath)
import os import sys from robot import libdoc sys.path.append(os.path.join(os.path.dirname(sys.path[0]))) import version print("Generating new documentation...") libraries = ['APILibrary.py', 'GUILibrary.py', 'SOAPLibrary.py'] curr_dir = os.path.dirname(os.path.realpath(__file__)).replace('docs', '') for file in libraries: libdoc.libdoc(curr_dir + 'src/Zoomba/' + file, curr_dir + 'docs/' + file.replace('.py', 'Documentation.html'), name=file.replace(".py", "").replace("Lib", "_Lib"), version=version.VERSION)
def main(): libdoc(join(dirname(__file__), '..', 'KafkaLibrary'), join(dirname(__file__), 'KafkaLibrary.html'))
def main(): libdoc(join(dirname(__file__),'..','src','SikuliXRobotLibrary'), join(dirname(__file__),'SikuliXRobotLibrary.html'))
def main(): libdoc(join(dirname(__file__), '..', 'src', 'TestToolsMK'), join(dirname(__file__), 'TestToolsMK.html'))
def main(): libdoc(join(dirname(__file__), '..', 'src', 'BrowserMobProxyLibrary'), join(dirname(__file__), 'BrowserMobProxyLibrary.html'))
#!/usr/bin/env python import sys import os from robot.libdoc import libdoc ROOT = os.path.normpath(os.path.join(os.path.abspath(__file__), '..', '..')) sys.path.insert(0, os.path.join(ROOT, 'src')) if __name__ == '__main__': ipath = os.path.join(ROOT, 'src', 'SSHLibrary') opath = os.path.join(ROOT, 'doc', 'SSHLibrary.html') try: libdoc(ipath, opath) except (IndexError, KeyError): print __doc__
def main(): libdoc(join(dirname(__file__),'..','crowd.py'), join(dirname(__file__),'crowd.html'))
import sys from os.path import abspath, dirname, join with open(join(dirname(abspath(__file__)), 'src', 'ScapyLibrary', 'version.py')) as f: exec(f.read()) sys.path.insert(0, join(dirname(abspath(__file__)), 'src')) xmlFile = join(dirname(abspath(__file__)), 'src', 'ScapyLibrary', 'ScapyLibrary.xml') try: from robot.libdoc import libdoc libdoc('ScapyLibrary', xmlFile, name='ScapyLibrary', version=__version__, format='XML') except ImportError: pass DESCRIPTION = """ Scapy Robot Framework Library provide keywords for Robot Framework to send, sniff and dissect and forge network packets through scapy. """[1:-1] CLASSIFIERS = """ Operating System :: OS Independent Programming Language :: Python Topic :: Software Development :: Testing """[1:-1] setup(
#!/usr/bin/env python from robot.libdoc import libdoc from os.path import join, dirname execfile(join(dirname(__file__), 'src', 'Rammbock', 'version.py')) libdoc(join(dirname(__file__),'src','Rammbock'), join(dirname(__file__),'Rammbock-%s.html' % VERSION))
# -*- coding: utf-8 -*- """Script to generate library documentation using module libdoc.""" from os.path import dirname, join, realpath from robot.libdoc import libdoc DOCS_DIR = dirname(__file__) SRC_DIR = realpath(join(DOCS_DIR, '..', 'src')) LIB_NAME = 'RequestsChecker' if __name__ == '__main__': libdoc(join(SRC_DIR, LIB_NAME + '.py'), join(DOCS_DIR, LIB_NAME + '.html'), version='1.0.0')
def create_libdoc(name): ipath = os.path.join(ROOT,'src','robot','libraries',name+'.py') opath = os.path.join(ROOT,'doc','libraries',name+'.html') libdoc(ipath, opath)
#!/usr/bin/env python import six import sys import os from robot.libdoc import libdoc ROOT = os.path.normpath(os.path.join(os.path.abspath(__file__), '..', '..')) #sys.path.insert(0, os.path.join(ROOT)) if __name__ == '__main__': ipath = os.path.join(ROOT, 'AristaLibrary', 'AristaLibrary.py') opath = os.path.join(ROOT, 'docs', 'AristaLibrary.html') try: libdoc(ipath, opath) except (IndexError, KeyError): six.print_(__doc__) ipath = os.path.join(ROOT, 'AristaLibrary', 'Expect.py') opath = os.path.join(ROOT, 'docs', 'Expect.html') try: libdoc(ipath, opath) except (IndexError, KeyError): six.print_(__doc__)