Shortcut function for running the previewing command.
351999
def gpp(argv=None):
    """"""
    if argv is None:
        argv = sys.argv[1:]
    argv.insert(0, 'preview')
    return main(argv)
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, '>> ')
97868
def OnPrintPreview(self, event):
        """"""

        print_area = self._get_print_area()
        print_data = self.main_window.print_data

        self.main_window.actions.print_preview(print_area, print_data)
107501
def execute(self, cmd):
        """"""
        if not cmd.filePath in self._history.keys():
            self._history[cmd.filePath] = SubtitleUndoStack(self)
            try:
                self._history[cmd.filePath].push(cmd)
            except:
                self._history[cmd.filePath].deleteLater()
                del self._history[cmd.filePath]
                raise
            else:
                self._history[cmd.filePath].clear()
        else:
            self._history[cmd.filePath].push(cmd)
75339
private static String generateCaption(CmsPreviewInfo previewInfo) {

        return (CmsStringUtil.isNotEmptyOrWhitespaceOnly(previewInfo.getTitle()) ? previewInfo.getTitle() + " / " : "")
            + previewInfo.getSitePath();
    }
1245364
function preview(name, content) {
  console.log('=======');
  console.log('JSON SCHEMA PREVIEW BEGIN: ' + name);
  console.log('=======');
  console.log(JSON.stringify(content, null, 2));
  console.log('=======');
  console.log('JSON SCHEMA PREVIEW END: ' + name);
  return Promise.resolve();
}
171352
def do_shortcuts(self, _: argparse.Namespace) -> None:
        """"""
        result = "\n".join('%s: %s' % (sc[0], sc[1]) for sc in sorted(self.shortcuts))
        self.poutput("Shortcuts for other commands:\n{}\n".format(result))
748366
def preview(self):
        
        win_name = 'Camera'
        cv2.namedWindow(win_name, cv2.WINDOW_AUTOSIZE)
        cv2.moveWindow(win_name,20,20)
        self.open()
        while(self.isOpened()):
            cv2.imshow(win_name,self._stream.read()[1])
            if cv2.waitKey(25) & 0xFF == ord('q'):
                break
        cv2.waitKey()
        cv2.destroyAllWindows()
        cv2.waitKey()
297882
function _Overlay_showAndHideFast(showCommands, hideCommands) {
                    var count;
                    var command;
                    for (count = 0; count < showCommands.length; count++) {
                        command = showCommands[count];
                        if (command && command.style) {
                            command.style.visibility = "";
                            command.style.display = "";
                        }
                    }
                    for (count = 0; count < hideCommands.length; count++) {
                        command = hideCommands[count];
                        if (command && command.style) {
                            command.style.visibility = "hidden";
                            command.style.display = "none";
                        }
                    }

                    this._commandsUpdated();

                }
1240090
def Preview(self, title=None, event=None):
        
        if title is None:
            title = self.title
        if self.canvas is None:
            self.canvas = self.parent.canvas

        po1  = PrintoutWx(self.parent.canvas, title=title,
                          width=self.pwidth,   margin=self.pmargin)
        po2  = PrintoutWx(self.parent.canvas, title=title,
                          width=self.pwidth,   margin=self.pmargin)
        self.preview = wx.PrintPreview(po1, po2, self.printerData)

        if ((is_wxPhoenix and self.preview.IsOk()) or
            (not is_wxPhoenix and self.preview.Ok())):
            self.preview.SetZoom(85)
            frameInst= self.parent
            while not isinstance(frameInst, wx.Frame):
                frameInst= frameInst.GetParent()
            frame = wx.PreviewFrame(self.preview, frameInst, "Preview")
            frame.Initialize()
            frame.SetSize((850, 650))
            frame.Centre(wx.BOTH)
            frame.Show(True)
381090
def action_run_command(self):
        

        name = self.args['<name>']

        # get entry from DB
        self.db_query('''
            SELECT path,command FROM shortcuts WHERE name=?
            ''', (name,))

        row = self.db_fetch_one()

        if row is None:
            print_err('Shortcut "%s" does not exist.' % name)
            return

        path = row[0]
        cmd = row[1]

        # show message
        msg = colored('JumpRun shortcut', 'white', attrs=['bold']) + '\n' + \
            self.shortcut_str(path, cmd) + '\n'
        print(msg)

        # cd to the folder & run the command
        os.chdir(path)

        try:
            subprocess.call(cmd, shell=True)
        except KeyboardInterrupt:
            print('')  # newline
            return
