mirror of
https://git.deluge-torrent.org/deluge
synced 2025-04-20 11:35:49 +00:00
Fix and clean-up os checking functions
This commit is contained in:
parent
0e9c61d4be
commit
0c9a3751e4
2 changed files with 8 additions and 25 deletions
|
@ -35,6 +35,7 @@
|
|||
|
||||
import os
|
||||
import subprocess
|
||||
import platform
|
||||
|
||||
import pkg_resources
|
||||
import xdg, xdg.BaseDirectory
|
||||
|
@ -117,18 +118,13 @@ def get_default_download_dir():
|
|||
def windows_check():
|
||||
"""Checks if the current platform is Windows. Returns True if it is Windows
|
||||
and False if not."""
|
||||
import platform
|
||||
if platform.system() in ('Windows', 'Microsoft'):
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
return platform.system() in ('Windows', 'Microsoft')
|
||||
|
||||
def vista_check():
|
||||
import platform
|
||||
if platform.release() == "Vista":
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
return platform.release() == "Vista"
|
||||
|
||||
def osx_check():
|
||||
return platform.system() == "Darwin"
|
||||
|
||||
def get_pixmap(fname):
|
||||
"""Returns a pixmap file included with deluge"""
|
||||
|
@ -358,9 +354,3 @@ def pythonize(var):
|
|||
if isinstance(var, klass):
|
||||
return klass(var)
|
||||
return var
|
||||
|
||||
def osx_check():
|
||||
if platform.system() in ("Darwin"):
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
|
11
setup.py
11
setup.py
|
@ -45,17 +45,10 @@ import platform
|
|||
python_version = platform.python_version()[0:3]
|
||||
|
||||
def windows_check():
|
||||
import platform
|
||||
if platform.system() in ('Windows', 'Microsoft'):
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
return platform.system() in ('Windows', 'Microsoft')
|
||||
|
||||
def osx_check():
|
||||
if platform.system() in ("Darwin"):
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
return platform.system() == "Darwin"
|
||||
|
||||
if not os.environ.has_key("CC"):
|
||||
os.environ["CC"] = "gcc"
|
||||
|
|
Loading…
Add table
Reference in a new issue