def set_file_list(dlg, obj, addObj, removeObj, files): # Clear existing items while (True): try: ldtp.selectrowindex(dlg, obj, 0) ldtp.click(dlg, removeObj) except: break # FIXME compiz and modal windows tend to not work with ldtp set_settings_value('include-list' if obj == 'tblIncludeList' else 'exclude-list', '[%s]' % ', '.join(["'%s'" % os.path.abspath(x) for x in files])) return # Add new items for f in files: ldtp.click(dlg, addObj) waitforgui('dlgChoosefolders') # Make sure path ends in '/' if f[-1] != '/': f += '/' ldtp.selectlastrow('dlgChoosefolders', 'tblPlaces') # must switch away from Recent Files view to get txtLocation ldtp.wait(1) ldtp.settextvalue('dlgChoosefolders', 'txtLocation', f) ldtp.click('dlgChoosefolders', 'btnOpen') ldtp.wait(1) # let dialog close
def restore_simple(path, date=None, backend = None, encrypt=True, dest = None): start_deja_dup(executable='deja-dup-preferences') if guivisible('frmBackup', 'btnIwanttorestorefilesfromapreviousbackup…'): ldtp.click('frmBackup', 'btnIwanttorestorefilesfromapreviousbackup…') else: ldtp.selecttab('frmBackup', 'ptlCategories', 'Overview') ldtp.click('frmBackup', 'btnRestore…') waitforgui('frmRestore') if backend is not None: walk_restore_prefs('frmRestore', backend, dest) ldtp.click('frmRestore', 'btnForward') wait_for_finish('frmRestore', 'lblRestoreFromWhen?', 200) if date: ldtp.comboselect('frmRestore', 'cboDate', date) ldtp.click('frmRestore', 'btnForward') ldtp.click('frmRestore', 'rbtnRestoretospecificfolder') ldtp.comboselect('frmRestore', 'cboRestorefolder', 'Other...') waitforgui('dlgChoosedestinationforrestoredfiles') # Make sure path ends in '/' if path[-1] != '/': path += '/' ldtp.selectlastrow('dlgChoosedestinationforrestoredfiles', 'tblPlaces') # must switch away from Recent Files view to get txtLocation ldtp.wait(1) # give the dlg a second to settle ldtp.settextvalue('dlgChoosedestinationforrestoredfiles', 'txtLocation', path) ldtp.click('dlgChoosedestinationforrestoredfiles', 'btnOpen') ldtp.wait(1) # give the combo a second to settle ldtp.click('frmRestore', 'btnForward') ldtp.wait(1) # give the dlg a second to settle ldtp.click('frmRestore', 'btnRestore') if encrypt is not None: wait_for_encryption('frmRestore', encrypt) wait_for_finish('frmRestore', 'lblYourfilesweresuccessfullyrestored', 400) ldtp.click('frmRestore', 'btnClose') ldtp.waittillguinotexist('frmRestore')
def select_last_row(self, window_name, object_name): """ Select last row @param window_name: Window name to type in, either full name, LDTP's name convention, or a Unix glob. @type window_name: string @param object_name: Object name to type in, either full name, LDTP's name convention, or a Unix glob. @type object_name: string @return: 1 on success. @rtype: integer """ try: self._info("select last row of (%s, %s)" % (window_name, object_name)) return ldtp.selectlastrow(window_name, object_name) except LdtpExecutionError as e: raise LdtpExecutionError(str(e))
def select_last_row(self, window_name, object_name): """ Select last row @param window_name: Window name to type in, either full name, LDTP's name convention, or a Unix glob. @type window_name: string @param object_name: Object name to type in, either full name, LDTP's name convention, or a Unix glob. @type object_name: string @return: 1 on success. @rtype: integer """ try: self._info("select last row of (%s, %s)" % (window_name, object_name)) return ldtp.selectlastrow(window_name, object_name) except LdtpExecutionError as e: raise LdtpExecutionError(e.message)
def select_org_and_register(self): self.check_window_exist("register-dialog") ldtp.selectlastrow('register-dialog', 'orgs-view-table') logger.info("select ACME_Corporation org") self.click_button('register-dialog', 'dialog-register-button') logger.info("It's successful register, please check /etc/pki/consumer")