Пример #1
0
    def _run_cycle(self):
        """
        Executes a cycle of this screen.
        """
        # calculate random position based on screen size
        self.get_terminal_size()

        date_time = datetime.datetime.now()

        text = """
%s
%s
""" % (
            date_time.strftime('%A, %%d%%s %B %Y') %
            (date_time.day, common.get_day_suffix(date_time.day)),
            self.get_ascii_time(date_time),
        )

        text = self.center_text_horizontally(text)
        text = self.center_text_vertically(text)

        print text

        sleep_time = 1  # usually one cycle per second
        if self.ampm:
            # special case to show blinking separator
            sleep_time = 0.7

        time.sleep(sleep_time)
Пример #2
0
    def _run_cycle(self):
        """
        Executes a cycle of this screen.
        """
        # calculate random position based on screen size
        self.get_terminal_size()

        date_time = datetime.datetime.now()

        text = """
%s
%s
""" % (
       date_time.strftime('%A, %%d%%s %B %Y') % (date_time.day,
                common.get_day_suffix(date_time.day)),
       self.get_ascii_time(date_time),
       )

        text = self.center_text_horizontally(text)
        text = self.center_text_vertically(text)

        print text

        sleep_time = 1 # usually one cycle per second
        if self.ampm:
            # special case to show blinking separator
            sleep_time = 0.7

        time.sleep(sleep_time)
Пример #3
0
    def _run_cycle(self):
        """
        Executes a cycle of this screen.
        """
        # calculate random position based on screen size
        self.get_terminal_size()

        date_time = datetime.datetime.now()

        text = """
%s
%s
""" % (
       date_time.strftime('%A, %%d%%s %B %Y') % (date_time.day,
                common.get_day_suffix(date_time.day)),
       self.get_ascii_time(date_time),
       )

        text = self.center_text_horizontally(text)
        text = self.center_text_vertically(text)

        print text

        time.sleep(1)