continuing on the difficult comic
authorMarcus W <mece@LeChuck2.(none)>
Wed, 3 Feb 2010 22:25:15 +0000 (00:25 +0200)
committerMarcus W <mece@LeChuck2.(none)>
Wed, 3 Feb 2010 22:25:15 +0000 (00:25 +0200)
src/usr/lib/hildon-desktop/comicwidget.py

index 033ad47..957b52c 100644 (file)
@@ -375,6 +375,7 @@ class ComicDb():
                                else:
                                        splt = string.split(splt[1], '/">< ', 1)
                                        prev = splt[0];
+                                       print "got prev: " + prev
                                splt = string.split(s, 'Previous</a> | <a href="/comics/', 1)
                                if len(splt) < 2:
                                        print "last comic?"
@@ -385,6 +386,7 @@ class ComicDb():
                                                next = False
                                        else:
                                                next = splt[0]
+                                               print "got next: " + next
 
                                splt = string.split(s, '</tr><tr><td colspan=2>', 1)
                                if len(splt) < 2:
@@ -392,12 +394,15 @@ class ComicDb():
                                        return False
                                splt = string.split(splt[1], ' <b>by <a href="', 1)
                                title = splt[0];
+                               if len(title) > 10:
+                                       print "title wrong..."
+                                       return False
                                splt = string.split(splt[1], 'a daily webcomic" src="http://www.explosm', 1)
                                if len(splt) < 2:
                                        print "a video? Try skipping"
                                        return ['skip',next,prev]
                                        
-                               splt = string.split(splt[1], '"></div><br />', 1)
+                               splt = string.split(splt[1], '">', 1)
                                url = "http://www.explosm" + splt[0]
                                splt2 = string.rsplit(url, "/", 1)
                                filename = splt2[1]
@@ -715,6 +720,7 @@ class ComicHomePlugin(hildondesktop.HomePluginItem):
                        if scaled_buf.get_height() - (vpos + maxheight) < 0:
                                vpos = scaled_buf.get_height() - maxheight
                        scaled_buf.copy_area(0,vpos,478,maxheight,parent_buf,1,0)
+                       # parent_buf.composite(scaled_buf, 0, 0, 478, maxheight, 0, 0, 478, maxheight, gtk.gdk.INTERP_BILINEAR, 0)
                        self.imgvpos = vpos
                else:
                        tmpy = maxheight - scaled_buf.get_height()
@@ -723,7 +729,10 @@ class ComicHomePlugin(hildondesktop.HomePluginItem):
 
                        scaled_buf.copy_area(0,0,478,scaled_buf.get_height(),parent_buf,1,tmpy)
                        self.imgvpos = 0
+#              test = parent_buf.render_pixmap_and_mask(0)
+               parent_buf.add_alpha(True,chr(255),chr(255),chr(255))
                retimg.set_from_pixbuf(parent_buf)
+               print retimg.get_pixel_size()
                print "vpos after fixing image: " + str(self.imgvpos)
                return retimg