Example #1
0
    def __init__(self, input_file, output_file):
        self.input_file = input_file
        self.output_file = output_file
        self.descr = parse_file(input_file)
        self.out=open(output_file, 'w')
        self.ParamTable = {
            "2dbounds" : lambda i : self.create_vint_param(i), 
            "3dbounds" : lambda i : self.create_vint_param(i), 
            "vshort":    lambda i : self.create_vint_param(i), 
            "vint":      lambda i : self.create_vint_param(i), 
            "vlong":     lambda i : self.create_vint_param(i), 
            "vushort":   lambda i : self.create_vint_param(i), 
            "vuint":     lambda i : self.create_vint_param(i), 
            "vulong":    lambda i : self.create_vint_param(i), 

            "2dfvector" :lambda i : self.create_vfloat_param(i), 
            "3dfvector" :lambda i : self.create_vfloat_param(i), 
            "vdouble"   :lambda i : self.create_vfloat_param(i), 
            "vfloat"    :lambda i : self.create_vfloat_param(i), 

            "bool"  : lambda i : self.create_Bool_param(i),
            
            "short" : lambda i : self.create_Integral_param(i), 
            "int"   : lambda i : self.create_Integral_param(i), 
            "long"  : lambda i : self.create_Integral_param(i),
            "ushort": lambda i : self.create_Integral_param(i), 
            "uint"  : lambda i : self.create_Integral_param(i), 
            "ulong" : lambda i : self.create_Integral_param(i),
            
            "int16_t" : lambda i : self.create_Integral_param(i), 
            "int32_t"   : lambda i : self.create_Integral_param(i), 
            "int64_t"  : lambda i : self.create_Integral_param(i),
            "uint16_t": lambda i : self.create_Integral_param(i), 
            "uint32_t"  : lambda i : self.create_Integral_param(i), 
            "uint64_t" : lambda i : self.create_Integral_param(i), 
            "float" : lambda i : self.create_Float_param(i), 
            "double": lambda i : self.create_Float_param(i), 

            "vstring": lambda i : self.create_input_VString_param(i), 

            "dict"  : lambda i : self.create_Dict_param(i), 
            "set"  : lambda i : self.create_Set_param(i), 
            "factory" : lambda i : self.create_Factory_param(i)
        }
Example #2
0
 def __init__(self, input_file, output_file):
     self.input_file = input_file
     self.output_file = output_file
     self.descr = parse_file(input_file)
     self.out = open(output_file, 'w')
     self.ParamTable = {
         "2dbounds": lambda i: self.create_vint_param(i),
         "3dbounds": lambda i: self.create_vint_param(i),
         "vshort": lambda i: self.create_vint_param(i),
         "vint": lambda i: self.create_vint_param(i),
         "vlong": lambda i: self.create_vint_param(i),
         "vushort": lambda i: self.create_vint_param(i),
         "vuint": lambda i: self.create_vint_param(i),
         "vulong": lambda i: self.create_vint_param(i),
         "2dfvector": lambda i: self.create_vfloat_param(i),
         "3dfvector": lambda i: self.create_vfloat_param(i),
         "vdouble": lambda i: self.create_vfloat_param(i),
         "vfloat": lambda i: self.create_vfloat_param(i),
         "bool": lambda i: self.create_Bool_param(i),
         "short": lambda i: self.create_Integral_param(i),
         "int": lambda i: self.create_Integral_param(i),
         "long": lambda i: self.create_Integral_param(i),
         "ushort": lambda i: self.create_Integral_param(i),
         "uint": lambda i: self.create_Integral_param(i),
         "ulong": lambda i: self.create_Integral_param(i),
         "int16_t": lambda i: self.create_Integral_param(i),
         "int32_t": lambda i: self.create_Integral_param(i),
         "int64_t": lambda i: self.create_Integral_param(i),
         "uint16_t": lambda i: self.create_Integral_param(i),
         "uint32_t": lambda i: self.create_Integral_param(i),
         "uint64_t": lambda i: self.create_Integral_param(i),
         "float": lambda i: self.create_Float_param(i),
         "double": lambda i: self.create_Float_param(i),
         "vstring": lambda i: self.create_input_VString_param(i),
         "dict": lambda i: self.create_Dict_param(i),
         "set": lambda i: self.create_Set_param(i),
         "factory": lambda i: self.create_Factory_param(i)
     }
Example #3
0
            if p.supported_types is not None:
                print(".RS 14")
                print("Supported element types: ")
                print(".RS 2")
                print(p.supported_types)
                print(".RE")
                print(" ")
                print(".RE")

    if descr.Example.text is not None and len(descr.Example.text) > 0:
        print(".SH EXAMPLE")
        print(clean(descr.Example.text))
        for c in descr.Example.code:
            print(".HP")
            print("{} {}".format(name, clean(c.text)))

    print(".SH AUTHOR(s)")
    print(clean(descr.author))

    print(".SH COPYRIGHT")
    print(
        """This software is Copyright (c) 1999\(hy2015 Leipzig, Germany and Madrid, Spain.
It comes  with  ABSOLUTELY  NO WARRANTY  and  you  may redistribute it under the terms of the GNU 
GENERAL PUBLIC LICENSE Version 3 (or later). For more 
information run the program with the option '\-\-copyright'.""")


X = parse_file(sys.argv[1])
write_man_file(X)
Example #4
0
            if p.supported_types is not None:
                print(".RS 14")
                print("Supported element types: ")
                print(".RS 2")
                print(p.supported_types)
                print(".RE")
                print(" ")
                print(".RE")


    if descr.Example.text is not None and len(descr.Example.text) > 0:
            print(".SH EXAMPLE")
            print(clean(descr.Example.text))
            for c in descr.Example.code:
                print(".HP")
                print("{} {}".format (name, clean(c.text)))

    print(".SH AUTHOR(s)")
    print(clean(descr.author))
    
    print(".SH COPYRIGHT")
    print("""This software is Copyright (c) 1999\(hy2015 Leipzig, Germany and Madrid, Spain.
It comes  with  ABSOLUTELY  NO WARRANTY  and  you  may redistribute it under the terms of the GNU 
GENERAL PUBLIC LICENSE Version 3 (or later). For more 
information run the program with the option '\-\-copyright'.""")


X=parse_file(sys.argv[1])
write_man_file(X)
Example #5
0
        program_sections[section.name] = section
        index = index + 1
    return program_sections


rootpath = sys.argv[1]
outpath = sys.argv[2]
#
# read all xml files created by the command line tools
#
files = find_files(outpath, "mia-*.xml")
descriptions = []

for f in files:
    try:
        d = parse_file(f)
        descriptions.append(d)
    except ValueError as e:
        print(e)

#
# Read the program section description, this also provides the general structure
# of the program reference
#
program_sections = read_section_file(rootpath + "/sections.xml")
index = len(program_sections)

#
# Sort the programs into the sections and read the plug-in types
#
plugin_types = {}
Example #6
0
        program_sections[section.name] = section
        index = index+1
    return program_sections
    

rootpath = sys.argv[1]
outpath = sys.argv[2]
#
# read all xml files created by the command line tools 
#
files = find_files(outpath, "mia-*.xml")
descriptions=[]

for f in files:
    try:
        d = parse_file(f)
        descriptions.append(d)
    except ValueError as e:
        print (e)


#
# Read the program section description, this also provides the general structure  
# of the program reference
#
program_sections = read_section_file(rootpath + "/sections.xml")
index = len(program_sections)

#
# Sort the programs into the sections and read the plug-in types 
#