Skip to content
This repository has been archived by the owner on Feb 18, 2018. It is now read-only.

Commit

Permalink
finally fixed anomaly when no channel files are available
Browse files Browse the repository at this point in the history
  • Loading branch information
WanWizard committed Aug 21, 2017
1 parent fb321d2 commit a64fbeb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/EPGImport/EPGImport.py
Expand Up @@ -239,19 +239,19 @@ def fileno(self):

def doThreadRead(self, filename):
'This is used on PLi with threading'
for data in self.createIterator(filename):
if data is not None:
self.eventCount += 1
try:
r,d = data
if d[0] > self.longDescUntil:
# Remove long description (save RAM memory)
d = d[:4] + ('',) + d[5:]
self.storage.importEvents(r, (d,))
except Exception, e:
print>>log, "[EPGImport] ### importEvents exception:", e
print>>log, "[EPGImport] ### thread is ready ### Events:", self.eventCount
if filename:
for data in self.createIterator(filename):
if data is not None:
self.eventCount += 1
try:
r,d = data
if d[0] > self.longDescUntil:
# Remove long description (save RAM memory)
d = d[:4] + ('',) + d[5:]
self.storage.importEvents(r, (d,))
except Exception, e:
print>>log, "[EPGImport] ### importEvents exception:", e
print>>log, "[EPGImport] ### thread is ready ### Events:", self.eventCount
try:
os.unlink(filename)
except Exception, e:
Expand Down
3 changes: 3 additions & 0 deletions src/EPGImport/xmltvconverter.py
Expand Up @@ -64,6 +64,9 @@ def __init__(self, channels_dict, category_dict, dateformat = '%Y%m%d%H%M%S %Z')
def enumFile(self, fileobj):
print>>log, "[XMLTVConverter] Enumerating event information"
lastUnknown = None
# there is nothing no enumerate if there are no channels loaded
if not self.channels:
return
for elem in enumerateProgrammes(fileobj):
channel = elem.get('channel')
if not channel in self.channels:
Expand Down

0 comments on commit a64fbeb

Please sign in to comment.