CM SERVICE PROMPT Section 9.2.5a
325011
def cmServicePrompt():
    """"""
    a = TpPd(pd=0x5)
    b = MessageType(mesType=0x25)  # 00100101
    c = PdAndSapi()
    packet = a / b / c
    return packet
651235
public void onClickOk(CmsResource selected) {

        try {
            CmsResource target = selected;
            CmsResource source = m_context.getResources().get(0);
            CmsLocaleGroupService service = A_CmsUI.getCmsObject().getLocaleGroupService();
            service.attachLocaleGroupIndirect(source, target);
            m_context.finish(Arrays.asList(source.getStructureId()));
        } catch (CmsException e) {
            LOG.error(e.getLocalizedMessage(), e);
            m_context.error(e);
        }
    }
928148
def make_dynamic_prompt(self, prompt):
        """"""
        if prompt:
            self.prompt_re = self.driver.make_dynamic_prompt(prompt)
452921
def prompt(text, default=None, show_default=True, invisible=False,
           confirm=False, skip=False, type=None, input_function=None):
	'''
	'''
	t = determine_type(type, default)
	input_function = get_input_fn(input_function, invisible)
	if default is not None and show_default:
		text = '{} [{}]: '.format(text, default)
	while True:
		val = prompt_fn(input_function, text, default, t, skip, repeat=True)
		if not confirm or (skip and val is None):
			return val
		if val == prompt_fn(input_function, 'Confirm: ', default, t, repeat=True):
			return val
		echo('Error: The two values you entered do not match', True)
1190710
@Override
    protected boolean performDialogOperation() throws CmsException {

        // check if the current resource is a folder for single operation
        boolean isFolder = isOperationOnFolder();
        // on folder deletion or multi operation display "please wait" screen, not for simple file deletion
        if ((isMultiOperation() || isFolder) && !DIALOG_WAIT.equals(getParamAction())) {
            // return false, this will trigger the "please wait" screen
            return false;
        }

        // get the new release date for the resource(s) from request parameter
        long releaseDate = CmsResource.DATE_RELEASED_DEFAULT;
        boolean resetReleaseDate = Boolean.valueOf(getParamResetrelease()).booleanValue();
        boolean leaveReleaseDate = false;
        if (!resetReleaseDate) {
            try {
                if ((CmsStringUtil.isNotEmptyOrWhitespaceOnly(getParamReleasedate()))
                    && (!getParamReleasedate().startsWith(CmsTouch.DEFAULT_DATE_STRING))) {
                    releaseDate = CmsCalendarWidget.getCalendarDate(getMessages(), getParamReleasedate(), true);
                } else {
                    leaveReleaseDate = true;
                }
            } catch (ParseException e) {
                throw new CmsException(
                    Messages.get().container(Messages.ERR_PARSE_RELEASEDATE_1, getParamReleasedate()),
                    e);
            }
        }

        // get the new expire date for the resource(s) from request parameter
        long expireDate = CmsResource.DATE_EXPIRED_DEFAULT;
        boolean resetExpireDate = Boolean.valueOf(getParamResetexpire()).booleanValue();
        boolean leaveExpireDate = false;
        if (!resetExpireDate) {
            try {
                if ((CmsStringUtil.isNotEmptyOrWhitespaceOnly(getParamExpiredate()))
                    && (!getParamExpiredate().startsWith(CmsTouch.DEFAULT_DATE_STRING))) {
                    expireDate = CmsCalendarWidget.getCalendarDate(getMessages(), getParamExpiredate(), true);
                } else {
                    leaveExpireDate = true;
                }
            } catch (ParseException e) {
                throw new CmsException(
                    Messages.get().container(Messages.ERR_PARSE_EXPIREDATE_1, getParamExpiredate()),
                    e);
            }
        }

        // get the flag if the operation is recursive from request parameter
        boolean modifyRecursive = Boolean.valueOf(getParamRecursive()).booleanValue();

        // now iterate the resource(s)
        Iterator<String> i = getResourceList().iterator();
        while (i.hasNext()) {
            String resName = i.next();
            try {
                performSingleResourceAvailability(
                    resName,
                    releaseDate,
                    expireDate,
                    leaveReleaseDate,
                    leaveExpireDate,
                    modifyRecursive);
            } catch (CmsException e) {
                // collect exceptions to create a detailed output
                addMultiOperationException(e);
            }
        }

        boolean notificationEnabled = Boolean.valueOf(getParamEnablenotification()).booleanValue();
        int notificationInterval = 0;
        try {
            notificationInterval = Integer.parseInt(getParamNotificationinterval());
        } catch (Throwable e) {
            // ignore
        }

        // get the flag if the operation should be executed on resource siblings, too
        boolean modifySiblings = Boolean.valueOf(getParamModifysiblings()).booleanValue();

        // now iterate the resource(s)
        i = getResourceList().iterator();
        while (i.hasNext()) {
            String resName = i.next();
            try {
                performSingleResourceNotification(
                    getCms(),
                    resName,
                    notificationEnabled,
                    notificationInterval,
                    modifySiblings);
            } catch (CmsException e) {
                // collect exceptions to create a detailed output
                addMultiOperationException(e);
            }
        }
        checkMultiOperationException(Messages.get(), Messages.ERR_AVAILABILITY_MULTI_0);

        return true;
    }
