plugin tools: turn src/plugin/games.py into a plugin and move it to src/plugins/plugin_misc_room_game.py

This commit is contained in:
souliane 2013-11-21 18:23:08 +01:00
commit 674a3e958d

View file

@ -25,7 +25,6 @@ from twisted.words.protocols.jabber import jid
import os.path
from os import unlink
from mutagen.oggvorbis import OggVorbis, OggVorbisHeaderError
from sat.tools.plugins.games import RoomGame
NC_RADIOCOL = 'http://www.goffi.org/protocol/radiocol'
@ -36,7 +35,7 @@ PLUGIN_INFO = {
"import_name": "Radiocol",
"type": "Exp",
"protocols": [],
"dependencies": ["XEP-0045", "XEP-0249"],
"dependencies": ["XEP-0045", "XEP-0249", "ROOM-GAME"],
"main": "Radiocol",
"handler": "yes",
"description": _("""Implementation of radio collective""")
@ -45,11 +44,17 @@ PLUGIN_INFO = {
QUEUE_LIMIT = 2
class Radiocol(RoomGame):
class Radiocol(object):
def inheritFromRoomGame(self, host):
global RoomGame
RoomGame = host.plugins["ROOM-GAME"].__class__
self.__class__ = type(self.__class__.__name__, (self.__class__, RoomGame, object), {})
def __init__(self, host):
info(_("Radio collective initialization"))
RoomGame.__init__(self, host, PLUGIN_INFO, (NC_RADIOCOL, RADIOC_TAG),
self.inheritFromRoomGame(host)
RoomGame._init_(self, host, PLUGIN_INFO, (NC_RADIOCOL, RADIOC_TAG),
game_init={'queue': [], 'upload': True, 'playing': False, 'to_delete': {}})
self.host = host
host.bridge.addMethod("radiocolLaunch", ".plugin", in_sign='asss', out_sign='', method=self.prepareRoom)