当前位置: 首页>>代码示例>>Python>>正文


Python curses.ACS_VLINE属性代码示例

本文整理汇总了Python中curses.ACS_VLINE属性的典型用法代码示例。如果您正苦于以下问题:Python curses.ACS_VLINE属性的具体用法?Python curses.ACS_VLINE怎么用?Python curses.ACS_VLINE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在curses的用法示例。


在下文中一共展示了curses.ACS_VLINE属性的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: paint_candle

# 需要导入模块: import curses [as 别名]
# 或者: from curses import ACS_VLINE [as 别名]
def paint_candle(self, posx, candle):
        """paint a single candle"""

        sopen = self.price_to_screen(candle.opn)
        shigh = self.price_to_screen(candle.hig)
        slow = self.price_to_screen(candle.low)
        sclose = self.price_to_screen(candle.cls)

        for posy in range(self.height):
            if posy >= shigh and posy < sopen and posy < sclose:
                # upper wick
                self.addch(posy, posx, curses.ACS_VLINE, COLOR_PAIR["chart_text"])
            if posy >= sopen and posy < sclose:
                # red body
                self.addch(posy, posx, self.body_char, self.body_attr + COLOR_PAIR["chart_down"])
            if posy >= sclose and posy < sopen:
                # green body
                self.addch(posy, posx, self.body_char, self.body_attr + COLOR_PAIR["chart_up"])
            if posy >= sopen and posy >= sclose and posy < slow:
                # lower wick
                self.addch(posy, posx, curses.ACS_VLINE, COLOR_PAIR["chart_text"]) 
开发者ID:caktux,项目名称:pytrader,代码行数:23,代码来源:pytrader.py

示例2: render_tree

# 需要导入模块: import curses [as 别名]
# 或者: from curses import ACS_VLINE [as 别名]
def render_tree(results, tree, level=0, prefix=[], node='/'):
    # Exit condition
    if node not in tree:
        return

    # Iteration
    for i, line in enumerate(tree[node]):
        cgroup = line['cgroup']

        # Build name
        if i == len(tree[node]) - 1:
            line['_tree'] = prefix + [curses.ACS_LLCORNER, curses.ACS_HLINE, ' ']
            _child_prefix = prefix + [' ', ' ', ' ']
        else:
            line['_tree'] = prefix + [curses.ACS_LTEE, curses.ACS_HLINE, ' ']
            _child_prefix = prefix + [curses.ACS_VLINE, ' ', ' ']

        # Commit, fold or recurse
        results.append(line)
        if cgroup not in CONFIGURATION['fold']:
            render_tree(results, tree, level+1, _child_prefix, cgroup)
        else:
            line['_tree'] [-2] = '+' 
开发者ID:yadutaf,项目名称:ctop,代码行数:25,代码来源:cgroup_top.py

示例3: stdscr

# 需要导入模块: import curses [as 别名]
# 或者: from curses import ACS_VLINE [as 别名]
def stdscr():
    with patch('curses.initscr'),               \
            patch('curses.echo'),               \
            patch('curses.flash'),              \
            patch('curses.endwin'),             \
            patch('curses.newwin'),             \
            patch('curses.noecho'),             \
            patch('curses.cbreak'),             \
            patch('curses.doupdate'),           \
            patch('curses.nocbreak'),           \
            patch('curses.curs_set'),           \
            patch('curses.init_pair'),          \
            patch('curses.color_pair'),         \
            patch('curses.has_colors'),         \
            patch('curses.start_color'),        \
            patch('curses.use_default_colors'):
        out = MockStdscr(nlines=40, ncols=80, x=0, y=0)
        curses.initscr.return_value = out
        curses.newwin.side_effect = lambda *args: out.derwin(*args)
        curses.color_pair.return_value = 23
        curses.has_colors.return_value = True
        curses.ACS_VLINE = 0
        curses.COLORS = 256
        curses.COLOR_PAIRS = 256
        yield out 
开发者ID:michael-lazar,项目名称:rtv,代码行数:27,代码来源:conftest.py

示例4: box