864039
def run_commands(self):
        """"""
        more = 0
        prompt = sys.ps1
        for command in self.commands:
            try:
                prompt = sys.ps2 if more else sys.ps1
                try:
                    magictype(command, prompt_template=prompt, speed=self.speed)
                except EOFError:
                    self.write("\n")
                    break
                else:
                    if command.strip() == "exit()":
                        return
                    more = self.push(command)
            except KeyboardInterrupt:
                self.write("\nKeyboardInterrupt\n")
                self.resetbuffer()
                more = 0
                sys.exit(1)
        echo_prompt(prompt)
        wait_for(RETURNS)
851498
def preview(self, obj, request=None):
        
        source = self.get_thumbnail_source(obj)
        if source:
            try:
                from easy_thumbnails.files import get_thumbnailer
            except ImportError:
                logger.warning(
                    _(
                        '`easy_thumbnails` is not installed and required for '
                        'icekit.admin_tools.mixins.ThumbnailAdminMixin'
                    )
                )
                return ''
            try:
                thumbnailer = get_thumbnailer(source)
                thumbnail = thumbnailer.get_thumbnail(self.thumbnail_options)
                return '<img class="thumbnail" src="{0}" />'.format(
                    thumbnail.url)
            except Exception as ex:
                logger.warning(
                    _(u'`easy_thumbnails` failed to generate a thumbnail image'
                      u' for {0}'.format(source)))
                if self.thumbnail_show_exceptions:
                    return 'Thumbnail exception: {0}'.format(ex)
        return ''
372426
def preview(self):
        """"""
        msg = self.ui.trackview.model().verify()
        if msg:
            answer = QtGui.QMessageBox.warning(self, "Bummer", 'Problem: {}.'.format(msg))
            return
        stim_signal, atten, ovld = self.ui.trackview.model().signal()
        fig = SpecWidget()
        fig.setWindowModality(2) # application modal
        fig.updateData(stim_signal, self.ui.trackview.model().samplerate())
        fig.setTitle('Stimulus Preview')
        fig.show()
        self.previewFig = fig
802049
def preview(num):
    """"""
    # Define problem_text before echoing in case problem does not exist
    problem_text = Problem(num).text
    click.secho("Project Euler Problem %i" % num, bold=True)
    click.echo(problem_text)
934054
def run (cmd, verbosity=0, **kwargs):
    """"""
    # Note that shell_quote_nt() result is not suitable for copy-paste
    # (especially on Unix systems), but it looks nicer than shell_quote().
    if verbosity >= 0:
        log_info("running %s" % " ".join(map(shell_quote_nt, cmd)))
    if kwargs:
        if verbosity >= 0:
            log_info("    with %s" % ", ".join("%s=%s" % (k, shell_quote(str(v)))\
                                           for k, v in kwargs.items()))
        if kwargs.get("shell"):
            # for shell calls the command must be a string
            cmd = " ".join(cmd)
    if verbosity < 1:
        # hide command output on stdout
        with open(os.devnull, 'wb') as devnull:
            kwargs['stdout'] = devnull
            res = subprocess.call(cmd, **kwargs)
    else:
        res = subprocess.call(cmd, **kwargs)
    return res
957693
function(ql) {
				var preview = ql.preview,
			mimes   = [],
			node,
			win  = ql.window,
			navi = ql.navbar;
			
		$.each(navigator.plugins, function(i, plugins) {
			$.each(plugins, function(i, plugin) {
				(plugin.type.indexOf('audio/') === 0 || plugin.type.indexOf('video/') === 0) && mimes.push(plugin.type);
			});
		});
		mimes = ql.fm.arrayFlip(mimes);
		
		preview.on(ql.evUpdate, function(e) {
			var file  = e.file,
				mime  = file.mime,
				video,
				setNavi = function() {
					navi.css('bottom', win.hasClass('elfinder-quicklook-fullscreen')? '50px' : '');
				};
			
			if (mimes[file.mime] && ql.dispInlineRegex.test(file.mime)) {
				e.stopImmediatePropagation();
				(video = mime.indexOf('video/') === 0) && ql.hideinfo();
				node = $('<embed src="'+ql.fm.openUrl(file.hash)+'" type="'+mime+'" class="elfinder-quicklook-preview-'+(video ? 'video' : 'audio')+'"/>')
					.appendTo(preview);
				
				win.on('viewchange.embed', setNavi);
				setNavi();
			}
		}).on('change', function() {
			if (node && node.parent().length) {
				win.off('viewchange.embed');
				node.remove();
				node= null;
			}
		});
		
	}