tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

landmine_utils.py (642B)


      1 # Copyright 2013 The Chromium Authors
      2 # Use of this source code is governed by a BSD-style license that can be
      3 # found in the LICENSE file.
      4 
      5 
      6 import sys
      7 
      8 
      9 def IsWindows():
     10  return sys.platform in ['win32', 'cygwin']
     11 
     12 
     13 def IsLinux():
     14  return sys.platform.startswith(('linux', 'freebsd', 'netbsd', 'openbsd'))
     15 
     16 
     17 def IsMac():
     18  return sys.platform == 'darwin'
     19 
     20 
     21 def host_os():
     22  """
     23  Returns a string representing the host_os of the current system.
     24  Possible values: 'win', 'mac', 'linux', 'unknown'.
     25  """
     26  if IsWindows():
     27    return 'win'
     28  elif IsLinux():
     29    return 'linux'
     30  elif IsMac():
     31    return 'mac'
     32  else:
     33    return 'unknown'