

def showAndGetCommand(self):
    pathObjs = self.getPathsToUse()
    paths = [pathObj.getPath() for pathObj in pathObjs]
    (maxy, maxx) = self.getScreenDimensions()
    halfHeight = int((round((maxy / 2)) - (len(paths) / 2.0)))
    borderLine = ('=' * len(SHORT_COMMAND_PROMPT))
    promptLine = ('.' * len(SHORT_COMMAND_PROMPT))
    maxPathLength = (maxx - 5)
    if self.helperChrome.getIsSidebarMode():
        maxPathLength = (len(SHORT_COMMAND_PROMPT) + 18)
    startHeight = ((halfHeight - 1) - len(paths))
    try:
        self.colorPrinter.addstr((startHeight - 3), 0, borderLine)
        self.colorPrinter.addstr((startHeight - 2), 0, SHORT_PATHS_HEADER)
        self.colorPrinter.addstr((startHeight - 1), 0, borderLine)
        for (index, path) in enumerate(paths):
            self.colorPrinter.addstr((startHeight + index), 0, path[0:maxPathLength])
    except curses.error:
        pass
    try:
        self.colorPrinter.addstr(halfHeight, 0, SHORT_COMMAND_PROMPT)
        self.colorPrinter.addstr((halfHeight + 1), 0, SHORT_COMMAND_PROMPT2)
    except curses.error:
        pass
    try:
        self.colorPrinter.addstr((halfHeight - 1), 0, borderLine)
        self.colorPrinter.addstr((halfHeight + 2), 0, borderLine)
        self.colorPrinter.addstr((halfHeight + 3), 0, promptLine)
    except curses.error:
        pass
    self.stdscr.refresh()
    self.cursesAPI.echo()
    maxX = int(round((maxx - 1)))
    command = self.stdscr.getstr((halfHeight + 3), 0, maxX)
    return command

dataset/ETHPy150Open facebook/PathPicker/src/screenControl.py Controller.showAndGetCommand/original