0.5.4-0 stable version.
authorYves <ymarcoz@n900-sdk.(none)>
Wed, 24 Mar 2010 05:24:59 +0000 (22:24 -0700)
committerYves <ymarcoz@n900-sdk.(none)>
Wed, 24 Mar 2010 05:24:59 +0000 (22:24 -0700)
debian/changelog
src/FeedingIt
src/FeedingIt.py
src/config.py
src/feedingitdbus.py
src/rss.py

index 15a9dde..f035417 100644 (file)
@@ -1,3 +1,12 @@
+feedingit (0.5.4-0) stable; urgency=low
+
+  * Added link to known issues in the Preferences menu
+  * Fixed dbus calls
+  * Changed button size in Organize Feed menu
+  * Added proxy support for image downloads
+ -- Yves <yves@marcoz.org>  Wed, 23 Mar 2010 20:56:19 -0800
+
 feedingit (0.5.3-4) unstable; urgency=low
 
   * Fixed text selection when panning (#5103)
index d0856d8..a0160e4 100644 (file)
@@ -1,3 +1,13 @@
 #!/bin/sh
-cd /opt/FeedingIt
-python2.5 FeedingIt.py
\ No newline at end of file
+case "$1" in
+update)
+    dbus-send --print-reply --dest='org.maemo.feedingit' --session /org/maemo/feedingit org.maemo.feedingit.Update
+    ;;
+status)
+    dbus-send --print-reply --dest='org.maemo.feedingit' --session /org/maemo/feedingit org.maemo.feedingit.GetStatus
+    ;;
+*)
+    cd /opt/FeedingIt
+    python2.5 FeedingIt.py
+    ;;
+esac
\ No newline at end of file
index 020d035..5f79687 100644 (file)
@@ -19,7 +19,7 @@
 # ============================================================================
 # Name        : FeedingIt.py
 # Author      : Yves Marcoz
-# Version     : 0.5.2
+# Version     : 0.5.4
 # Description : Simple RSS Reader
 # ============================================================================
 
@@ -56,7 +56,8 @@ timeout = 5
 socket.setdefaulttimeout(timeout)
 
 color_style = gtk.rc_get_style_by_paths(gtk.settings_get_default() , 'GtkButton', 'osso-logical-colors', gtk.Button)
-fg_color = color_style.lookup_color('ActiveTextColor')
+unread_color = color_style.lookup_color('ActiveTextColor')
+read_color = color_style.lookup_color('DefaultTextColor')
 del color_style
 
 CONFIGDIR="/home/user/.feedingit/"
@@ -236,27 +237,27 @@ class SortList(gtk.Dialog):
         
         self.vbox2 = gtk.VBox(False, 10)
         
-        button = hildon.GtkButton(gtk.HILDON_SIZE_AUTO)
+        button = hildon.GtkButton(gtk.HILDON_SIZE_FINGER_HEIGHT)
         button.set_label("Move Up")
         button.connect("clicked", self.buttonUp)
         self.vbox2.pack_start(button, expand=False, fill=False)
         
-        button = hildon.GtkButton(gtk.HILDON_SIZE_AUTO)
+        button = hildon.GtkButton(gtk.HILDON_SIZE_FINGER_HEIGHT)
         button.set_label("Move Down")
         button.connect("clicked", self.buttonDown)
         self.vbox2.pack_start(button, expand=False, fill=False)
 
-        button = hildon.GtkButton(gtk.HILDON_SIZE_AUTO)
+        button = hildon.GtkButton(gtk.HILDON_SIZE_FINGER_HEIGHT)
         button.set_label("Add Feed")
         button.connect("clicked", self.buttonAdd)
         self.vbox2.pack_start(button, expand=False, fill=False)
 