782100
void onClickNew() {

        try {
            CmsObject cms = A_CmsUI.getCmsObject();

            CmsResource folderRes = cms.readResource(m_currentFolder, CmsResourceFilter.IGNORE_EXPIRATION);
            I_CmsDialogContext newDialogContext = getDialogContext();

            CmsNewDialog newDialog = new CmsNewDialog(folderRes, newDialogContext);
            newDialogContext.start(
                CmsVaadinUtils.getMessageText(org.opencms.ui.Messages.GUI_NEWRESOURCEDIALOG_TITLE_0),
                newDialog);

        } catch (Exception e) {
            LOG.error(e.getLocalizedMessage(), e);
        }
    }
388632
function askDeployNow() {
    if (this.abort) return null;
    const done = this.async();
    const prompts = [
        {
            type: 'confirm',
            name: 'deployNow',
            message: 'Would you like to deploy now?.',
            default: true
        }
    ];

    return this.prompt(prompts).then(props => {
        this.deployNow = props.deployNow;
        done();
    });
}
345866
def _pcap_service_control(action, askadmin=True):
    """"""
    command = action + ' ' + pcap_service_name()
    res, code = _exec_cmd(_encapsulate_admin(command) if askadmin else command)
    if code != 0:
        warning(res.decode("utf8", errors="ignore"))
    return (code == 0)
480384
def prompt(self):
        """"""
        if self.prompt_string is not None:
            return self.prompt_string

        if not self.color_enabled:
            return (' '.join(self.command) + '>> ').encode('utf8')

        color = '34'
        sub_color = '37'

        prompt_cmd = [
            self.colorize('1;' + color, part) if part != self.cmd_sub_str else
            self.colorize('0;' + sub_color, u'\u2026') for part in self.command
        ]

        return ' '.join(prompt_cmd) + self.colorize('0;' + color, '>> ')
1155319
function(){
		console.log("Unknown Response");

		if (_pathConfirmationCounter < 3){
			console.log("Please enter a 'Y' or an 'N' when answering.\n");
			_pathConfirmationCounter++;
			confirmDestination();
		} else {
			console.log("Unable to install at this time due to too many unknown responses.\n");
			_prompt.close();
		}
	}
542990
def help_cli_basic(self):
        
        help =  '%sWorkbench: Getting started...' % (color.Yellow)
        help += '\n%sLoad in a sample:'  % (color.Green)
        help += '\n\t%s> load_sample /path/to/file' % (color.LightBlue)
        help += '\n\n%sNotice the prompt now shows the md5 of the sample...'% (color.Yellow)
        help += '\n%sRun workers on the sample:'  % (color.Green)
        help += '\n\t%s> view' % (color.LightBlue)
        help += '\n%sType the \'help workers\' or the first part of the worker <tab>...'  % (color.Green)
        help += '\n\t%s> help workers (lists all possible workers)' % (color.LightBlue)
        help += '\n\t%s> pe_<tab> (will give you pe_classifier, pe_deep_sim, pe_features, pe_indicators, pe_peid)%s' % (color.LightBlue, color.Normal)
        return help
