summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuo Jinghua <sunmoon1997@gmail.com>2010-11-14 16:32:20 +0800
committerLuo Jinghua <sunmoon1997@gmail.com>2010-11-14 16:32:20 +0800
commit2354adf5ba7397e9aa194729570a1c98d3325c07 (patch)
tree20c5f60164f17c3d506e7723f723769bb9dbcf93
parentc519031081f13376c84367126dcb8fa46b110220 (diff)
ppstream: set cache path to .local/share/totem/ppstream
-rw-r--r--totem/plugin/ppslist2.py5
-rw-r--r--totem/plugin/ppstream.py12
2 files changed, 8 insertions, 9 deletions
diff --git a/totem/plugin/ppslist2.py b/totem/plugin/ppslist2.py
index 8d3053f..1956cef 100644
--- a/totem/plugin/ppslist2.py
+++ b/totem/plugin/ppslist2.py
@@ -28,6 +28,11 @@ MOVIE_URL = 'http://list1.ppstv.com/schs/%d.xml.zip'
CachePath = "/tmp/ppslist2"
opener = urllib2.build_opener(urllib2cache.CacheHandler(CachePath))
+def setCachePath(path):
+ global opener
+ CachePath = path
+ opener = urllib2.build_opener(urllib2cache.CacheHandler(CachePath))
+
def download(url, max_retry = 3, interval = 5):
if not url:
return ''
diff --git a/totem/plugin/ppstream.py b/totem/plugin/ppstream.py
index b2598ad..57c7da8 100644
--- a/totem/plugin/ppstream.py
+++ b/totem/plugin/ppstream.py
@@ -74,7 +74,7 @@ for p in [ pps_xmls_dir, pps_images_dir ]:
if not os.path.exists (p):
os.makedirs (p)
-ppslist.CachePath = pps_http_cache_dir
+ppslist.setCachePath(pps_http_cache_dir)
### special category ids
CATEGORY_ID_FAVORITES = 0
@@ -372,7 +372,7 @@ class PPStream (totem.Plugin):
totem_object.add_sidebar_page ("ppstream", _("PPStream"), self.vbox)
- self.threadpool = threadpool.ThreadPool(8)
+ self.threadpool = threadpool.ThreadPool(4)
self.imagedownloader = ImageDownloader ()
self.imagedownloader.start ()
@@ -660,11 +660,7 @@ class PPStream (totem.Plugin):
def parse_movie_meta_data(self, res, class_path, movie, count):
print 'parsing movie meta data:', movie
cls = self.get_movie_class (class_path)
- if cls.desc_url:
- cls.parseMetaData(res)
- movie.updateMetaData(cls.meta_data)
- else:
- movie.parseBKMetaData(res)
+ movie.parseBKMetaData(res)
#print 'meta data:', movie.meta_data
def on_movie_meta_data_parsed(self, dummy, class_path, movie, count):
@@ -691,8 +687,6 @@ class PPStream (totem.Plugin):
def __fetch_movie_meta_data(self, dummy, class_path, movie, *args):
cls = self.get_movie_class (class_path)
- if cls.desc_url:
- return cls.fetchMetaData()
return movie.fetchBKMetaData()
def fetch_movie_meta_data(self, class_path, movie):