-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
analysis/build: Add assistant plugin
The user can specify an assistant directory with some python code in which is called in a container with the app directory mounted. This assistant script can generate or modify code in the app directory before it is further analysed and ran.
- Loading branch information
Showing
10 changed files
with
109 additions
and
8 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import os | ||
|
||
file_path = '/app/__main__.py' | ||
file_content = """from flask import Flask | ||
app = Flask(__name__) | ||
@app.route('/') | ||
def hello_world(): | ||
return 'Hello, World!' | ||
if __name__ == '__main__': | ||
app.run(debug=True, host="0.0.0.0") | ||
""" | ||
|
||
os.makedirs(os.path.dirname(file_path), exist_ok=True) | ||
|
||
with open(file_path, 'w') as file: | ||
file.write(file_content) | ||
|
||
print(f"File written to {file_path}") |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters