mirror of
https://github.com/blw1138/Zordon.git
synced 2026-06-09 21:49:23 -05:00
Add Job Window Redesign (#128)
* Initial refactor of add_job_window * Improved project naming and fixed Blender engine issue * Improve time representation in main window * Cleanup Blender job creation * Send resolution / fps data in job submission * More window improvements * EngineManager renaming and refactoring * FFMPEG path fixes for ffprobe * More backend refactoring / improvements * Performance improvements / API refactoring * Show current job count in add window UI before submission * Move some UI update code out of background thread * Move some main window UI update code out of background thread
This commit is contained in:
+27
-10
@@ -247,16 +247,19 @@ class RenderServerProxy:
|
||||
# Engines:
|
||||
# --------------------------------------------
|
||||
|
||||
def is_engine_available(self, engine_name):
|
||||
return self.request_data(f'{engine_name}/is_available')
|
||||
def get_engine_for_filename(self, filename, timeout=5):
|
||||
response = self.request(f'engine_for_filename?filename={os.path.basename(filename)}', timeout)
|
||||
return response.text
|
||||
|
||||
def get_all_engines(self):
|
||||
# todo: this doesnt work
|
||||
return self.request_data('all_engines')
|
||||
def get_installed_engines(self, timeout=5):
|
||||
return self.request_data(f'installed_engines', timeout)
|
||||
|
||||
def get_engine_info(self, response_type='standard', timeout=5):
|
||||
def is_engine_available(self, engine_name:str, timeout=5):
|
||||
return self.request_data(f'{engine_name}/is_available', timeout)
|
||||
|
||||
def get_all_engine_info(self, response_type='standard', timeout=5):
|
||||
"""
|
||||
Fetches engine information from the server.
|
||||
Fetches all engine information from the server.
|
||||
|
||||
Args:
|
||||
response_type (str, optional): Returns standard or full version of engine info
|
||||
@@ -268,19 +271,33 @@ class RenderServerProxy:
|
||||
all_data = self.request_data(f"engine_info?response_type={response_type}", timeout=timeout)
|
||||
return all_data
|
||||
|
||||
def delete_engine(self, engine, version, system_cpu=None):
|
||||
def get_engine_info(self, engine_name:str, response_type='standard', timeout=5):
|
||||
"""
|
||||
Fetches specific engine information from the server.
|
||||
|
||||
Args:
|
||||
engine_name (str): Name of the engine
|
||||
response_type (str, optional): Returns standard or full version of engine info
|
||||
timeout (int, optional): The number of seconds to wait for a response from the server. Defaults to 5.
|
||||
|
||||
Returns:
|
||||
dict: A dictionary containing the engine information.
|
||||
"""
|
||||
return self.request_data(f'{engine_name}/info?response_type={response_type}', timeout)
|
||||
|
||||
def delete_engine(self, engine_name:str, version:str, system_cpu=None):
|
||||
"""
|
||||
Sends a request to the server to delete a specific engine.
|
||||
|
||||
Args:
|
||||
engine (str): The name of the engine to delete.
|
||||
engine_name (str): The name of the engine to delete.
|
||||
version (str): The version of the engine to delete.
|
||||
system_cpu (str, optional): The system CPU type. Defaults to None.
|
||||
|
||||
Returns:
|
||||
Response: The response from the server.
|
||||
"""
|
||||
form_data = {'engine': engine, 'version': version, 'system_cpu': system_cpu}
|
||||
form_data = {'engine': engine_name, 'version': version, 'system_cpu': system_cpu}
|
||||
return requests.post(f'http://{self.hostname}:{self.port}/api/delete_engine', json=form_data)
|
||||
|
||||
# --------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user