def instance(): import sys if whereis_exe("upower"): return LinuxBattery() sys.stderr.write("upower not found.") return Battery()
def instance(): ''' Instance for facade proxy. ''' import sys if whereis_exe('sysctl'): return OSXCPU() sys.stderr.write('sysctl not found.') return CPU()
def instance(): ''' Instance for facade proxy. ''' import sys if whereis_exe('nproc'): return LinuxCPU() sys.stderr.write("nproc not found.") return CPU()
def instance(): ''' Instance for facade proxy. ''' import sys if whereis_exe('ioreg'): return OSXUniqueID() sys.stderr.write("ioreg not found.") return UniqueID()
def instance(): ''' Instance for facade proxy. ''' import sys if whereis_exe('ioreg'): return OSXBattery() sys.stderr.write("ioreg not found.") return Battery()
def instance(): ''' Instance for facade proxy. ''' import sys if whereis_exe('xdg-open'): return LinuxEmail() sys.stderr.write("xdg-open not found.") return Email()
def instance(): ''' Instance for facade proxy. ''' import sys if whereis_exe('system_profiler'): return OSXBluetooth() sys.stderr.write("system_profiler not found.") return Bluetooth()
def instance(): ''' Instance for facade proxy. ''' import sys if whereis_exe('open'): return MacOSXEmail() sys.stderr.write("open not found.") return Email()
def instance(): ''' Instance for facade proxy. ''' import sys if whereis_exe('lshw'): return LinuxUniqueID() sys.stderr.write("lshw not found.") return UniqueID()
def instance(): ''' Instance for facade proxy. ''' import sys if whereis_exe('upower'): return UPowerBattery() sys.stderr.write("upower not found.") if exists(join('/sys', 'class', 'power_supply', 'BAT0')): return LinuxBattery() return Battery()
def instance(): import sys try: import dbus return NotifyDbus() except ImportError: msg = "python-dbus not installed. try: `sudo pip install python-dbus`." warnings.warn(msg) if whereis_exe('notify-send'): return NotifySendNotification() warnings.warn("notify-send not found.") return Notification()
def instance(): import sys try: import dbus return NotifyDbus() except ImportError: sys.stderr.write("python-dbus not installed. try:" "`sudo pip install python-dbus`.") if whereis_exe('notify-send'): return NotifySendNotification() sys.stderr.write("notify-send not found.") return Notification()
def instance(): import sys if whereis_exe('nmcli'): return NMCLIWifi() try: import wifi # pylint: disable=unused-variable,unused-import except ImportError: sys.stderr.write("python-wifi not installed. try:" "`pip install --user wifi`.") return Wifi() return LinuxWifi()
def instance(): import sys try: import dbus return NotifyDbus() except ImportError: msg = ("The Python dbus package is not installed.\n" "Try installing it with your distribution's package manager, " "it is usually called python-dbus or python3-dbus, but you " "might have to try dbus-python instead, e.g. when using pip.") warnings.warn(msg) if whereis_exe('notify-send'): return NotifySendNotification() warnings.warn("notify-send not found.") return Notification()
def instance(): ''' Instance for facade proxy. ''' try: import dbus # pylint: disable=unused-variable,unused-import return NotifyDbus() except ImportError: msg = ("The Python dbus package is not installed.\n" "Try installing it with your distribution's package manager, " "it is usually called python-dbus or python3-dbus, but you " "might have to try dbus-python instead, e.g. when using pip.") warnings.warn(msg) if whereis_exe('notify-send'): return NotifySendNotification() warnings.warn("notify-send not found.") return Notification()
def instance(): import sys if whereis_exe('pactl'): return VolumeSet() sys.stderr.write("pactl not found.") return Volume()
def instance(): import sys if whereis_exe('ioreg'): return OSXUniqueID() sys.stderr.write("ioreg not found.") return UniqueID()
def instance(): if whereis_exe('screencapture'): return OSXScreenshot() else: return Screenshot()
def instance(): if whereis_exe('say'): return NativeSayTextToSpeech() elif whereis_exe('espeak'): return EspeakTextToSpeech() return TTS()
def instance(): import sys if whereis_exe('lshw'): return LinuxUniqueID() sys.stderr.write("lshw not found.") return UniqueID()
def instance(): import sys if whereis_exe('open'): return MacOSXEmail() sys.stderr.write("open not found.") return Email()
def instance(): import sys if whereis_exe('ioreg'): return OSXBattery() sys.stderr.write("ioreg not found.") return Battery()
def instance(): if whereis_exe('notify-send'): return NotifySendNotification() return Notification()
def instance(): if whereis_exe('nmcli'): return NMCLIWifi() return LinuxWifi()
def instance(): import sys if whereis_exe('nproc'): return LinuxProcessors() sys.stderr.write("nproc not found.") return Processors()
def instance(): if whereis_exe('xwd'): return LinuxScreenshot() else: return Screenshot()
def instance(): if whereis_exe('espeak'): return WindowsTextToSpeech() return TTS()
def instance(): if whereis_exe('espeak'): return EspeakTextToSpeech() elif whereis_exe('flite'): return FlitetextToSpeech() return TTS()
def instance(): if whereis_exe('espeak.exe'): return EspeakTextToSpeech() return TTS()
def instance(): import sys if whereis_exe('xdg-open'): return LinuxEmail() sys.stderr.write("xdg-open not found.") return Email()
def instance(): import sys if whereis_exe('upower'): return LinuxBattery() sys.stderr.write("upower not found.") return Battery()