# 需要导入模块: import curses [as 别名]
# 或者: from curses import ACS_VLINE [as 别名]
def box(self, window, x, y, w, h, color):
        for i in xrange(1, w - 1):
            window.addch(y, x + i, curses.ACS_HLINE, color)
            window.addch(y + h - 1, x + i, curses.ACS_HLINE, color)
        for i in xrange(1, h - 1):
            window.addch(y + i, x, curses.ACS_VLINE, color)
            window.addch(y + i, x + w - 1, curses.ACS_VLINE, color)
        window.addch(y, x, curses.ACS_ULCORNER, color)
        window.addch(y, x + w - 1, curses.ACS_URCORNER, color)
        window.addch(y + h - 1, x, curses.ACS_LLCORNER, color)
        window.addch(y + h - 1, x + w - 1, curses.ACS_LRCORNER, color) 
开发者ID:Battelle,项目名称:sandsifter,代码行数:13,代码来源:sifter.py

示例5: bracket

# 需要导入模块: import curses [as 别名]
# 或者: from curses import ACS_VLINE [as 别名]
def bracket(self, window, x, y, h, color):
        for i in xrange(1, h - 1):
            window.addch(y + i, x, curses.ACS_VLINE, color)
        window.addch(y, x, curses.ACS_ULCORNER, color)
        window.addch(y + h - 1, x, curses.ACS_LLCORNER, color) 
开发者ID:Battelle,项目名称:sandsifter,代码行数:7,代码来源:sifter.py

示例6: rectangle

# 需要导入模块: import curses [as 别名]
# 或者: from curses import ACS_VLINE [as 别名]
def rectangle(win, uly, ulx, lry, lrx):
    """Draw a rectangle with corners at the provided upper-left
    and lower-right coordinates.
    """
    win.vline(uly+1, ulx, curses.ACS_VLINE, lry - uly - 1)
    win.hline(uly, ulx+1, curses.ACS_HLINE, lrx - ulx - 1)
    win.hline(lry, ulx+1, curses.ACS_HLINE, lrx - ulx - 1)
    win.vline(uly+1, lrx, curses.ACS_VLINE, lry - uly - 1)
    win.addch(uly, ulx, curses.ACS_ULCORNER)
    win.addch(uly, lrx, curses.ACS_URCORNER)
    win.addch(lry, lrx, curses.ACS_LRCORNER)
    win.addch(lry, ulx, curses.ACS_LLCORNER) 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:14,代码来源:textpad.py

示例7: populate