-        button = hildon.GtkButton(gtk.HILDON_SIZE_AUTO)
+        button = hildon.GtkButton(gtk.HILDON_SIZE_FINGER_HEIGHT)
         button.set_label("Edit Feed")
         button.connect("clicked", self.buttonEdit)
         self.vbox2.pack_start(button, expand=False, fill=False)
         
-        button = hildon.GtkButton(gtk.HILDON_SIZE_AUTO)
+        button = hildon.GtkButton(gtk.HILDON_SIZE_FINGER_HEIGHT)
         button.set_label("Delete")
         button.connect("clicked", self.buttonDelete)
         self.vbox2.pack_start(button, expand=False, fill=False)
@@ -566,15 +567,11 @@ class DisplayFeed(hildon.StackableWindow):
             if self.feed.isEntryRead(id):
                 #label.modify_font(pango.FontDescription("sans 16"))
                 label.modify_font(pango.FontDescription(self.config.getReadFont()))
-                label.modify_fg(gtk.STATE_NORMAL, gtk.gdk.color_parse("white"))
+                label.modify_fg(gtk.STATE_NORMAL, read_color) # gtk.gdk.color_parse("white"))
             else:
                 #print self.listing.getFont() + " bold"
                 label.modify_font(pango.FontDescription(self.config.getUnreadFont()))
-                #label.modify_fg(gtk.STATE_NORMAL, gtk.gdk.color_parse("SkyBlue"))
-                #fg_color = fg_button.child.get_children()[0].get_children()[0].get_children()[1].get_style().fg[gtk.STATE_NORMAL]
-                label.modify_fg(gtk.STATE_NORMAL, fg_color)
-                #label.modify_font(pango.FontDescription("sans bold 23"))
-                #"sans bold 16"
+                label.modify_fg(gtk.STATE_NORMAL, unread_color)
             label.set_line_wrap(True)
             
             label.set_size_request(self.get_size()[0]-50, -1)
@@ -601,25 +598,11 @@ class DisplayFeed(hildon.StackableWindow):
             gobject.timeout_add(200, self.destroyArticle, tmp)
             #print "previous"
             self.disp = newDisp
-            
-            #stack.push(tmp)
-            #if not self.disp == False:
-            #   self.disp.destroyWindow()
         elif next:
-            #print type(self.disp).__name__
-
-                #self.disp.destroyWindow()
-                #stack.pop_and_push(1,newDisp)
-            #else:
-            #    stack.push(newDisp)
-            #self.disp = newDisp
             newDisp.show_all()
             if type(self.disp).__name__ == "DisplayArticle":
                 gobject.timeout_add(200, self.destroyArticle, self.disp)
             self.disp = newDisp
-            #self.disp.show_all()
-            #if not self.disp == False:
-            #    self.disp.destroyWindow()
         else:
             self.disp = newDisp
             self.disp.show_all()
@@ -635,21 +618,21 @@ class DisplayFeed(hildon.StackableWindow):
     def nextArticle(self, object, index):
         label = self.buttons[index].child
         label.modify_font(pango.FontDescription(self.config.getReadFont()))
-        label.modify_fg(gtk.STATE_NORMAL, gtk.gdk.color_parse("white"))
+        label.modify_fg(gtk.STATE_NORMAL, read_color) #  gtk.gdk.color_parse("white"))
         id = self.feed.getNextId(index)
         self.button_clicked(object, id, next=True)
 
     def previousArticle(self, object, index):
         label = self.buttons[index].child
         label.modify_font(pango.FontDescription(self.config.getReadFont()))
-        label.modify_fg(gtk.STATE_NORMAL, gtk.gdk.color_parse("white"))
+        label.modify_fg(gtk.STATE_NORMAL, read_color) # gtk.gdk.color_parse("white"))
         id = self.feed.getPreviousId(index)
         self.button_clicked(object, id, previous=True)
 
     def onArticleClosed(self, object, index):
         label = self.buttons[index].child
         label.modify_font(pango.FontDescription(self.config.getReadFont()))
