diff --git a/setup.py b/setup.py index 0f27eccc1..2147fcddb 100644 --- a/setup.py +++ b/setup.py @@ -58,7 +58,7 @@ elif platform.system() == "Darwin" : elif platform.system() == "FreeBSD" : print "FreeBSD operating system detected" OS = "freebsd" -elif platform.system() == "Windows": +elif platform.system() in ('Windows', 'Microsoft'): print "Windows system detected" OS = "win" elif os.name == "posix": diff --git a/src/__init__.py b/src/__init__.py index b88e8fabe..91a3db58a 100644 --- a/src/__init__.py +++ b/src/__init__.py @@ -39,7 +39,7 @@ from common import INSTALL_PREFIX APP = 'deluge' DIR = os.path.join(INSTALL_PREFIX, 'share', 'locale') -if platform.system() != "Windows": +if not platform.system() in ('Windows', 'Microsoft'): locale.setlocale(locale.LC_MESSAGES, '') locale.bindtextdomain(APP, DIR) locale.textdomain(APP) diff --git a/src/common.py b/src/common.py index 54953cbd6..5e41a127e 100644 --- a/src/common.py +++ b/src/common.py @@ -37,7 +37,7 @@ PROGRAM_VERSION = "0.5.5.95" CLIENT_CODE = "DE" CLIENT_VERSION = "".join(PROGRAM_VERSION.split('.'))+"0"*(4 - len(PROGRAM_VERSION.split('.'))) import platform -if platform.system() == "Windows": +if platform.system() in ('Windows', 'Microsoft'): CONFIG_DIR = os.path.join(os.path.expanduser("~\\"), 'deluge') if not os.path.exists(CONFIG_DIR): os.mkdir(CONFIG_DIR) @@ -136,7 +136,7 @@ def get_pixmap(fname): def get_logo(size): import gtk import platform - if platform.system() == "Windows": + if platform.system() in ('Windows', 'Microsoft'): return gtk.gdk.pixbuf_new_from_file_at_size(get_pixmap("deluge.png"), \ size, size) else: diff --git a/src/core.py b/src/core.py index 0e71e9c2e..b8c6e8ed5 100644 --- a/src/core.py +++ b/src/core.py @@ -53,7 +53,7 @@ import os import re import shutil import platform -if platform.system() != "Windows": +if not platform.system() in ('Windows', 'Microsoft'): import statvfs import time @@ -300,7 +300,7 @@ class Manager: deluge_core.quit() #kill dbus on windows - if platform.system() == "Windows": + if platform.system() in ('Windows', 'Microsoft'): import os os.popen4('tskill.exe dbus-daemon-deluge') @@ -798,7 +798,7 @@ class Manager: # Functions for checking if enough space is available def calc_free_space(self, directory): - if platform.system() != "Windows": + if not platform.system() in ('Windows', 'Microsoft'): dir_stats = os.statvfs(directory) block_size = dir_stats[statvfs.F_BSIZE] avail_blocks = dir_stats[statvfs.F_BAVAIL] diff --git a/src/interface.py b/src/interface.py index f47aa75b4..87a5cdce6 100644 --- a/src/interface.py +++ b/src/interface.py @@ -147,7 +147,7 @@ class DelugeGTK: signal.signal(signal.SIGINT, self.manager.quit) signal.signal(signal.SIGTERM, self.manager.quit) import platform - if platform.system() != "Windows": + if not platform.system() in ('Windows', 'Microsoft'): signal.signal(signal.SIGHUP, self.manager.quit) self.dht_timer = 0 self.dht_skip = False