Skip to content

Commit

Permalink
add system judgement
Browse files Browse the repository at this point in the history
  • Loading branch information
cosven committed Feb 14, 2016
1 parent 7c022db commit db7e5c4
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
10 changes: 5 additions & 5 deletions feeluown/plugin/MprisEx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@

"""feeluown mpris plugin"""

import dbus.mainloop.pyqt5

from feeluown.logger import LOG

from .service import MprisServer

from feeluown.utils import is_linux

__version__ = '1.0.0'


def init():
if not is_linux():
return 0
from .service import MprisServer
import dbus.mainloop.pyqt5
LOG.info("Load mpris plugin")
dbus.mainloop.pyqt5.DBusQtMainLoop(set_as_default=True)
MprisServer()
13 changes: 13 additions & 0 deletions feeluown/utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# -*- coding:utf-8 -*-

import platform
import json
import time
from functools import wraps
Expand Down Expand Up @@ -58,3 +59,15 @@ def wrapper(*args, **kwargs):
% (func.__name__, elapsed_time))
return result
return wrapper


def is_mac():
if platform.system() == 'Darwin':
return True
return False


def is_linux():
if platform.system() == 'Linux':
return True
return False

0 comments on commit db7e5c4

Please sign in to comment.