コード例 #1
0
class ImageConverter():

    def __init__(self):
        self.plant = PlantUML(url='http://www.plantuml.com/plantuml/img/')

    def produce_image_b(self):
        self.plant.processes_file("uml.txt")
コード例 #2
0
def create_pic(filename: str) -> None:
    server = PlantUML(url='http://www.plantuml.com/plantuml/img/',
                      basic_auth={},
                      form_auth={},
                      http_opts={},
                      request_opts={})

    # Send and compile your diagram files to/with the PlantUML server
    server.processes_file(abspath(f'./{filename}'))
コード例 #3
0
ファイル: puml.py プロジェクト: fretboardfreak/gridrealm
def main():
    """Compile the input files into UML images."""
    args = parse_cmd_line()
    dprint(args)
    outfile = '.'.join(args.input.name.split('.')[:-1] + [args.suffix])
    vprint('Parsing "%s" to "%s"' % (args.input.name, outfile))
    puml = PlantUML()
    return puml.processes_file(args.input.name, outfile=outfile)
コード例 #4
0
    def generate(input_uml):
        plant_uml = PlantUML(url='http://www.plantuml.com/plantuml/img/')
        PlantUMLProcessor.dump_to_file(input_uml,
                                       PlantUMLProcessor.uml_dump_file)
        print("Successfully generated Plant UML notation and saved it in " +
              PlantUMLProcessor.uml_dump_file)

        PlantUMLProcessor.remove_file(PlantUMLProcessor.diagram_image_file)
        PlantUMLProcessor.remove_file(PlantUMLProcessor.error_file)

        plant_uml.processes_file(PlantUMLProcessor.uml_dump_file,
                                 PlantUMLProcessor.diagram_image_file,
                                 PlantUMLProcessor.error_file)

        if not os.path.isfile(PlantUMLProcessor.error_file):
            print(
                "Class Generation has finished executing, a diagram.png was created"
            )
        else:
            print("An error occurred, please check " +
                  PlantUMLProcessor.error_file +
                  " for any errors regarding the Plant UML diagram generation")
コード例 #5
0
 def generate(path):
     server = PlantUML(url='http://www.plantuml.com/plantuml/img/',
                       basic_auth={},
                       form_auth={},
                       http_opts={},
                       request_opts={})
     try:
         if server.processes_file(abspath('./rawUml.txt'), path,
                                  abspath('./output/error/error.txt')):
             print('Done, View your diagram in ' + path)
     except PermissionError:
         print('Permission Error occurred')
     except Exception as e:
         print(e)
コード例 #6
0
ファイル: __init__.py プロジェクト: gsanou/ontogram
 def svg_file(filename):
     """Write the ontology diagram to file as SVG."""
     p = PlantUML(url='http://www.plantuml.com/plantuml/svg/')
     p.processes_file(filename, outfile=filename + '.svg')