def queue_render(presetname, queue_source_folder): """ Add a render job to the queue. :param presetname: the render preset to use for this job :param queue_source_folder: the source folder name for this job, will be added to queue_path, for the xml copy function :return: none """ global pending_queue global queue_paths proj.LoadRenderPreset(presetname) if int(valid_video_track_count(proj.GetCurrentTimeline())) != 0: set_output_path() proj.AddRenderJob() new_job_idx = get_newest_renderjob_index() if new_job_idx: pending_queue.append(new_job_idx) # There is already a render_status table for showing job info on the GUI. # This queue_path dictionary is added later, to correspond each job index to its source and output paths. # Maybe can use a better data structure to manage both? queue_paths.update({new_job_idx: [values['WATCHPATH'], queue_source_folder, latest_output_path]}) update_render_status() else: sg.Popup('Failed to add render job, check Resolve.') else: sg.Popup('Failed to add render job, empty folder?')
def set_output_path(): """ Get the latest output path from the GUI and submit to Resolve. :return: none """ global latest_output_path latest_output_path = values['OUTPUTPATH'] if proj.IsRenderingInProgress(): sg.Popup('Rendering in progres,try later.') else: proj.SetRenderSettings({'TargetDir': latest_output_path})
| |_) / _ \| '_ \| | | | '_ \ | __/ (_) | |_) | |_| | |_) | |_| \___/| .__/ \__,_| .__/ |_| |_| A Popup demonstration. A "Popup" window is shown over the main window. Clicking OK will close the Popup and you return to main again. """ print('Starting up...') layout = [[ sg.Text('Your typed chars appear here:'), sg.Text('', key='_OUTPUT_') ], [sg.Input(do_not_clear=True, key='_IN_')], [sg.Button('Show'), sg.Button('Exit'), sg.Button('Blank')]] window = sg.Window('Window Title').Layout(layout) while True: # Event Loop print('in event loop') event, values = window.Read() print(event, values) if event is None or event == 'Exit': break if event == 'Show': sg.Popup('A popup!', ' You typed ', values['_IN_']) window.Close()
if os.path.exists(values['WATCHPATH']): refresh_folders(values['WATCHPATH']) if event == 'REFRESHOUTPUT': print('REFRESHOUTPUT event!') if os.path.exists(values['OUTPUTPATH']): refresh_outputfolder(values['OUTPUTPATH']) if event == 'REFRESHPR': refresh_presets() if event == 'QUEUE': if not resolve: print('lost connection with Resolve API') elif not values['SOURCEPATHS']: sg.Popup('Please select a source folder.', title='Select Source') elif not values['RENDERPRESET']: sg.Popup('Please select a render preset.(Create in Resolve render page first.)', title='Select Preset') else: # try: proj.IsRenderingInProgress() except TypeError: proj = pm.CreateProject(f"{datetime.datetime.now():%Y%m%d_%H%M%S_}" + 'Transcode') mp = proj.GetMediaPool() # Above is needed to check if 'proj' is accessible, before checking rendering is in progress, # otherwise Resolve will raise an error if proj.IsRenderingInProgress(): sg.Popup('Resolve still rendering, go grab a coffee.') else:
[sg.Text('Hasło: '), sg.InputText(key='haslo')], [sg.Button('Zaloguj się'), sg.Button('Załóż konto')]] window = sg.Window('Reservoir').Layout(logowanie) while True: event, values = window.read() if event == 'Zaloguj się': com = 'SELECT Login, Haslo, RolaId_roli FROM Uzytkownik WHERE (Login="******" AND Haslo="{}");'.format( values['login'], values['haslo']) login = values['login'] konto = executeSQLcommand(db, com) if len(konto) == 0: sg.Popup('Nieprawidłowe dane!') else: if konto[0][2] == 1: m_klient = [[ sg.Text('Witaj w Reservoir - module obsługi klientów!') ], [sg.Button('Dokonaj rezerwacji')], [sg.Button('Wyloguj się')]] klient = sg.Window('Moduł klienta').Layout(m_klient) while True: event, values = klient.read() if event == 'Dokonaj rezerwacji': terminy = [ [ sg.Text('Data rezerwacji: '), sg.InputText(key='data') ],