Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 29588 | Differences between
and this patch

Collapse All | Expand All

(-)/var/tmp/portage/desklet-rssgrab-0.4/image/usr/share/gdesklets/Sensors/rssgrab/__init__.py (-14 / +36 lines)
Lines 32-37 Link Here
32
32
33
        # initial default values
33
        # initial default values
34
        self.__maintitle = "Connecting\n(updated @ 00:00)"
34
        self.__maintitle = "Connecting\n(updated @ 00:00)"
35
        self.__mainlink = ""
35
        self.__lutime = "00:00"
36
        self.__lutime = "00:00"
36
37
37
        # create vars
38
        # create vars
Lines 44-58 Link Here
44
            self.__wrapper.initial_indent = "[$] "
45
            self.__wrapper.initial_indent = "[$] "
45
46
46
        # Default values for config
47
        # Default values for config
47
        self._set_config_type("url", TYPE_STRING, "http://www.slashdot.org/index.rss")
48
        self._set_config_type("url", TYPE_STRING, "http://packages.gentoo.org/gentoo_simple.rss")
48
        self._set_config_type("browser", TYPE_STRING, "mozilla")
49
        self._set_config_type("image", TYPE_STRING, "http://www.gentoo.org/images/powered-by-gentoo2.jpg")
49
        self._set_config_type("update", TYPE_INT, 30)
50
        self._set_config_type("browser", TYPE_STRING, "epiphany")
51
        self._set_config_type("update", TYPE_INT, 60)
50
        self._set_config_type("wrapwidth", TYPE_INT, 34)
52
        self._set_config_type("wrapwidth", TYPE_INT, 34)
51
        self._set_config_type("font", TYPE_STRING, "Arial 12")
53
        self._set_config_type("font", TYPE_STRING, "Sans 8")
52
        self._set_config_type("fontcolor", TYPE_STRING, "#00FF00")
54
        self._set_config_type("fontcolor", TYPE_STRING, "#3D2D6D")
53
        self._set_config_type("titlefont", TYPE_STRING, "Arial 14")
55
        self._set_config_type("titlefont", TYPE_STRING, "Sans Bold 10")
54
        self._set_config_type("titlefontcolor", TYPE_STRING, "#FFFF00")
56
        self._set_config_type("titlefontcolor", TYPE_STRING, "#F0EDFF")
55
        self._set_config_type("highlightfont", TYPE_STRING, "Arial 14")
57
        self._set_config_type("highlightfont", TYPE_STRING, "Sans 8")
56
        self._set_config_type("highlightfontcolor", TYPE_STRING, "#FFFFFF")
58
        self._set_config_type("highlightfontcolor", TYPE_STRING, "#FFFFFF")
57
59
58
        # go grab the feed
60
        # go grab the feed
Lines 78-86 Link Here
78
80
79
            # Get the channel name
81
            # Get the channel name
80
            if rssdata['channel'].has_key('title'):
82
            if rssdata['channel'].has_key('title'):
81
                self.__maintitle="%s\n(updated @ %s)" % (rssdata['channel']['title'], time.strftime("%H:%M"))
83
                self.__maintitle="%s @ %s" % (rssdata['channel']['title'], time.strftime("%H:%M"))
82
            else:
84
            else:
83
                self.__maintitle="Title not found\n(updated @ %s)" % time.strftime("%H:%M")
85
                self.__maintitle="Title not found\n(updated @ %s)" % time.strftime("%H:%M")
86
            if rssdata['channel'].has_key('link'):
87
                self.__mainlink=rssdata['channel']['link']
88
            else:
89
                self.__mainlink=""
84
90
85
            # Clear the arrays
91
            # Clear the arrays
86
            self.__titles [0:] = []
92
            self.__titles [0:] = []
Lines 116-121 Link Here
116
        # Send the title to the display
122
        # Send the title to the display
117
        output = self._new_output()
123
        output = self._new_output()
118
        output.set("name", self.__maintitle)
124
        output.set("name", self.__maintitle)
125
        output.set("image", self._get_config("image"))
119
        output.set("namefont", self._get_config("titlefont"))
126
        output.set("namefont", self._get_config("titlefont"))
120
        output.set("namecolor", self._get_config("titlefontcolor"))
127
        output.set("namecolor", self._get_config("titlefontcolor"))
121
128
Lines 135-142 Link Here
135
    # override this ethod to enable user interaction
142
    # override this ethod to enable user interaction
136
    def call_action(self, action, path, args = []):
143
    def call_action(self, action, path, args = []):
137
144
138
        index = int(path[-1])
145
        if (action == "mainlaunch"):
139
        if (action == "launch"):
146
            try:
147
                # open the link in specified browser
148
                browser = self._get_config("browser");
149
                url = self.__mainlink
150
151
                if (url != ""):
152
                    os.system("%s %s" % (browser,url))
153
154
            except:
155
                  print "could not open", url
156
157
        elif (action == "launch"):
158
            index = int(path[-1])
140
            try:
159
            try:
141
                # open the link in specified browser
160
                # open the link in specified browser
142
                browser = self._get_config("browser");
161
                browser = self._get_config("browser");
Lines 145-153 Link Here
145
                os.system("%s %s" % (browser,url))
164
                os.system("%s %s" % (browser,url))
146
165
147
            except:
166
            except:
148
                  print "could not open", uri
167
                  print "could not open", url
149
168
150
        elif (action == "leave"):
169
        elif (action == "leave"):
170
            index = int(path[-1])
151
            output = self._new_output()
171
            output = self._new_output()
152
            output.set("item_value[%(index)d]" % vars(), self.__titles[index])
172
            output.set("item_value[%(index)d]" % vars(), self.__titles[index])
153
            output.set("font[%(index)d]" % vars(), self._get_config("font"))
173
            output.set("font[%(index)d]" % vars(), self._get_config("font"))
Lines 155-160 Link Here
155
            self._send_output(output)
175
            self._send_output(output)
156
176
157
        elif (action == "enter"):
177
        elif (action == "enter"):
178
            index = int(path[-1])
158
            output = self._new_output()
179
            output = self._new_output()
159
            output.set("item_value[%(index)d]" % vars(), self.__titles[index])
180
            output.set("item_value[%(index)d]" % vars(), self.__titles[index])
160
            output.set("font[%(index)d]" % vars(), self._get_config("highlightfont"))
181
            output.set("font[%(index)d]" % vars(), self._get_config("highlightfont"))
Lines 168-177 Link Here
168
        conf1.set_name(_("Rss Settings"))
189
        conf1.set_name(_("Rss Settings"))
169
        conf1.add_title(_("Rss Source URL"))
190
        conf1.add_title(_("Rss Source URL"))
170
        conf1.add_entry(_("URL",), "url", _("The url of the rss feed"))
191
        conf1.add_entry(_("URL",), "url", _("The url of the rss feed"))
192
        conf1.add_entry(_("Image",), "image", _("The logo for the rss feed"))
171
        conf1.add_title(_("Interval between Rss updates (minutes)"))
193
        conf1.add_title(_("Interval between Rss updates (minutes)"))
172
        conf1.add_spin(_("Interval",), "update", _("The interval between updates (minutes)"),1,60)
194
        conf1.add_spin(_("Interval",), "update", _("The interval between updates (minutes)"),20,120)
173
        conf1.add_title(_("Max Headline Width (Python 2.3+ only)"))
195
        conf1.add_title(_("Max Headline Width (Python 2.3+ only)"))
174
        conf1.add_spin(_("Width",), "wrapwidth", _("The max number of columns before wrapping"),1,60)
196
        conf1.add_spin(_("Width",), "wrapwidth", _("The max number of columns before wrapping"),1,200)
175
        conf1.add_title(_("Preferred Browser"))
197
        conf1.add_title(_("Preferred Browser"))
176
        conf1.add_entry(_("Browser",), "browser", _("The browser to use to view headlines clicked on"))
198
        conf1.add_entry(_("Browser",), "browser", _("The browser to use to view headlines clicked on"))
177
        conf1.add_title(_("Fonts"))
199
        conf1.add_title(_("Fonts"))

Return to bug 29588