def init(self, config): if self.growlnotify == None: self.growlnotify = flashbake.find_executable('growlnotify') if self.growlnotify == None: raise plugins.PluginError(plugins.PLUGIN_ERRORS.ignorable_error, self.plugin_spec, 'Could not find command, growlnotify.')
def __whoami(self): cmd = flashbake.find_executable('whoami') if cmd: proc = subprocess.Popen([cmd], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) return proc.communicate()[0].strip() else: return None
def init(self, config): if self.growlnotify == None: self.growlnotify = flashbake.find_executable('growlnotify') if self.growlnotify == None: raise plugins.PluginError(plugins.PLUGIN_ERRORS.ignorable_error, #@UndefinedVariable self.plugin_spec, 'Could not find command, growlnotify.')
def __active_console(self): user = self.__whoami() if not user: return False cmd = flashbake.find_executable('who') if not cmd: return False proc = subprocess.Popen([cmd], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) active = False for line in proc.communicate()[0].splitlines(): m = re.match('^%s\s+console.*$' % user, line) if m: active = True break return active
def init(self, config): if self.osascript is None: self.osascript = flashbake.find_executable('osascript')