コード例 #1
0
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')))
コード例 #2
0
 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)
コード例 #3
0
ファイル: robot_session_server.py プロジェクト: nokia/RED
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)    
コード例 #4
0
ファイル: tasks.py プロジェクト: alexandrul/robotframework
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')))
コード例 #5
0
 def main():
     libdoc(join(dirname(__file__),'..','src','Selenium2Library'), join(dirname(__file__),'Selenium2Library.html'))
コード例 #6
0
# 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:
コード例 #7
0
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__
コード例 #8
0
ファイル: generate.py プロジェクト: Tallisado/pyrolibrary
 def main():
     libdoc(join(dirname(__file__),'..','src','PyroLibrary'), join(dirname(__file__),'PyroLibrary.html'))
コード例 #9
0
 def _run_task(self):
     return libdoc(
         self.options['path'],
         self.options['output'],
     )
コード例 #10
0
ファイル: KeywordDocGenerator.py プロジェクト: mmguzman/Xinet
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)
コード例 #11
0
 def main():
     libdoc(join(dirname(__file__), "..", "src", "SudsLibrary"), join(dirname(__file__), "SudsLibrary.html"))
コード例 #12
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)
コード例 #13
0
def create_libdoc(name):
    libdoc(name, join(ROOT, 'doc', 'libraries', name+'.html'))
コード例 #14
0
#!/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)

コード例 #15
0
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)
コード例 #16
0
 def main():
     libdoc(join(dirname(__file__), '..', 'KafkaLibrary'), join(dirname(__file__), 'KafkaLibrary.html'))
コード例 #17
0
 def main():
     libdoc(join(dirname(__file__),'..','src','SikuliXRobotLibrary'), join(dirname(__file__),'SikuliXRobotLibrary.html'))
コード例 #18
0
 def main():
     libdoc(join(dirname(__file__), '..', 'src', 'TestToolsMK'), join(dirname(__file__), 'TestToolsMK.html'))
コード例 #19
0
 def main():
     libdoc(join(dirname(__file__), '..', 'src', 'BrowserMobProxyLibrary'), join(dirname(__file__), 'BrowserMobProxyLibrary.html'))
コード例 #20
0
ファイル: lib2html.py プロジェクト: DeepeshKaushal/SSHLibrary
#!/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__

コード例 #21
0
ファイル: generate.py プロジェクト: jbarnes007/python-crowd
 def main():
     libdoc(join(dirname(__file__),'..','crowd.py'), join(dirname(__file__),'crowd.html'))
コード例 #22
0
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(
コード例 #23
0
ファイル: gen_docs.py プロジェクト: aizaimenghuangu/Rammbock
#!/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))
コード例 #24
0
# -*- 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')
コード例 #25
0
ファイル: lib2html.py プロジェクト: GrimDerp/robotframework
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)
コード例 #26
0
#!/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__)