예제 #1
0
파일: growl.py 프로젝트: gldnspud/flashbake
    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.')
예제 #2
0
파일: growl.py 프로젝트: gldnspud/flashbake
 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
예제 #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.')
예제 #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
예제 #5
0
파일: growl.py 프로젝트: gldnspud/flashbake
 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
예제 #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
예제 #7
0
파일: music.py 프로젝트: ianpaul/flashbake
 def init(self, config):
     if self.osascript is None:
         self.osascript = flashbake.find_executable('osascript')