🧑💻 Get window in backend
This commit is contained in:
parent
cfb0337c69
commit
fe36735f37
3 changed files with 8 additions and 26 deletions
|
@ -1,12 +1,10 @@
|
|||
from bottle import request, response, Bottle, static_file
|
||||
from manager import Manager
|
||||
from json import dumps
|
||||
from queue import SimpleQueue
|
||||
import webview
|
||||
|
||||
manager = Manager()
|
||||
app = Bottle()
|
||||
action_queue = SimpleQueue()
|
||||
path_queue = SimpleQueue()
|
||||
|
||||
|
||||
@app.get("/")
|
||||
|
@ -38,9 +36,9 @@ def download():
|
|||
return "OK"
|
||||
|
||||
|
||||
@app.post("/path")
|
||||
@app.get("/path")
|
||||
def get_path():
|
||||
path = request.json["path"]
|
||||
action_queue.put(path)
|
||||
manager.path = path_queue.get()
|
||||
result = webview.active_window().create_file_dialog(dialog_type=webview.FOLDER_DIALOG)
|
||||
if result:
|
||||
manager.path = result[0]
|
||||
return manager.path
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue