How to use the castero.helpers.is_true function in castero

To help you get started, we’ve selected a few castero examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github xgi / castero / tests / test_helpers.py View on Github external
def test_is_true_no():
    assert not helpers.is_true('False')
    assert not helpers.is_true('')
    assert not helpers.is_true('hi')
github xgi / castero / tests / test_helpers.py View on Github external
def test_is_true_yes():
    assert helpers.is_true('True')
    assert helpers.is_true('true')
    assert helpers.is_true('1')
github xgi / castero / tests / test_helpers.py View on Github external
def test_is_true_yes():
    assert helpers.is_true('True')
    assert helpers.is_true('true')
    assert helpers.is_true('1')
github xgi / castero / tests / test_helpers.py View on Github external
def test_is_true_no():
    assert not helpers.is_true('False')
    assert not helpers.is_true('')
    assert not helpers.is_true('hi')
github xgi / castero / tests / test_helpers.py View on Github external
def test_is_true_no():
    assert not helpers.is_true('False')
    assert not helpers.is_true('')
    assert not helpers.is_true('hi')
github xgi / castero / castero / feed.py View on Github external
def metadata(self) -> str:
        """str: the user-displayed metadata of the feed"""
        description = helpers.html_to_plain(self.description) if \
            helpers.is_true(Config["clean_html_descriptions"]) else \
            self.description
        description = description.replace('\n', '')

        return \
            "!cb{title}\n" \
            "{last_build_date}\n\n" \
            "{link}\n\n" \
            "!cbCopyright:\n" \
            "{copyright}\n\n" \
            "!cbDescription:\n" \
            "{description}\n".format(
                title=self.title,
                last_build_date=self.last_build_date,
                link=self.link,
                copyright=self.copyright,
                description=description)
github xgi / castero / castero / perspectives / primaryperspective.py View on Github external
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))

        # display menu content
        self._feed_menu.display()
        self._episode_menu.display()

        # draw metadata
        if not self._metadata_updated:
            self._draw_metadata(self._metadata_window)
github xgi / castero / castero / episode.py View on Github external
def metadata(self) -> str:
        """str: the user-displayed metadata of the episode"""
        description = helpers.html_to_plain(self.description) if \
            helpers.is_true(Config["clean_html_descriptions"]) else \
            self.description
        description = description.replace('\n', '')
        downloaded = "Episode downloaded and available for offline playback." \
            if self.downloaded else "Episode not downloaded."

        return \
            "!cb{title}\n" \
            "{pubdate}\n\n" \
            "{link}\n\n" \
            "!cbCopyright:\n" \
            "{copyright}\n\n" \
            "!cbDownloaded:\n" \
            "{downloaded}\n\n" \
            "!cbDescription:\n" \
            "{description}\n".format(
                title=self.title,