mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 13:19:24 +01:00
Added newDriver function for driver-module independence.
This commit is contained in:
parent
dc8b430754
commit
77ac7c6b4e
@ -39,6 +39,7 @@ import re
|
|||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
import conf
|
||||||
import ansi
|
import ansi
|
||||||
import debug
|
import debug
|
||||||
import ircmsgs
|
import ircmsgs
|
||||||
@ -120,7 +121,6 @@ def remove(name):
|
|||||||
_deadDrivers.append(name)
|
_deadDrivers.append(name)
|
||||||
|
|
||||||
def run():
|
def run():
|
||||||
#debug.printf(_drivers)
|
|
||||||
for (name, driver) in _drivers.iteritems():
|
for (name, driver) in _drivers.iteritems():
|
||||||
try:
|
try:
|
||||||
if name not in _deadDrivers:
|
if name not in _deadDrivers:
|
||||||
@ -139,4 +139,10 @@ def run():
|
|||||||
_drivers[name].die()
|
_drivers[name].die()
|
||||||
del _drivers[name]
|
del _drivers[name]
|
||||||
_drivers[name] = driver
|
_drivers[name] = driver
|
||||||
|
|
||||||
|
def newDriver(server, irc, moduleName=conf.driverModule):
|
||||||
|
driver = __import__(moduleName).Driver(server, irc)
|
||||||
|
irc.driver = driver
|
||||||
|
return driver
|
||||||
|
|
||||||
# vim:set shiftwidth=4 tabstop=8 expandtab textwidth=78:
|
# vim:set shiftwidth=4 tabstop=8 expandtab textwidth=78:
|
||||||
|
Loading…
Reference in New Issue
Block a user