-        label.modify_fg(gtk.STATE_NORMAL, gtk.gdk.color_parse("white"))
+        label.modify_fg(gtk.STATE_NORMAL, read_color) # gtk.gdk.color_parse("white"))
         self.buttons[index].show()
 
     def button_update_clicked(self, button):
@@ -667,16 +650,13 @@ class DisplayFeed(hildon.StackableWindow):
         self.vbox.destroy()
         self.feed = self.listing.getFeed(self.key)
         self.displayFeed()
-        #self.feed.updateFeed()
-    #    self.clear()
-    #    self.displayFeed()
         
     def buttonReadAllClicked(self, button):
         for index in self.feed.getIds():
             self.feed.setEntryRead(index)
             label = self.buttons[index].child
             label.modify_font(pango.FontDescription(self.config.getReadFont()))
-            label.modify_fg(gtk.STATE_NORMAL, gtk.gdk.color_parse("white"))
+            label.modify_fg(gtk.STATE_NORMAL, read_color) # gtk.gdk.color_parse("white"))
             self.buttons[index].show()
 
 
@@ -743,7 +723,7 @@ class FeedingIt:
         self.autoupdate = False
         self.checkAutoUpdate()
         hildon.hildon_gtk_window_set_progress_indicator(self.window, 0)
-        gobject.idle_add(self.enabelDbus)
+        gobject.idle_add(self.enableDbus)
         
     def enableDbus(self):
         dbusHandler = ServerObject(self)
@@ -854,18 +834,12 @@ class FeedingIt:
         self.disp.connect("feed-closed", self.onFeedClosed)
 
     def onFeedClosed(self, object, key):
-        #self.displayListing()
         self.listing.saveConfig()
         self.refreshList()
-        #self.buttons[key].set_text(self.listing.getFeedTitle(key), self.listing.getFeedUpdateTime(key) + " / " 
-        #                    + str(self.listing.getFeedNumberOfUnreadItems(key)) + " Unread Items")
-        #self.buttons[key].show()
      
     def run(self):
         self.window.connect("destroy", gtk.main_quit)
         gtk.main()
-        #for key in self.listing.getListOfFeeds():
-        #    self.listing.getFeed(key).saveFeed(CONFIGDIR)
         self.listing.saveConfig()
 
     def prefsClosed(self, *widget):
index 987b551..eabaf8d 100644 (file)
@@ -19,7 +19,7 @@
 # ============================================================================
 # Name        : FeedingIt.py
 # Author      : Yves Marcoz
-# Version     : 0.4.3
+# Version     : 0.5.4
 # Description : Simple RSS Reader
 # ============================================================================
 
@@ -30,6 +30,8 @@ import gobject
 import gconf
 import urllib2
 
+VERSION = "0.5.4"
+
 section = "FeedingIt"
 ranges = { "updateInterval":[0.5, 1, 2, 4, 12, 24], "expiry":[24, 48, 72], "fontSize":range(12,24), "orientation":["Automatic", "Landscape", "Portrait"], "artFontSize":[10, 12, 14, 16, 18, 20]}
 titles = {"updateInterval":"Auto-update Interval", "expiry":"Expiry For Articles", "fontSize":"Font Size For Article Listing", "orientation":"Display Orientation", "artFontSize":"Font Size For Articles"}
@@ -74,6 +76,13 @@ class Config():
         button.connect("toggled", self.button_toggled, "imageCache")
         vbox.pack_start(button, expand=False)
         
+        button = hildon.Button(gtk.HILDON_SIZE_FINGER_HEIGHT, hildon.BUTTON_ARRANGEMENT_VERTICAL)
+        button.set_label("View Known Issues and Tips")
+        button.connect("clicked", self.button_tips_clicked)
+        button.set_alignment(0,0,1,1)
+        vbox.pack_start(button, expand=False)
+        
+        
         panArea.add_with_viewport(vbox)
         
         self.window.vbox.add(panArea)        
@@ -82,6 +91,13 @@ class Config():
         self.window.show_all()
         return self.window
 
+    def button_tips_clicked(self, *widget):
+        import dbus
+        bus = dbus.SessionBus()
+        proxy = bus.get_object("com.nokia.osso_browser", "/com/nokia/osso_browser/request")
+        iface = dbus.Interface(proxy, 'com.nokia.osso_browser')
+        iface.open_new_window("http://feedingit.marcoz.org/%s.html" % VERSION)
+
     def onExit(self, *widget):
         self.saveConfig()
         self.window.destroy()
index 6371939..e6fd0bd 100644 (file)
@@ -19,7 +19,7 @@
 # ============================================================================
 # Name        : FeedingIt.py
 # Author      : Yves Marcoz
-# Version     : 0.4.3
+# Version     : 0.5.4
 # Description : Simple RSS Reader
 # ============================================================================
 
@@ -46,5 +46,5 @@ class ServerObject(dbus.service.Object):
     
     @dbus.service.method('org.maemo.feedingit')
     def Update(self):
-        self.app.button_update_clicked(None, None)
+        self.app.automaticUpdate()
         return "Done"
index 5ccaefa..a680ddc 100644 (file)
@@ -19,7 +19,7 @@
 # ============================================================================
 # Name        : FeedingIt.py
 # Author      : Yves Marcoz
-# Version     : 0.5.2
+# Version     : 0.5.4
 # Description : Simple RSS Reader
 # ============================================================================
 
@@ -40,6 +40,21 @@ from urlparse import urlparse
 def getId(string):
     return md5.new(string).hexdigest()
 
+def getProxy():
+    import gconf
+    if gconf.client_get_default().get_bool('/system/http_proxy/use_http_proxy'):
+        port = gconf.client_get_default().get_int('/system/http_proxy/port')
+        http = gconf.client_get_default().get_string('/system/http_proxy/host')
+        proxy = proxy = urllib2.ProxyHandler( {"http":"http://%s:%s/"% (http,port)} )
+        return (True, proxy)
+    return (False, None)
+
+# Enable proxy support for images and ArchivedArticles
+(proxy_support, proxy) = getProxy()
+if proxy_support:
+    opener = urllib2.build_opener(proxy)
+    urllib2.install_opener(opener)
+
 # Entry = {"title":XXX, "content":XXX, "date":XXX, "link":XXX, images = [] }
 
 class ImageHandler:
@@ -456,20 +471,7 @@ class Listing:
                 self.sortedKeys.remove("font")
             self.sortedKeys.sort(key=lambda obj: self.getFeedTitle(obj))
         list = self.sortedKeys[:]
-        #for key in list:
-        #    try:
-        #        self.loadFeed(key)
-        #    except:
-                #import traceback
-                #if key.startswith('d8'):
-                #traceback.print_exc()
-        #        self.sortedKeys.remove(key)
-            #print key
-                #print key in self.sortedKeys
-        #print "d8eb3f07572892a7b5ed9c81c5bb21a2" in self.sortedKeys
-        #print self.listOfFeeds["d8eb3f07572892a7b5ed9c81c5bb21a2"]
         self.closeCurrentlyDisplayedFeed()
-        #self.saveConfig()
 
     def addArchivedArticle(self, key, index):
         feed = self.getFeed(key)
@@ -554,12 +556,6 @@ class Listing:
     def getListOfFeeds(self):
         return self.sortedKeys
     
-    #def getNumberOfUnreadItems(self, key):
-    #    if self.listOfFeeds.has_key("unread"):
-    #       return self.listOfFeeds[key]["unread"]
-    #    else:
-    #       return 0
-    
     def addFeed(self, title, url):
         if not self.listOfFeeds.has_key(getId(title)):
             self.listOfFeeds[getId(title)] = {"title":title, "url":url, "unread":0, "updateTime":"Never"}