Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[XMLTVImport] yet more renaming.

  • Loading branch information...
commit cee73807c8c2c732fb6530e1e8dacbbfba889e55 1 parent f420584
@andyblac andyblac authored
View
2  configure.ac
@@ -30,7 +30,7 @@ AM_CONDITIONAL(UPDATE_PO, test "$with_po" = "yes")
AC_OUTPUT([
Makefile
etc/Makefile
-etc/epgimport/Makefile
+etc/xmltvimport/Makefile
po/Makefile
src/Makefile
])
View
2  dreamcrc/setup.py
@@ -10,5 +10,5 @@
description = 'C implementation of Dream CRC32 algorithm',
# packages = ['XMLTVImport'],
# package_data = {'XMLTVImport': ['XMLTVImport/*.png']},
-# data_files = [('etc/epgimport', ['*.xml'])],
+# data_files = [('etc/xmltvimport', ['*.xml'])],
ext_modules = [dreamcrc])
View
2  etc/Makefile.am
@@ -1,2 +1,2 @@
installdir = ${sysconfdir}
-SUBDIRS = epgimport
+SUBDIRS = xmltvimport
View
2  etc/epgimport/Makefile.am
@@ -1,2 +0,0 @@
-installdir = ${sysconfdir}/epgimport
-install_DATA = readme.txt
View
2  etc/xmltvimport/Makefile.am
@@ -0,0 +1,2 @@
+installdir = ${sysconfdir}/xmltvimport
+install_DATA = readme.txt
View
2  etc/epgimport/readme.txt → etc/xmltvimport/readme.txt
@@ -2,7 +2,7 @@ XMLTV Importer
This software is released under the GPLv2 license.
-Providers should check out the .xml files in the /etc/epgimport
+Providers should check out the .xml files in the /etc/xmltvimport
directory for information on creating your own source.
Users need not read this, just configure it from the plugins.
View
12 src/OfflineImport.py
@@ -23,7 +23,7 @@ def getInstance(self):
# def importEvents(self, *args):
# print args
-def importFrom(epgimport, sourceXml):
+def importFrom(xmltvimport, sourceXml):
# Hack to make this test run on Windows (where the reactor cannot handle files)
if sys.platform.startswith('win'):
import twisted.python.runtime
@@ -45,9 +45,9 @@ def stop(self):
XMLTVImport.reactor = FakeReactor()
sources = [ s for s in XMLTVConfig.enumSourcesFile(sourceXml, filter = None) ]
sources.reverse()
- epgimport.sources = sources
- epgimport.onDone = done
- epgimport.beginImport(longDescUntil = time.time() + (5*24*3600))
+ xmltvimport.sources = sources
+ xmltvimport.onDone = done
+ xmltvimport.beginImport(longDescUntil = time.time() + (5*24*3600))
XMLTVImport.reactor.run()
#----------------------------------------------
@@ -59,6 +59,6 @@ def done(reboot=False, epgfile=None):
if len(sys.argv) <= 1:
print "Usage: %s source.xml [...]" % sys.argv[0]
-epgimport = XMLTVImport.XMLTVImport(FakeEnigma(), lambda x: True)
+xmltvimport = XMLTVImport.XMLTVImport(FakeEnigma(), lambda x: True)
for xml in sys.argv[1:]:
- importFrom(epgimport, xml)
+ importFrom(xmltvimport, xml)
View
2  src/XLMTVImport.py
@@ -323,7 +323,7 @@ def isImportRunning(self):
def do_download(self,sourcefile):
path = bigStorage(9000000, '/tmp', '/media/hdd', '/media/usb', '/media/cf')
- filename = os.path.join(path, 'epgimport')
+ filename = os.path.join(path, 'xmltvimport')
if sourcefile.endswith('.gz'):
filename += '.gz'
sourcefile = sourcefile.encode('utf-8')
View
86 src/plugin.py
@@ -26,20 +26,20 @@
from Tools.Directories import resolveFilename, SCOPE_PLUGINS
#Set default configuration
-config.plugins.epgimport = ConfigSubsection()
-config.plugins.epgimport.enabled = ConfigEnableDisable(default = False)
-config.plugins.epgimport.runboot = ConfigEnableDisable(default = False)
-config.plugins.epgimport.wakeupsleep = ConfigEnableDisable(default = False)
-config.plugins.epgimport.wakeup = ConfigClock(default = ((4*60) + 45) * 60) # 4:45
-config.plugins.epgimport.showinplugins = ConfigYesNo(default = False)
-config.plugins.epgimport.showinextensions = ConfigYesNo(default = False)
-config.plugins.epgimport.deepstandby = ConfigSelection(default = "skip", choices = [
+config.plugins.xmltvimport = ConfigSubsection()
+config.plugins.xmltvimport.enabled = ConfigEnableDisable(default = False)
+config.plugins.xmltvimport.runboot = ConfigEnableDisable(default = False)
+config.plugins.xmltvimport.wakeupsleep = ConfigEnableDisable(default = False)
+config.plugins.xmltvimport.wakeup = ConfigClock(default = ((4*60) + 45) * 60) # 4:45
+config.plugins.xmltvimport.showinplugins = ConfigYesNo(default = False)
+config.plugins.xmltvimport.showinextensions = ConfigYesNo(default = False)
+config.plugins.xmltvimport.deepstandby = ConfigSelection(default = "skip", choices = [
("wakeup", _("Wake up and import")),
# ("later", _("Import on next boot")),
("skip", _("Skip the import"))
])
-config.plugins.epgimport.longDescDays = ConfigNumber(default = 5)
-config.plugins.epgimport.sources = ConfigText("", False)
+config.plugins.xmltvimport.longDescDays = ConfigNumber(default = 5)
+config.plugins.xmltvimport.sources = ConfigText("", False)
# Plugin
import XMLTVImport
@@ -49,7 +49,7 @@
from Plugins.Plugin import PluginDescriptor
# historically located (not a problem, we want to update it)
-CONFIG_PATH = '/etc/epgimport'
+CONFIG_PATH = '/etc/xmltvimport'
# Global variable
autoStartTimer = None
@@ -69,7 +69,7 @@ def channelFilter(ref):
print>>log, "Invalid serviceref string:", ref
return False
-epgimport = XMLTVImport.XMLTVImport(enigma.eEPGCache.getInstance(), channelFilter)
+xmltvimport = XMLTVImport.XMLTVImport(enigma.eEPGCache.getInstance(), channelFilter)
lastImportResult = None
@@ -104,7 +104,7 @@ def __init__(self, session, args = 0):
Screen.__init__(self, session)
self.setup_title = _("XMLTV Import Configuration")
Screen.setTitle(self, self.setup_title)
- cfg = config.plugins.epgimport
+ cfg = config.plugins.xmltvimport
self.list = [
getConfigListEntry(_("Daily automatic import"), cfg.enabled),
getConfigListEntry(_("Automatic start time"), cfg.wakeup),
@@ -162,12 +162,12 @@ def save(self):
#print "saving"
self.updateTimer.stop()
self.saveAll()
- if not config.plugins.epgimport.showinplugins.value:
+ if not config.plugins.xmltvimport.showinplugins.value:
for plugin in plugins.getPlugins(PluginDescriptor.WHERE_PLUGINMENU):
if plugin.name == _("XMLTV-Importer"):
plugins.removePlugin(plugin)
- if not config.plugins.epgimport.showinextensions.value:
+ if not config.plugins.xmltvimport.showinextensions.value:
for plugin in plugins.getPlugins(PluginDescriptor.WHERE_EXTENSIONSMENU):
if plugin.name == _("XMLTV-Importer"):
plugins.removePlugin(plugin)
@@ -184,10 +184,10 @@ def cancel(self):
def updateStatus(self):
text = ""
- if epgimport.isImportRunning():
+ if xmltvimport.isImportRunning():
text = _("Importing:")
- src = epgimport.source
- text += " %s\n%s events" % (src.description, epgimport.eventCount)
+ src = xmltvimport.source
+ text += " %s\n%s events" % (src.description, xmltvimport.eventCount)
self["status"].setText(text)
if lastImportResult and (lastImportResult != self.lastImportResult):
start, count = lastImportResult
@@ -200,26 +200,26 @@ def updateStatus(self):
self.lastImportResult = lastImportResult
def doimport(self):
- if epgimport.isImportRunning():
+ if xmltvimport.isImportRunning():
print>>log, "[XMLTVImport] Already running, won't start again"
self.session.open(MessageBox, _("XMLTVImport Plugin\nImport of epg data is still in progress. Please wait."), MessageBox.TYPE_ERROR, timeout = 10, close_on_any_key = True)
return
- cfg = config.plugins.epgimport.sources.getValue().split("|")
+ cfg = config.plugins.xmltvimport.sources.getValue().split("|")
sources = [ s for s in XMLTVConfig.enumSources(CONFIG_PATH, filter = cfg) ]
if not sources:
self.session.open(MessageBox, _("No active EPG sources found, nothing to do"), MessageBox.TYPE_INFO, timeout = 10, close_on_any_key = True)
return
# make it a stack, first on top.
sources.reverse()
- epgimport.sources = sources
+ xmltvimport.sources = sources
self.session.openWithCallback(self.do_import_callback, MessageBox, _("XMLTVImport Plugin\nImport of epg data will start\nThis may take a few minutes\nIs this ok?"), MessageBox.TYPE_YESNO, timeout = 15, default = True)
def do_import_callback(self, confirmed):
if not confirmed:
return
try:
- epgimport.onDone = doneImport
- epgimport.beginImport(longDescUntil = config.plugins.epgimport.longDescDays.value * 24 * 3600 + time.time())
+ xmltvimport.onDone = doneImport
+ xmltvimport.beginImport(longDescUntil = config.plugins.xmltvimport.longDescDays.value * 24 * 3600 + time.time())
except Exception, e:
print>>log, "[XMLTVImport] Error at start:", e
self.session.open(MessageBox, _("XMLTVImport Plugin\nFailed to start:\n") + str(e), MessageBox.TYPE_ERROR, timeout = 15, close_on_any_key = True)
@@ -271,7 +271,7 @@ def __init__(self, session):
self["key_yellow"] = Button() # _("Import now"))
self["key_blue"] = Button()
self.onChangedEntry = []
- filter = config.plugins.epgimport.sources.getValue().split("|")
+ filter = config.plugins.xmltvimport.sources.getValue().split("|")
sources = [
# (description, value, index, selected)
SelectionEntryComponent(x.description, x.description, 0, (filter is None) or (x.description in filter))
@@ -308,8 +308,8 @@ def save(self):
if len(config_string) > 0:
config_string += "|"
config_string += source
- config.plugins.epgimport.sources.setValue(config_string)
- config.plugins.epgimport.sources.save()
+ config.plugins.xmltvimport.sources.setValue(config_string)
+ config.plugins.xmltvimport.sources.save()
configfile.save()
self.close(True, sources)
@@ -368,11 +368,11 @@ def __init__(self, session):
def save(self):
try:
- f = open('/tmp/epgimport.log', 'w')
+ f = open('/tmp/xmltvimport.log', 'w')
f.write(log.getvalue())
f.close()
except Exception, e:
- self["list"].setText("Failed to write /tmp/epgimport.log:str" + str(e))
+ self["list"].setText("Failed to write /tmp/xmltvimport.log:str" + str(e))
self.close(True)
def cancel(self):
@@ -393,9 +393,9 @@ def doneConfiguring(session, retval):
def doneImport(reboot=False, epgfile=None):
global _session, lastImportResult
- lastImportResult = (time.time(), epgimport.eventCount)
+ lastImportResult = (time.time(), xmltvimport.eventCount)
if reboot:
- msg = _("XMLTV Import finished, %d events") % epgimport.eventCount + "\n" + _("You must restart Enigma2 to load the EPG data,\nis this OK?")
+ msg = _("XMLTV Import finished, %d events") % xmltvimport.eventCount + "\n" + _("You must restart Enigma2 to load the EPG data,\nis this OK?")
_session.openWithCallback(restartEnigma, MessageBox, msg, MessageBox.TYPE_YESNO, timeout = 15, default = True)
@@ -427,8 +427,8 @@ def __init__(self, session):
self.timer.callback.append(self.onTimer)
self.update()
def getWakeTime(self):
- if config.plugins.epgimport.enabled.value:
- clock = config.plugins.epgimport.wakeup.value
+ if config.plugins.xmltvimport.enabled.value:
+ clock = config.plugins.xmltvimport.wakeup.value
nowt = time.time()
now = time.localtime(nowt)
return int(time.mktime((now.tm_year, now.tm_mon, now.tm_mday,
@@ -451,13 +451,13 @@ def update(self, atLeast = 0):
return wake
def runImport(self):
- cfg = config.plugins.epgimport.sources.getValue().split("|")
+ cfg = config.plugins.xmltvimport.sources.getValue().split("|")
sources = [ s for s in XMLTVConfig.enumSources(CONFIG_PATH, filter = cfg) ]
if sources:
sources.reverse()
- epgimport.sources = sources
- epgimport.onDone = doneImport
- epgimport.beginImport(longDescUntil = config.plugins.epgimport.longDescDays.value * 24 * 3600 + time.time())
+ xmltvimport.sources = sources
+ xmltvimport.onDone = doneImport
+ xmltvimport.beginImport(longDescUntil = config.plugins.xmltvimport.longDescDays.value * 24 * 3600 + time.time())
def onTimer(self):
self.timer.stop()
@@ -493,7 +493,7 @@ def autostart(reason, session=None, **kwargs):
_session = session
if autoStartTimer is None:
autoStartTimer = AutoStartTimer(session)
- if config.plugins.epgimport.runboot.value:
+ if config.plugins.xmltvimport.runboot.value:
# timer isn't reliable here, damn
onBootStartCheck()
# If WE caused the reboot, put the box back in standby.
@@ -506,8 +506,8 @@ def autostart(reason, session=None, **kwargs):
except:
pass
else:
- if config.plugins.epgimport.deepstandby.value == 'wakeup':
- if config.plugins.epgimport.wakeupsleep.value:
+ if config.plugins.xmltvimport.deepstandby.value == 'wakeup':
+ if config.plugins.xmltvimport.wakeupsleep.value:
print>>log, "[XMLTVImport] Returning to standby"
from Tools import Notifications
Notifications.AddNotification(Screens.Standby.Standby)
@@ -519,7 +519,7 @@ def autostart(reason, session=None, **kwargs):
def getNextWakeup():
"returns timestamp of next time when autostart should be called"
if autoStartTimer:
- if config.plugins.epgimport.deepstandby.value == 'wakeup':
+ if config.plugins.xmltvimport.deepstandby.value == 'wakeup':
print>>log, "[XMLTVImport] Will wake up from deep sleep"
return autoStartTimer.update()
return -1
@@ -538,7 +538,7 @@ def housekeepingExtensionsmenu(el):
print "[XMLTVImport] Failed to update extensions menu:", e
description = _("Automated XMLTV Importer")
-config.plugins.epgimport.showinextensions.addNotifier(housekeepingExtensionsmenu, initial_call = False, immediate_feedback = False)
+config.plugins.xmltvimport.showinextensions.addNotifier(housekeepingExtensionsmenu, initial_call = False, immediate_feedback = False)
extDescriptor = PluginDescriptor(name=_("XMLTV-Importer"), description = description, where = PluginDescriptor.WHERE_EXTENSIONSMENU, fnc = extensionsmenu)
pluginlist = PluginDescriptor(name=_("XMLTV-Importer"), description = description, where = PluginDescriptor.WHERE_PLUGINMENU, icon = 'plugin.png', fnc = main)
@@ -568,9 +568,9 @@ def Plugins(**kwargs):
fnc = epgmenu
),
]
- if config.plugins.epgimport.showinextensions.value:
+ if config.plugins.xmltvimport.showinextensions.value:
result.append(extDescriptor)
- if config.plugins.epgimport.showinplugins.value:
+ if config.plugins.xmltvimport.showinplugins.value:
result.append(pluginlist)
return result
Please sign in to comment.
Something went wrong with that request. Please try again.