Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Set a specific video mode
- def changeMode(videomode):
- if checkModeExists(videomode):
- cmd = ["batocera-resolution", "setMode", videomode]
- max_tries = 2 # maximum number of tries to set the mode
- for i in range(max_tries):
- try:
- result = subprocess.run(cmd, capture_output=True, text=True, check=True)
- eslog.debug(result.stdout.strip())
- return
- except subprocess.CalledProcessError as e:
- eslog.error(f"Error setting video mode: {e.stderr}")
- if i == max_tries - 1:
- raise
- time.sleep(1)
- def changeMode_cvt(videomode):
- if checkModeExists(videomode):
- cmd = ["batocera-resolution", "setMode_CVT", videomode]
- max_tries = 2 # maximum number of tries to set the mode
- for i in range(max_tries):
- try:
- result = subprocess.run(cmd, capture_output=True, text=True, check=True)
- eslog.debug(result.stdout.strip())
- return
- except subprocess.CalledProcessError as e:
- eslog.error(f"Error setting video mode: {e.stderr}")
- if i == max_tries - 1:
- raise
- time.sleep(1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement