Esempio n. 1
0
    def __init__(self):
        """
        Raises EnvironmentError if VoiceOutput is impossible.
        """
        Printer.__init__(self)
        # TODO retrieve language from get_locale and select appropriate voice

        try:
            self.espeak = subprocess.Popen(['espeak'], stdin=subprocess.PIPE)
        except OSError:  # pragma: no cover
            print("Espeak doesn't seem to be installed. You cannot use the voice output feature without espeak. "
                  "It can be downloaded from http://espeak.sourceforge.net/ or installed via your usual package "
                  "repositories.")
            raise EnvironmentError
        except:  # pragma: no cover
            print("Failed to execute espeak. An unknown error occurred. This is a bug.")
            raise EnvironmentError
Esempio n. 2
0
 def __init__(self):
     Printer.__init__(self)
Esempio n. 3
0
 def __init__(self, timestamp_format="%X"):
     Printer.__init__(self)
     self.timestamp_format = timestamp_format