Commit 7dc086d4 authored by nextime's avatar nextime

Renamed video modules to mediasources

parent 6669dbbe
......@@ -54,7 +54,7 @@ from asterisk import fastagi as fagi
from voiceui import voiceui as voice
from boards import pluggable as pluggableBoards
from boards.iotype import context2section
from video import pluggable as pluggableVideodevs
from mediasources import pluggable as pluggableMediasouces
import sky
from clouds.openweathermap import weather
......@@ -2449,7 +2449,7 @@ class domotikaService(service.Service):
if not device['host'] in self.upnp_detected_ips:
self.upnp_detected_ips.append(device['host'])
log.debug("UPNP DETECTED DEVICE FROM UPNP: "+str(device))
p=pluggableVideodevs.getVideodevPlugin(device['modelNumber'], device['manufacturer'])
p=pluggableMediasouces.getVideodevPlugin(device['modelNumber'], device['manufacturer'])
if p:
videodev = p.getVideoDev(device['host'], self.devadminpwd)
videodev.setUPNPLocation(device['location'])
......
###########################################################################
# Copyright (c) 2011-2013 Unixmedia S.r.l. <info@unixmedia.it>
# Copyright (c) 2011-2013 Franco (nextime) Lanza <franco@unixmedia.it>
#
# Domotika System Controller Daemon "domotikad" [http://trac.unixmedia.it]
#
# This file is part of domotikad.
#
# domotikad is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
......@@ -28,7 +28,7 @@ try:
except ImportError:
# Twisted 2.5 doesn't include pluginPackagePaths
import sys, os
__path__.extend([os.path.abspath(os.path.join(x, 'video', 'modules', 'generic'))
__path__.extend([os.path.abspath(os.path.join(x, 'mediasources', 'modules', 'OpenPLI'))
for x in sys.path])
__all__ = []
......@@ -28,7 +28,7 @@ try:
except ImportError:
# Twisted 2.5 doesn't include pluginPackagePaths
import sys, os
__path__.extend([os.path.abspath(os.path.join(x, 'video', 'modules', 'Sitecom'))
__path__.extend([os.path.abspath(os.path.join(x, 'mediasources', 'modules', 'Sitecom'))
for x in sys.path])
__all__ = []
###########################################################################
# Copyright (c) 2011-2013 Unixmedia S.r.l. <info@unixmedia.it>
# Copyright (c) 2011-2013 Franco (nextime) Lanza <franco@unixmedia.it>
#
# Domotika System Controller Daemon "domotikad" [http://trac.unixmedia.it]
#
# This file is part of domotikad.
#
# domotikad is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
......@@ -28,7 +28,7 @@ try:
except ImportError:
# Twisted 2.5 doesn't include pluginPackagePaths
import sys, os
__path__.extend([os.path.abspath(os.path.join(x, 'video', 'modules', 'OpenPLI'))
__path__.extend([os.path.abspath(os.path.join(x, 'mediasources', 'modules', 'generic'))
for x in sys.path])
__all__ = []
......@@ -10,17 +10,17 @@ try:
except ImportError:
pass
else:
for i in os.listdir('domotika/video/modules'):
if os.path.isdir('domotika/video/modules/'+i):
list(getPlugins(ivideodev.IVideoDev, importlib.import_module('domotika.video.modules.'+i))) # To refresh cache
for i in os.listdir('domotika/mediasources/modules'):
if os.path.isdir('domotika/mediasources/modules/'+i):
list(getPlugins(ivideodev.IVideoDev, importlib.import_module('domotika.mediasources.modules.'+i))) # To refresh cache
def getVideodevPlugin(name, manufacturer='generic'):
try:
if os.path.isdir('domotika/video/modules/'+str(manufacturer)):
mod = importlib.import_module('domotika.video.modules.'+str(manufacturer))
if os.path.isdir('domotika/mediasources/modules/'+str(manufacturer)):
mod = importlib.import_module('domotika.mediasources.modules.'+str(manufacturer))
else:
mod = importlib.import_module('domotika.video.modules.generic')
mod = importlib.import_module('domotika.mediasources.modules.generic')
except:
return None
for p in getPlugins(ivideodev.IVideoDev, mod ):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment