Exemple #1
0
def findDescriptionTagAndOutputTextBlock(elem, noDescriptionText = False):
    text = ''
    noDescTxt = 'No description'
    if noDescriptionText:
        noDescTxt = '*-*'
    if elem.find('description') is None:
        text += rst.block(noDescTxt)
    elif elem.find('description').text is None:
        text += rst.block(noDescTxt)
    elif elem.find('description').text.strip() == '':
        text += rst.block(noDescTxt)
    elif elem.find('description').text.strip() != '':
        text += rst.block(elem.find('description').text)

    return text;
Exemple #2
0
def findDescriptionTagAndOutputTextBlock(elem, noDescriptionText=False):
    text = ''
    noDescTxt = 'No description'
    if noDescriptionText:
        noDescTxt = '*-*'
    if elem.find('description') is None:
        text += rst.block(noDescTxt)
    elif elem.find('description').text is None:
        text += rst.block(noDescTxt)
    elif elem.find('description').text.strip() == '':
        text += rst.block(noDescTxt)
    elif elem.find('description').text.strip() != '':
        text += rst.block(elem.find('description').text)

    return text
Exemple #3
0
files = []

# Prepare directory tree.
shutil.rmtree(src_dir, True)
shutil.rmtree(bld_dir, True)
os.makedirs(src_dir)
shutil.copytree(img_dir, os.path.join(bld_dir, 'images'))

# Message format.
text = rst.h1('Message Format')
files.append('Message Format.rst')

# Field types.
text += rst.h2('Field types')
text += rst.block(root.find('types/description').text)
ttypes = rst.Table()
ttypes.add_row('Name', 'Size', 'Description')
for t in root.findall('types/type'):
    if 'size' in t.attrib:
        size = t.attrib['size'].strip()
    else:
        size = 'n/a'
    ttypes.add_row(t.attrib['name'], size, t.find('description').text)
text += str(ttypes)
open(os.path.join(src_dir, 'Message Format.rst'), 'w').write(text)

# Serialization.
text = rst.h2('Serialization')
text += rst.block(root.find('serialization/description').text)
ttypes = rst.Table()
Exemple #4
0
# Prepare directory tree.
shutil.rmtree(src_dir, True)
shutil.rmtree(bld_dir, True)
os.makedirs(src_dir)
shutil.copytree(img_dir, os.path.join(bld_dir, 'images'))

# Message format.
text = rst.h1('Message Format')
files.append('Message Format.rst')

headerFooterSize = 0

# Field types.
text += rst.h2('Field types')
text += rst.block(root.find('types/description').text)
ttypes = rst.Table()
ttypes.add_row('Name', 'Size', 'Description')
for t in root.findall('types/type'):
    if 'size' in t.attrib:
        size = t.attrib['size'].strip()
    else:
        size = 'n/a'
    ttypes.add_row(t.attrib['name'], size, t.find('description').text)
text += str(ttypes)
open(os.path.join(src_dir, 'Message Format.rst'), 'w', encoding='utf-8').write(text)

# Serialization.
if root.find('serialization') is not None:
    text = rst.h2('Serialization')
    descElm = root.find('serialization/description')
Exemple #5
0
files = []

# Prepare directory tree.
shutil.rmtree(src_dir, True)
shutil.rmtree(bld_dir, True)
os.makedirs(src_dir)
shutil.copytree(img_dir, os.path.join(bld_dir, 'images'))

# Message format.
text = rst.h1('Message Format')
files.append('Message Format.rst')

# Field types.
text += rst.h2('Field types')
text += rst.block(root.find('types/description').text)
ttypes = rst.Table()
ttypes.add_row('Name', 'Size', 'Description')
for t in root.findall('types/type'):
    if 'size' in t.attrib:
        size = t.attrib['size'].strip()
    else:
        size = 'n/a'
    ttypes.add_row(t.attrib['name'], size, t.find('description').text)
text += str(ttypes)
open(os.path.join(src_dir, 'Message Format.rst'), 'w').write(text)

# Serialization.
text = rst.h2('Serialization')
text += rst.block(root.find('serialization/description').text)
ttypes = rst.Table()
Exemple #6
0
# Prepare directory tree.
shutil.rmtree(src_dir, True)
shutil.rmtree(bld_dir, True)
os.makedirs(src_dir)
shutil.copytree(img_dir, os.path.join(bld_dir, 'images'))

# Message format.
text = rst.h1('Message Format')
files.append('Message Format.rst')

headerFooterSize = 0

# Field types.
text += rst.h2('Field types')
text += rst.block(root.find('types/description').text)
ttypes = rst.Table()
ttypes.add_row('Name', 'Size', 'Description')
for t in root.findall('types/type'):
    if 'size' in t.attrib:
        size = t.attrib['size'].strip()
    else:
        size = 'n/a'
    ttypes.add_row(t.attrib['name'], size, t.find('description').text)
text += str(ttypes)
open(os.path.join(src_dir, 'Message Format.rst'), 'w',
     encoding='utf-8').write(text)

# Serialization.
if root.find('serialization') is not None:
    text = rst.h2('Serialization')
Exemple #7
0
files = []

# Prepare directory tree.
shutil.rmtree(src_dir, True)
shutil.rmtree(bld_dir, True)
os.makedirs(src_dir)
shutil.copytree(img_dir, os.path.join(bld_dir, "images"))

# Message format.
text = rst.h1("Message Format")
files.append("Message Format.rst")

# Field types.
text += rst.h2("Field types")
text += rst.block(root.find("types/description").text)
ttypes = rst.Table()
ttypes.add_row("Name", "Size", "Description")
for t in root.findall("types/type"):
    if "size" in t.attrib:
        size = t.attrib["size"].strip()
    else:
        size = "n/a"
    ttypes.add_row(t.attrib["name"], size, t.find("description").text)
text += str(ttypes)
open(os.path.join(src_dir, "Message Format.rst"), "w").write(text)

# Serialization.
text = rst.h2("Serialization")
text += rst.block(root.find("serialization/description").text)
ttypes = rst.Table()