1045682
public void prepareUpdateStep5() {

        if (isInitialized()) {
            try {
                String fileName = getWebAppRfsPath() + FOLDER_UPDATE + "cmsupdate";
                // read the file
                FileInputStream fis = new FileInputStream(fileName + CmsConfigurationManager.POSTFIX_ORI);
                String script = "";
                int readChar = fis.read();
                while (readChar > -1) {
                    script += (char)readChar;
                    readChar = fis.read();
                }
                fis.close();
                // substitute macros
                script = CmsStringUtil.substitute(script, C_ADMIN_USER, getAdminUser());
                script = CmsStringUtil.substitute(script, C_ADMIN_PWD, getAdminPwd());
                script = CmsStringUtil.substitute(script, C_UPDATE_PROJECT, getUpdateProject());
                script = CmsStringUtil.substitute(script, C_UPDATE_SITE, getUpdateSite());
                script = CmsStringUtil.substitute(script, C_ADMIN_GROUP, getAdminGroup());
                // write the new script
                FileOutputStream fos = new FileOutputStream(fileName + ".txt");
                fos.write(script.getBytes());
                fos.close();
            } catch (IOException e) {
                e.printStackTrace();
                throw new RuntimeException(e);
            }
        }
    }
587235
def prompt(*args, **kwargs):
    """"""
    try:
        return click.prompt(*args, **kwargs)
    except click.Abort:
        return False
349710
public function cmdUpdateRole()
    {
        $params = $this->getParam();

        if (empty($params[0]) || count($params) < 2) {
            $this->errorAndExit($this->text('Invalid command'));
        }

        if (!is_numeric($params[0])) {
            $this->errorAndExit($this->text('Invalid argument'));
        }

        $this->setSubmitted(null, $params);
        $this->setSubmittedList('permissions');
        $this->setSubmitted('update', $params[0]);

        $this->validateComponent('user_role');

        $this->updateRole($params[0]);
        $this->output();
    }
618521
private void promptForFiles() {
        DialogProperties properties = new DialogProperties();
        properties.selection_mode = DialogConfigs.MULTI_MODE;
        properties.selection_type = DialogConfigs.FILE_SELECT;
        properties.root = new File(DialogConfigs.DEFAULT_DIR);
        properties.error_dir = new File(DialogConfigs.DEFAULT_DIR);
        properties.offset = new File(DialogConfigs.DEFAULT_DIR);

        Set<String> registeredExtensions = ArchiveFileFactory.getRegisteredExtensions();
        //api check
        if (Build.VERSION.SDK_INT >= 14)
            registeredExtensions.add("gpkg");
        registeredExtensions.add("map");

        String[] ret = new String[registeredExtensions.size()];
        ret = registeredExtensions.toArray(ret);
        properties.extensions = ret;

        FilePickerDialog dialog = new FilePickerDialog(getContext(), properties);
        dialog.setTitle("Select a File");
        dialog.setDialogSelectionListener(new DialogSelectionListener() {
            @Override
            public void onSelectedFilePaths(String[] files) {
                //files is the array of the paths of files selected by the Application User.
                setProviderConfig(files);
            }

        });
        dialog.show();
    }
515253
protected function maybe_prompt() {
		if ( ! $this->is_time() ) {
			return;
		}

		\add_action( 'admin_footer', array( $this, 'script' ) );
		if ( false !== $this->op['notice_callback'] ) {
			call_user_func_array( $this->op['notice_callback'], array( &$this ) );
		} else {
			\add_action( 'admin_notices', array( $this, 'add_notice' ) );
		}
	}
622155
def prompt(msg, default=NO_DEFAULT, validate=None):
    
    while True:
        response = input(msg + " ").strip()
        if not response:
            if default is NO_DEFAULT:
                continue
            return default
        if validate is None or validate(response):
            return response