| 75 | |
| 76 | |
| 77 | def compile_project(abs_path:str): |
| 78 | # with Progress(transient=True) as progress: |
| 79 | # task = progress.add_task("Compiling", total=None, start=False) |
| 80 | # data = { |
| 81 | # "version": "0.0.1", |
| 82 | # "user": { |
| 83 | # "project": { |
| 84 | # "workspace": f"{abs_path}" |
| 85 | # }, |
| 86 | # "operation": ["detection", "dependency", "compile"], |
| 87 | # "output_format": ["standard", "compatible-ast"], |
| 88 | # "output_path": f"{os.path.join(abs_path, 'ast')}" |
| 89 | # } |
| 90 | # } |
| 91 | # json.dump(data, open(os.path.join(abs_path, 'parse-config.json'), "w")) |
| 92 | # output = subprocess.check_output(['mt-parsing', 'parse-config.json'], cwd=os.path.abspath(abs_path)) |
| 93 | # if len(os.listdir(os.path.join(abs_path, "ast", "standard"))) > 0: |
| 94 | # return True |
| 95 | # else: |
| 96 | # logger.error(output) |
| 97 | # return False |
| 98 | if os.path.isfile(abs_path): |
| 99 | return falcon.Falcon(abs_path) |
| 100 | files = os.listdir(abs_path) |
| 101 | files = list(filter(lambda x: x.endswith(".sol") and os.path.isfile(os.path.join(abs_path,x)), files)) |
| 102 | if len(files) == 1: |
| 103 | return falcon.Falcon(os.path.join(abs_path, files[0])) |
| 104 | return falcon.Falcon(abs_path) |
| 105 | |
| 106 | |
| 107 | def simple_cli(): |