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:
parent
ea67ed7a61
commit
674a3e958d
1 changed files with 49 additions and 23 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue