Set prompt so it displays the current working directory.
183639
def _set_prompt(self):
        """"""
        self.cwd = os.getcwd()
        self.prompt = Fore.CYAN + '{!r} $ '.format(self.cwd) + Fore.RESET
714198
def select_directory(self):
        """"""
        basedir = to_text_string(self.wd_edit.text())
        if not osp.isdir(basedir):
            basedir = getcwd_or_home()
        directory = getexistingdirectory(self, _(""), basedir)
        if directory:
            self.wd_edit.setText(directory)
            self.dir = directory
719775
def do_cd(self, path = '/'):
        """"""
        path = path[0]

        if path == "..":
            self.current_path = "/".join(self.current_path[:-1].split("/")[0:-1]) + '/'
        elif path == '/':
            self.current_path = "/"
        else:
            if path[-1] == '/':
                self.current_path += path
            else:
                self.current_path += path + '/'

        resp = self.n.getList(self.current_path, type=3)

        if resp:
            self.dirs = []
            self.files = []

            for f in resp:
                name = f['href'].encode('utf-8')

                if name[-1] == '/':
                    self.dirs.append(os.path.basename(name[:-1]))
                else:
                    self.files.append(os.path.basename(name))

        self.prompt = "> %s@Ndrive:%s " %(self.id, self.current_path)
1233421
def get_src_or_dst_prompt(mode):
    
    _words = {"read": "from", "write": "to"}
    # print(os.getcwd())
    prompt = "Where would you like to {} your file(s) {}?\n" \
             "1. Desktop ({})\n" \
             "2. Downloads ({})\n" \
             "3. Current ({})\n" \
             "4. Browse".format(mode, _words[mode],
                                  os.path.expanduser('~/Desktop'),
                                    os.path.expanduser('~/Downloads'),
                                    os.getcwd())
    return prompt
452202
private void markOutputDirSuccessful(JobContext context)
  throws IOException {
    if (outputPath != null) {
      FileSystem fileSys = outputPath.getFileSystem(context.getConfiguration());
      if (fileSys.exists(outputPath)) {
        // create a file in the folder to mark it
        Path filePath = new Path(outputPath, SUCCEEDED_FILE_NAME);
        fileSys.create(filePath).close();
      }
    }
  }
110501
def _start(self):
        '''  '''
        self.start = time.time()
        self.result['start'] = str(datetime.datetime.now())
        if not self.pause_type == 'prompt':
            print "(^C-c = continue early, ^C-a = abort)"
105038
def _set_WorkingDir(self, path):
        
        self._curr_working_dir = path
        try:
            mkdir(self.WorkingDir)
        except OSError:
            # Directory already exists
            pass
64556
def mkdir_interactive(dirpath):
    
    from benchbuild.utils.cmd import mkdir
    if os.path.exists(dirpath):
        return

    response = ui.ask(
        "The directory {dirname} does not exist yet. "
        "Should I create it?".format(dirname=dirpath),
        default_answer=True,
        default_answer_str="yes")

    if response:
        mkdir("-p", dirpath)
        print("Created directory {0}.".format(dirpath))
974990
def setup_dir(self):
        """"""
        cd = self.opts.cd or self.config['crony'].get('directory')
        if cd:
            self.logger.debug(f'Adding cd to {cd}')
            self.cmd = f'cd {cd} && {self.cmd}'
787508
def work_dir(path):
    '''
    

    '''
    starting_directory = os.getcwd()
    try:
        os.chdir(path)
        yield
    finally:
        os.chdir(starting_directory)
660537
def set_up_dirs(proc_name, output_dir=None, work_dir=None, log_dir=None):
    
    output_dir = safe_mkdir(adjust_path(output_dir or join(os.getcwd(), proc_name)), 'output_dir')
    debug('Saving results into ' + output_dir)

    work_dir = safe_mkdir(work_dir or join(output_dir, 'work'), 'working directory')
    info('Using work directory ' + work_dir)

    log_fpath = set_up_log(log_dir or safe_mkdir(join(work_dir, 'log')), proc_name + '.log')

    return output_dir, work_dir, log_fpath
611006
def on_output_directory_chooser_clicked(self):
        """"""
        title = self.tr('Set the output directory for pdf report files')
        self.choose_directory(self.output_directory, title)
33700
def set_to_current(self, ):
        
        cur = self.get_current_file()
        if cur is not None:
            self.set_selection(cur)
        else:
            self.init_selection()
1360423
def for_prompt(cls, **kw):
        
        kw.setdefault('enable_abort_and_exit_bindings', True)
        kw.setdefault('enable_search', True)
        kw.setdefault('enable_auto_suggest_bindings', True)

        return cls(**kw)
630995
private static Prompt createPrompt(Resource<?> currentResource)
   {
      // [ currentdir]$
      if (OperatingSystemUtils.isWindows())
      {
         List<TerminalCharacter> prompt = new LinkedList<>();
         prompt.add(new TerminalCharacter('['));
         for (char c : currentResource.getName().toCharArray())
         {
            prompt.add(new TerminalCharacter(c));
         }
         prompt.add(new TerminalCharacter(']'));
         prompt.add(new TerminalCharacter('$'));
         prompt.add(new TerminalCharacter(' '));
         return new Prompt(prompt);
      }
      else
      {
         List<TerminalCharacter> prompt = new LinkedList<>();
         prompt.add(new TerminalCharacter('[', new TerminalColor(Color.BLUE, Color.DEFAULT),
                  CharacterType.BOLD));
         for (char c : currentResource.getName().toCharArray())
         {
            prompt.add(new TerminalCharacter(c));
         }
         prompt.add(new TerminalCharacter(']', new TerminalColor(Color.BLUE, Color.DEFAULT),
                  CharacterType.BOLD));
         prompt.add(new TerminalCharacter('$'));
         prompt.add(new TerminalCharacter(' '));
         return new Prompt(prompt);
      }
   }
1186615
def a_expected_prompt(ctx):
    """"""
    prompt = ctx.ctrl.match.group(0)
    ctx.device.update_driver(prompt)
    ctx.device.update_config_mode()
    ctx.device.update_hostname()
    ctx.finished = True
    return True
770914
def display_start(self):
        """"""

        if self.opt['Verbose'] and self.opt['StatusHeader']:
            print(self.hdrstr)
            print("-" * self.nsep)