示例#1
0
def get_pids(name):
    """Get all the pids matching name"""

    if mozinfo.isWin:
        # use the windows-specific implementation
        import wpk
        return wpk.get_pids(name)
    else:
        return [pid for pid,_ in running_processes(name)]
示例#2
0
def get_pids(name):
    """Get all the pids matching name"""

    if mozinfo.isWin:
        # use the windows-specific implementation
        import wpk
        return wpk.get_pids(name)
    else:
        return [pid for pid,_ in running_processes(name)]
示例#3
0
def get_pids(name, minimun_pid=0):
    """Get all the pids matching name, exclude any pids below minimum_pid."""
    if os.name == 'nt' or sys.platform == 'cygwin':
        import wpk
        pids = wpk.get_pids(name)
    else:
        data = getoutput(['ps', 'ax']).splitlines()
        pids = [int(line.split()[0]) for line in data if line.find(name) is not -1]

    matching_pids = [m for m in pids if m > minimun_pid]
    return matching_pids
示例#4
0
def get_pids(name, minimun_pid=0):
    """Get all the pids matching name, exclude any pids below minimum_pid."""
    if os.name == 'nt' or sys.platform == 'cygwin':
        import wpk

        pids = wpk.get_pids(name)

    else:
        data = getoutput(['ps', 'ax']).splitlines()
        pids = [int(line.split()[0]) for line in data if line.find(name) is not -1]

    matching_pids = [m for m in pids if m > minimun_pid]
    return matching_pids
示例#5
0
文件: pid.py 项目: jmaher/mozmill
def get_pids(name, minimun_pid=0):
  """Get all the pids matching name, exclude any pids below minimum_pid."""
  
  if mozinfo.isWin:
      # use the windows-specific implementation
      import wpk
      pids = wpk.get_pids(name)
  else:
      process = subprocess.Popen(['ps', 'ax'], stdout=subprocess.PIPE)
      output, _ = process.communicate()
      data = output.splitlines()
      pids = [int(line.split()[0]) for line in data if line.find(name) is not -1]

  return [m for m in pids if m > minimun_pid]
示例#6
0
def get_pids(name, minimun_pid=0):
  """Get all the pids matching name, exclude any pids below minimum_pid."""
  # XXX see also https://bugzilla.mozilla.org/show_bug.cgi?id=592750
  
  if os.name == 'nt' or sys.platform == 'cygwin':
    import wpk
    pids = wpk.get_pids(name)
  else:
    process = subprocess.Popen(['ps', 'ax'], stdout=subprocess.PIPE)
    output, _ = process.communicate()
    data = output.splitlines()
    pids = [int(line.split()[0]) for line in data if line.find(name) is not -1]

  matching_pids = [m for m in pids if m > minimun_pid]
  return matching_pids
示例#7
0
def get_pids(name, minimun_pid=0):
    """Get all the pids matching name, exclude any pids below minimum_pid."""
    if os.name == "nt" or sys.platform == "cygwin":
        import wpk

        pids = wpk.get_pids(name)

    else:
        # get_pids_cmd = ['ps', 'ax']
        # h = killableprocess.runCommand(get_pids_cmd, stdout=subprocess.PIPE, universal_newlines=True)
        # h.wait(group=False)
        # data = h.stdout.readlines()
        data = getoutput(["ps", "ax"]).splitlines()
        pids = [int(line.split()[0]) for line in data if line.find(name) is not -1]

    matching_pids = [m for m in pids if m > minimun_pid]
    return matching_pids
示例#8
0
def get_pids(name, minimun_pid=0):
    """Get all the pids matching name, exclude any pids below minimum_pid."""
    # XXX see also https://bugzilla.mozilla.org/show_bug.cgi?id=592750

    if os.name == 'nt' or sys.platform == 'cygwin':
        import wpk
        pids = wpk.get_pids(name)
    else:
        process = subprocess.Popen(['ps', 'ax'], stdout=subprocess.PIPE)
        output, _ = process.communicate()
        data = output.splitlines()
        pids = [
            int(line.split()[0]) for line in data if line.find(name) is not -1
        ]

    matching_pids = [m for m in pids if m > minimun_pid]
    return matching_pids
示例#9
0
def get_pids(name, minimun_pid=0):
    """Get all the pids matching name, exclude any pids below minimum_pid."""
    if os.name == 'nt' or sys.platform == 'cygwin':
        import wpk

        pids = wpk.get_pids(name)

    else:
        # get_pids_cmd = ['ps', 'ax']
        # h = killableprocess.runCommand(get_pids_cmd, stdout=subprocess.PIPE, universal_newlines=True)
        # h.wait(group=False)
        # data = h.stdout.readlines()
        data = getoutput(['ps', 'ax']).splitlines()
        pids = [int(line.split()[0]) for line in data if line.find(name) is not -1]

    matching_pids = [m for m in pids if m > minimun_pid]
    return matching_pids