Example #1
0
    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.')
Example #2
0
 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
Example #3
0
    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.')
Example #4
0
 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
Example #5
0
 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
Example #6
0
 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
Example #7
0
 def init(self, config):
     if self.osascript is None:
         self.osascript = flashbake.find_executable('osascript')