Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def update_switchres_ini(range, inifile=''):
- if not inifile:
- logging.error("No INI file specified.")
- sys.exit(1)
- logging.info("Updating {} with crt_range {}".format(inifile, str(range)))
- # Check if the INI file exists
- if not os.path.exists(inifile):
- logging.error("INI file {} not found.".format(inifile))
- sys.exit(1)
- # Load the existing configuration from the INI file
- config = configparser.ConfigParser()
- config.read(inifile)
- # Update the CRT range section with the new values
- if 'crt_range' not in config:
- config['crt_range'] = {}
- config['crt_range']['HfreqMin'] = str(range.HfreqMin)
- config['crt_range']['HfreqMax'] = str(range.HfreqMax)
- config['crt_range']['VfreqMin'] = str(range.VfreqMin)
- config['crt_range']['VfreqMax'] = str(range.VfreqMax)
- config['crt_range']['HFrontPorch'] = str(range.HFrontPorch)
- config['crt_range']['HSyncPulse'] = str(range.HSyncPulse)
- config['crt_range']['HBackPorch'] = str(range.HBackPorch)
- config['crt_range']['VFrontPorch'] = str(range.VFrontPorch)
- config['crt_range']['VSyncPulse'] = str(range.VSyncPulse)
- config['crt_range']['VBackPorch'] = str(range.VBackPorch)
- config['crt_range']['HSyncPol'] = str(range.HSyncPol)
- config['crt_range']['VSyncPol'] = str(range.VSyncPol)
- config['crt_range']['ProgressiveLinesMin'] = str(range.ProgressiveLinesMin)
- config['crt_range']['ProgressiveLinesMax'] = str(range.ProgressiveLinesMax)
- config['crt_range']['InterlacedLinesMin'] = str(range.InterlacedLinesMin)
- config['crt_range']['InterlacedLinesMax'] = str(range.InterlacedLinesMax)
- # Write the updated configuration back to the INI file
- with open(inifile, 'w') as configfile:
- config.write(configfile)
- logging.info("INI file updated successfully.")
- # Example usage:
- # range = crt_range(HfreqMin=0.0, HfreqMax=100.0, VfreqMin=0.0, VfreqMax=100.0, HFrontPorch=0.0, HSyncPulse=0.0, HBackPorch=0.0, VFrontPorch=0.0, VSyncPulse=0.0, VBackPorch=0.0, HSyncPol=0, VSyncPol=0, ProgressiveLinesMin=0, ProgressiveLinesMax=0, InterlacedLinesMin=0, InterlacedLinesMax=0)
- # update_switchres_ini(range, 'switchres.ini')
Advertisement
Comments
-
- <div style="display:none">
- <a href="http://ftp.threeten.org/danatoto/">http://ftp.threeten.org/danatoto/</a>
- <a href="http://ftp.graded-reader.org/danatoto/">http://ftp.graded-reader.org/danatoto/</a>
- <a href="http://ftp.threeten.org/pay4d/">http://ftp.threeten.org/pay4d/</a>
- <a href="http://ftp.threeten.org/depo10k/">http://ftp.threeten.org/depo10k/</a>
- <a href="http://ftp.threeten.org/depo25/">http://ftp.threeten.org/depo25/</a>
- <a href="http://ftp.superherojs.com/">http://ftp.superherojs.com/
- <a href="https://shop.hobbymatehobby.com/">https://shop.hobbymatehobby.com/
- <a href="https://shop.hobbymatehobby.com/products/dana-toto-situs-toto-slot-deposit-5000-dengan-slot-depo-5k-mudah-diraih-di-slot-togel/">https://shop.hobbymatehobby.com/products/dana-toto-situs-toto-slot-deposit-5000-dengan-slot-depo-5k-mudah-diraih-di-slot-togel/</a>
- <a href="https://shop.hobbymatehobby.com/products/pay4d-situs-slot-gacor-4d-dengan-kemenangan-slot-gacor-777-maxwin-di-slot-thailand-teraih/">https://shop.hobbymatehobby.com/products/pay4d-situs-slot-gacor-4d-dengan-kemenangan-slot-gacor-777-maxwin-di-slot-thailand-teraih/</a>
- <a href="https://shop.hobbymatehobby.com/products/slot-bonus-situs-slot-depo-25-bonus-25-dengan-to-3x-5x-7x-dijamin-maxwin-saat-bermain-di-slot-thailand/">https://shop.hobbymatehobby.com/products/slot-bonus-situs-slot-depo-25-bonus-25-dengan-to-3x-5x-7x-dijamin-maxwin-saat-bermain-di-slot-thailand/</a>
- <a href="https://shop.hobbymatehobby.com/products/slot-depo-10k-situs-slot-gacor-terbaru-dengan-modal-depo-10k-maxwin-mudah-didapatkan/">https://shop.hobbymatehobby.com/products/slot-depo-10k-situs-slot-gacor-terbaru-dengan-modal-depo-10k-maxwin-mudah-didapatkan/</a>
- </div>
Add Comment
Please, Sign In to add comment
Advertisement