aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorghost <andreas.monzner@multimedia-labs.de>2009-05-12 12:54:28 +0200
committerghost <andreas.monzner@multimedia-labs.de>2009-05-12 12:54:28 +0200
commit25461d876436a7332decd6ac5cbbda7cd38f6cdd (patch)
tree5a667553ac685751d2e5ba518cd02dde12a4d894
parent75b6f719972578d2bc553db3f30fa8a86c440df7 (diff)
parentb4f81157894ee05e23eafa5ff6accbdc280d9cc6 (diff)
downloadenigma2-25461d876436a7332decd6ac5cbbda7cd38f6cdd.tar.gz
enigma2-25461d876436a7332decd6ac5cbbda7cd38f6cdd.zip
Merge branch 'master' of git.opendreambox.org:/git/enigma2
-rw-r--r--lib/python/Components/Converter/ServicePosition.py14
-rw-r--r--lib/python/Plugins/SystemPlugins/NFIFlash/downloader.py52
-rw-r--r--lib/python/Tools/Downloader.py53
-rw-r--r--lib/python/Tools/Makefile.am3
-rw-r--r--lib/service/servicemp3.cpp4
5 files changed, 66 insertions, 60 deletions
diff --git a/lib/python/Components/Converter/ServicePosition.py b/lib/python/Components/Converter/ServicePosition.py
index b92af40b..56a6db67 100644
--- a/lib/python/Components/Converter/ServicePosition.py
+++ b/lib/python/Components/Converter/ServicePosition.py
@@ -21,11 +21,6 @@ class ServicePosition(Converter, Poll, object):
self.showHours = 'ShowHours' in args
self.showNoSeconds = 'ShowNoSeconds' in args
- if self.detailed:
- self.poll_interval = 100
- else:
- self.poll_interval = 500
-
if type == "Length":
self.type = self.TYPE_LENGTH
elif type == "Position":
@@ -37,7 +32,14 @@ class ServicePosition(Converter, Poll, object):
else:
raise ElementError("type must be {Length|Position|Remaining|Gauge} with optional arguments {Negate|Detailed|ShowHours|ShowNoSeconds} for ServicePosition converter")
- self.poll_enabled = self.type != self.TYPE_LENGTH
+ if self.detailed:
+ self.poll_interval = 100
+ elif self.type == self.TYPE_LENGTH:
+ self.poll_interval = 2000
+ else:
+ self.poll_interval = 500
+
+ self.poll_enabled = True
def getSeek(self):
s = self.source.service
diff --git a/lib/python/Plugins/SystemPlugins/NFIFlash/downloader.py b/lib/python/Plugins/SystemPlugins/NFIFlash/downloader.py
index c91c8588..6d404cf2 100644
--- a/lib/python/Plugins/SystemPlugins/NFIFlash/downloader.py
+++ b/lib/python/Plugins/SystemPlugins/NFIFlash/downloader.py
@@ -16,6 +16,7 @@ from enigma import eConsoleAppContainer, eListbox, gFont, eListboxPythonMultiCon
from os import system, remove
import re
import urllib
+from Tools.Downloader import downloadWithProgress
from twisted.web import client
from twisted.internet import reactor, defer
from twisted.python import failure
@@ -24,57 +25,6 @@ from Plugins.SystemPlugins.Hotplug.plugin import hotplugNotifier
class UserRequestedCancel(Exception):
pass
-class HTTPProgressDownloader(client.HTTPDownloader):
- def __init__(self, url, outfile, headers=None):
- client.HTTPDownloader.__init__(self, url, outfile, headers=headers, agent="Dreambox .NFI Download Plugin")
- self.status = None
- self.progress_callback = None
- self.deferred = defer.Deferred()
-
- def noPage(self, reason):
- if self.status == "304":
- print reason.getErrorMessage()
- client.HTTPDownloader.page(self, "")
- else:
- client.HTTPDownloader.noPage(self, reason)
-
- def gotHeaders(self, headers):
- if self.status == "200":
- if headers.has_key("content-length"):
- self.totalbytes = int(headers["content-length"][0])
- else:
- self.totalbytes = 0
- self.currentbytes = 0.0
- return client.HTTPDownloader.gotHeaders(self, headers)
-
- def pagePart(self, packet):
- if self.status == "200":
- self.currentbytes += len(packet)
- if self.totalbytes and self.progress_callback:
- self.progress_callback(self.currentbytes, self.totalbytes)
- return client.HTTPDownloader.pagePart(self, packet)
-
- def pageEnd(self):
- return client.HTTPDownloader.pageEnd(self)
-
-class downloadWithProgress:
- def __init__(self, url, outputfile, contextFactory=None, *args, **kwargs):
- scheme, host, port, path = client._parse(url)
- self.factory = HTTPProgressDownloader(url, outputfile, *args, **kwargs)
- self.connection = reactor.connectTCP(host, port, self.factory)
-
- def start(self):
- return self.factory.deferred
-
- def stop(self):
- print "[stop]"
- self.connection.disconnect()
- #self.factory.deferred.errback(failure.Failure(UserRequestedCancel))
-
- def addProgress(self, progress_callback):
- print "[addProgress]"
- self.factory.progress_callback = progress_callback
-
class Feedlist(MenuList):
def __init__(self, list=[], enableWrapAround = False):
MenuList.__init__(self, list, enableWrapAround, eListboxPythonMultiContent)
diff --git a/lib/python/Tools/Downloader.py b/lib/python/Tools/Downloader.py
new file mode 100644
index 00000000..ffc24c1c
--- /dev/null
+++ b/lib/python/Tools/Downloader.py
@@ -0,0 +1,53 @@
+from twisted.web import client
+from twisted.internet import reactor, defer
+from twisted.python import failure
+
+class HTTPProgressDownloader(client.HTTPDownloader):
+ def __init__(self, url, outfile, headers=None):
+ client.HTTPDownloader.__init__(self, url, outfile, headers=headers, agent="Dreambox HTTP Downloader")
+ self.status = None
+ self.progress_callback = None
+ self.deferred = defer.Deferred()
+
+ def noPage(self, reason):
+ if self.status == "304":
+ print reason.getErrorMessage()
+ client.HTTPDownloader.page(self, "")
+ else:
+ client.HTTPDownloader.noPage(self, reason)
+
+ def gotHeaders(self, headers):
+ if self.status == "200":
+ if headers.has_key("content-length"):
+ self.totalbytes = int(headers["content-length"][0])
+ else:
+ self.totalbytes = 0
+ self.currentbytes = 0.0
+ return client.HTTPDownloader.gotHeaders(self, headers)
+
+ def pagePart(self, packet):
+ if self.status == "200":
+ self.currentbytes += len(packet)
+ if self.totalbytes and self.progress_callback:
+ self.progress_callback(self.currentbytes, self.totalbytes)
+ return client.HTTPDownloader.pagePart(self, packet)
+
+ def pageEnd(self):
+ return client.HTTPDownloader.pageEnd(self)
+
+class downloadWithProgress:
+ def __init__(self, url, outputfile, contextFactory=None, *args, **kwargs):
+ scheme, host, port, path = client._parse(url)
+ self.factory = HTTPProgressDownloader(url, outputfile, *args, **kwargs)
+ self.connection = reactor.connectTCP(host, port, self.factory)
+
+ def start(self):
+ return self.factory.deferred
+
+ def stop(self):
+ print "[stop]"
+ self.connection.disconnect()
+
+ def addProgress(self, progress_callback):
+ print "[addProgress]"
+ self.factory.progress_callback = progress_callback
diff --git a/lib/python/Tools/Makefile.am b/lib/python/Tools/Makefile.am
index fd23bd12..e7904d66 100644
--- a/lib/python/Tools/Makefile.am
+++ b/lib/python/Tools/Makefile.am
@@ -4,4 +4,5 @@ install_PYTHON = \
FuzzyDate.py XMLTools.py Directories.py NumericalTextInput.py \
KeyBindings.py BoundFunction.py ISO639.py Notifications.py __init__.py \
RedirectOutput.py DreamboxHardware.py Import.py Event.py CList.py \
- LoadPixmap.py Profile.py HardwareInfo.py Transponder.py ASCIItranslit.py
+ LoadPixmap.py Profile.py HardwareInfo.py Transponder.py ASCIItranslit.py \
+ Downloader.py
diff --git a/lib/service/servicemp3.cpp b/lib/service/servicemp3.cpp
index 79098f2c..5ac413b1 100644
--- a/lib/service/servicemp3.cpp
+++ b/lib/service/servicemp3.cpp
@@ -702,7 +702,7 @@ int eServiceMP3::getInfo(int w)
std::string eServiceMP3::getInfoString(int w)
{
- if ( !m_stream_tags )
+ if ( !m_stream_tags && w < sUser && w > 26 )
return "";
gchar *tag = 0;
switch (w)
@@ -800,7 +800,6 @@ std::string eServiceMP3::getInfoString(int w)
case sTagChannelMode:
tag = "channel-mode";
break;
-
case sUser+12:
return m_error_message;
default:
@@ -1128,6 +1127,7 @@ eDebug("AUDIO STRUCT=%s", g_type);
g_free (g_lang);
// g_free (g_type);
}
+ m_event((iPlayableService*)this, evUpdatedEventInfo);
}
case GST_MESSAGE_ELEMENT:
{