mirror of
https://github.com/KeksPirates/SoftwareManager.git
synced 2026-08-04 09:59:41 +02:00
refactor, improve config creation
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
from core.utils.data.state import state
|
||||
from .config import create_config
|
||||
import os
|
||||
import platform
|
||||
|
||||
def restart_aria2c():
|
||||
import main # had to do this because of circle import :(
|
||||
import signal
|
||||
import atexit
|
||||
main.kill_aria2server()
|
||||
state.aria2process.wait()
|
||||
state.aria2process = main.run_aria2server()
|
||||
signal.signal(signal.SIGINT, main.keyboardinterrupthandler)
|
||||
atexit.unregister(main.kill_aria2server)
|
||||
atexit.register(main.kill_aria2server)
|
||||
|
||||
def save_settings(thread_count, close, apiurl):
|
||||
|
||||
state.aria2_threads = thread_count
|
||||
state.api_url = apiurl
|
||||
|
||||
create_config()
|
||||
restart_aria2c()
|
||||
close()
|
||||
Reference in New Issue
Block a user