# 需要导入模块: import curses [as 别名]
# 或者: from curses import ACS_VLINE [as 别名]
def populate(self, results):
        if not self.results == None:
          del self.results
        self.results = curses.newpad(max(len(results), curses.LINES - 1), curses.COLS//2)
        self.results.clear()
        for i in range(curses.LINES - SEARCHBAR_OFFSET):
          self.results.insch(i, curses.COLS//2 - 2, curses.ACS_VLINE)
        i = 0
        for result in results:
          # print(result)
          self.results.addstr(i, 0, result.name)
          if (not result.images == None) and (self.w3m_enabled):
            try:
                images_array = ast.literal_eval(result.images) 
                temp_file = util.RDBDIR + 'tmp'
                #os.remove(temp_file)
                # print(result.images[0])
                request.urlretrieve(images_array[0], temp_file)
                self.draw_image(temp_file, curses.COLS - curses.COLS/2, SEARCHBAR_OFFSET, curses.COLS/2, curses.LINES - SEARCHBAR_OFFSET)
                if self.first_pic:
                  self.first_pic = False
            except Exception as e:
                # Who cares? it's just a picture.
                self.end()
                print(str(e))
                pass
          i += 1

        self.results.noutrefresh(0, 0, SEARCHBAR_OFFSET, 0, curses.LINES-1, curses.COLS-1) 
开发者ID:install-logos,项目名称:ricedb,代码行数:31,代码来源:render.py

示例8: stdscr

# 需要导入模块: import curses [as 别名]
# 或者: from curses import ACS_VLINE [as 别名]
def stdscr():
    with mock.patch('curses.initscr'), \
            mock.patch('curses.echo'), \
            mock.patch('curses.flash'), \
            mock.patch('curses.endwin'), \
            mock.patch('curses.newwin'), \
            mock.patch('curses.newpad'), \
            mock.patch('curses.noecho'), \
            mock.patch('curses.cbreak'), \
            mock.patch('curses.doupdate'), \
            mock.patch('curses.nocbreak'), \
            mock.patch('curses.curs_set'), \
            mock.patch('curses.init_pair'), \
            mock.patch('curses.color_pair'), \
            mock.patch('curses.has_colors'), \
            mock.patch('curses.start_color'), \
            mock.patch('curses.use_default_colors'):
        result = MockStdscr(nlines=24, ncols=100, x=0, y=0)
        curses.initscr.return_value = result
        curses.newwin.side_effect = lambda *args: result.derwin(*args)
        curses.color_pair.return_value = 1
        curses.has_colors.return_value = True
        curses.ACS_VLINE = 0
        curses.ACS_HLINE = 0
        curses.COLORS = 16
        curses.COLOR_PAIRS = 16
        yield result 
开发者ID:xgi,项目名称:castero,代码行数:29,代码来源:conftest.py

示例9: display

# 需要导入模块: import curses [as 别名]
# 或者: from curses import ACS_VLINE [as 别名]
def display(self) -> None:
        """Draws all windows and sub-features, including titles and borders.

        Overrides method from Perspective; see documentation in that class.
        """
        # clear dynamic menu headers
        self._feed_window.addstr(0, 0, " " * self._feed_window.getmaxyx()[1])
        self._episode_window.addstr(0, 0,
                                    " " * self._episode_window.getmaxyx()[1])

        # add window headers
        self._feed_window.addstr(0, 0, self._feed_menu.title,
                                 curses.color_pair(7) | curses.A_BOLD)
        self._episode_window.addstr(0, 0, self._episode_menu.title,
                                    curses.color_pair(7) | curses.A_BOLD)

        # add window borders
        self._feed_window.hline(1, 0,
                                0, self._feed_window.getmaxyx()[1],
                                curses.ACS_HLINE | curses.color_pair(8))
        self._episode_window.hline(1, 0,
                                   0, self._episode_window.getmaxyx()[1],
                                   curses.ACS_HLINE | curses.color_pair(8))
        if not helpers.is_true(Config["disable_vertical_borders"]):
            self._feed_window.vline(0, self._feed_window.getmaxyx()[1] - 1,
                                    0, self._feed_window.getmaxyx()[0] - 2,
                                    curses.ACS_VLINE | curses.color_pair(8))

        self._feed_window.refresh()
        self._episode_window.refresh() 
开发者ID:xgi,项目名称:castero,代码行数:32,代码来源:simpleperspective.py

示例10: display

# 需要导入模块: import curses [as 别名]
# 或者: from curses import ACS_VLINE [as 别名]
def display(self) -> None:
        """Draws all windows and sub-features, including titles and borders.

        Overrides method from Perspective; see documentation in that class.
        """
        # clear dynamic menu headers
        self._downloaded_window.addstr(
            0, 0, " " * self._downloaded_window.getmaxyx()[1])

        # add window headers
        self._downloaded_window.addstr(
            0, 0, self._downloaded_menu.title,
            curses.color_pair(7) | curses.A_BOLD)
        self._metadata_window.addstr(
            0, 0, "Metadata",
            curses.color_pair(7) | curses.A_BOLD)

        # add window borders
        self._downloaded_window.hline(
            1, 0,
            0, self._downloaded_window.getmaxyx()[1],
            curses.ACS_HLINE | curses.color_pair(8))
        self._metadata_window.hline(
            1, 0,
            0, self._metadata_window.getmaxyx()[1] - 1,
            curses.ACS_HLINE | curses.color_pair(8))
        if not helpers.is_true(Config["disable_vertical_borders"]):
            self._downloaded_window.vline(
                0, self._downloaded_window.getmaxyx()[1] - 1,
                0, self._downloaded_window.getmaxyx()[0] - 2,
                curses.ACS_VLINE | curses.color_pair(8))

        # draw metadata
        if not self._metadata_updated:
            self._draw_metadata(self._metadata_window)
            self._metadata_window.refresh()
            self._metadata_updated = True

        self._downloaded_window.refresh() 
开发者ID:xgi,项目名称:castero,代码行数:41,代码来源:downloadedperspective.py

示例11: display

# 需要导入模块: import curses [as 别名]
# 或者: from curses import ACS_VLINE [as 别名]
def display(self) -> None:
        """Draws all windows and sub-features, including titles and borders.

        Overrides method from Perspective; see documentation in that class.
        """
        # clear dynamic menu headers
        self._queue_window.addstr(0, 0, " " * self._queue_window.getmaxyx()[1])

        # add window headers
        self._queue_window.addstr(0, 0, self._queue_menu.title,
                                  curses.color_pair(7) | curses.A_BOLD)
        self._metadata_window.addstr(0, 0, "Metadata",
                                     curses.color_pair(7) | curses.A_BOLD)

        # add window borders
        self._queue_window.hline(1, 0,
                                 0, self._queue_window.getmaxyx()[1],
                                 curses.ACS_HLINE | curses.color_pair(8))
        self._metadata_window.hline(1, 0,
                                    0, self._metadata_window.getmaxyx()[1] - 1,
                                    curses.ACS_HLINE | curses.color_pair(8))
        if not helpers.is_true(Config["disable_vertical_borders"]):
            self._queue_window.vline(0, self._queue_window.getmaxyx()[1] - 1,
                                     0, self._queue_window.getmaxyx()[0] - 2,
                                     curses.ACS_VLINE | curses.color_pair(8))

        # draw metadata
        if not self._metadata_updated:
            self._draw_metadata(self._metadata_window)
            self._metadata_window.refresh()
            self._metadata_updated = True

        self._queue_window.refresh() 
开发者ID:xgi,项目名称:castero,代码行数:35,代码来源:queueperspective.py

示例12: display

# 需要导入模块: import curses [as 别名]
# 或者: from curses import ACS_VLINE [as 别名]
def display(self) -> None:
        """Draws all windows and sub-features, including titles and borders.

        Overrides method from Perspective; see documentation in that class.
        """
        # clear dynamic menu headers
        self._feed_window.addstr(0, 0, " " * self._feed_window.getmaxyx()[1])
        self._episode_window.addstr(0, 0,
                                    " " * self._episode_window.getmaxyx()[1])

        # add window headers
        self._feed_window.addstr(0, 0, self._feed_menu.title,
                                 curses.color_pair(7) | curses.A_BOLD)
        self._episode_window.addstr(0, 0, self._episode_menu.title,
                                    curses.color_pair(7) | curses.A_BOLD)
        self._metadata_window.addstr(0, 0, "Metadata",
                                     curses.color_pair(7) | curses.A_BOLD)

        # add window borders
        self._feed_window.hline(1, 0,
                                0, self._feed_window.getmaxyx()[1],
                                curses.ACS_HLINE | curses.color_pair(8))
        self._episode_window.hline(1, 0,
                                   0, self._episode_window.getmaxyx()[1],
                                   curses.ACS_HLINE | curses.color_pair(8))
        self._metadata_window.hline(1, 0,
                                    0, self._metadata_window.getmaxyx()[1] - 1,
                                    curses.ACS_HLINE | curses.color_pair(8))
        if not helpers.is_true(Config["disable_vertical_borders"]):
            self._feed_window.vline(0, self._feed_window.getmaxyx()[1] - 1,
                                    0, self._feed_window.getmaxyx()[0] - 2,
                                    curses.ACS_VLINE | curses.color_pair(8))
            self._episode_window.vline(0,
                                       self._episode_window.getmaxyx()[1] - 1,
                                       0,
                                       self._episode_window.getmaxyx()[0] - 2,
                                       curses.ACS_VLINE | curses.color_pair(8))

        # draw metadata
        if not self._metadata_updated:
            self._draw_metadata(self._metadata_window)
            self._metadata_window.refresh()
            self._metadata_updated = True

        self._feed_window.refresh()
        self._episode_window.refresh() 
开发者ID:xgi,项目名称:castero,代码行数:48,代码来源:primaryperspective.py


注:本文中的curses.ACS_VLINE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。