mirror of
https://github.com/facefusion/facefusion.git
synced 2026-05-13 10:44:47 +02:00
666c15f9da
* Remove old files * Fix some spacing * Introduce retry to download * More testing * Better installer scripting (#994) * Better installer scripting * Add migraphx installer support * Add migraphx installer support * Ignore issue * Ignore issue * Make --force-install optional
33 lines
854 B
Python
33 lines
854 B
Python
import itertools
|
|
import shutil
|
|
from typing import List
|
|
|
|
from facefusion import metadata
|
|
from facefusion.types import Command
|
|
|
|
|
|
def run(commands : List[Command]) -> List[Command]:
|
|
user_agent = metadata.get('name') + '/' + metadata.get('version')
|
|
|
|
return [ shutil.which('curl'), '--user-agent', user_agent, '--insecure', '--location', '--silent' ] + commands
|
|
|
|
|
|
def chain(*commands : List[Command]) -> List[Command]:
|
|
return list(itertools.chain(*commands))
|
|
|
|
|
|
def ping(url : str) -> List[Command]:
|
|
return [ '-I', url ]
|
|
|
|
|
|
def download(url : str, download_file_path : str) -> List[Command]:
|
|
return [ '--create-dirs', '--continue-at', '-', '--output', download_file_path, url ]
|
|
|
|
|
|
def set_timeout(timeout : int) -> List[Command]:
|
|
return [ '--connect-timeout', str(timeout) ]
|
|
|
|
|
|
def set_retry(retry : int) -> List[Command]:
|
|
return [ '--retry', str(retry) ]
|