def _detect_running_player(self):
supported_players = self.supported_players.split("<STR_LIT:U+002C>")<EOL>running_players = []<EOL>for pid in os.listdir("<STR_LIT>"):<EOL><INDENT>if not pid.isdigit():<EOL><INDENT>continue<EOL><DEDENT>fn = os.path.join("<STR_LIT>", pid, "<STR_LIT>")<EOL>try:<EOL><INDENT>with open(fn, "<STR_LIT:rb>") as f:<EOL><INDENT>player_name = f.read().decode().rstrip()<EOL><DEDENT><DEDENT>except:  <EOL><INDENT>continue<EOL><DEDENT>if player_name in supported_players:<EOL><INDENT>running_players.append(player_name)<EOL><DEDENT><DEDENT>for player_name in supported_players:<EOL><INDENT>if player_name in running_players:<EOL><INDENT>if self.debug:<EOL><INDENT>self.py3.log("<STR_LIT>" % player_name)<EOL><DEDENT>if player_name in ("<STR_LIT>") and not dbus_available:<EOL><INDENT>self.py3.log("<STR_LIT>" % player_name)<EOL>return None<EOL><DEDENT>return player_name<EOL><DEDENT><DEDENT>return None<EOL>
Detect running player process, if any