Merge lp:~eduardo-mucelli/cairo-dock-plug-ins-extras/Quote into lp:~cairo-dock-team/cairo-dock-plug-ins-extras/third-party

Proposed by Eduardo Mucelli Rezende Oliveira
Status: Merged
Merged at revision: 110
Proposed branch: lp:~eduardo-mucelli/cairo-dock-plug-ins-extras/Quote
Merge into: lp:~cairo-dock-team/cairo-dock-plug-ins-extras/third-party
Diff against target: 71 lines (+21/-5)
5 files modified
Quote/ChangeLog (+1/-0)
Quote/Quote (+12/-3)
Quote/Quote.conf (+1/-1)
Quote/README (+6/-0)
Quote/auto-load.conf (+1/-1)
To merge this branch: bzr merge lp:~eduardo-mucelli/cairo-dock-plug-ins-extras/Quote
Reviewer Review Type Date Requested Status
Cairo-Dock Devs Pending
Review via email: mp+44465@code.launchpad.net

Description of the change

Automatic fetch more quotes when all of them were already showed to the user, except for Quotationspage.com.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Quote/ChangeLog'
2--- Quote/ChangeLog 2010-12-02 10:17:59 +0000
3+++ Quote/ChangeLog 2010-12-22 14:22:12 +0000
4@@ -1,3 +1,4 @@
5+0.0.6:(December/22/2010): Automatic fetch more quotes when all of them were already showed to the user, except for Quotationspage.com.
6 0.0.5:(December/2/2010): Added Jokes2go.com.
7 0.0.4:(November/23/2010): Added Danstonchat.com. Changed the icon, now the lamp was turned on :¬) Huge code modularization.
8 0.0.3:(November/23/2010): It is possible now copy the quote to the clipboard. Added quotes from Qdb.us.
9
10=== modified file 'Quote/Quote'
11--- Quote/Quote 2010-12-02 18:15:52 +0000
12+++ Quote/Quote 2010-12-22 14:22:12 +0000
13@@ -148,15 +148,24 @@
14 self.inform_start_of_waiting_process() # ...
15 interface = Interface(self.source)
16 quote, author = interface.fetch()
17- self.quotes = itertools.cycle(quote)
18- self.authors = itertools.cycle(author)
19+ if (self.source == quotationspage): # quotationspage nao da quotes diferentes por acesso ...
20+ self.quotes = itertools.cycle(quote)
21+ self.authors = itertools.cycle(author)
22+ else: # ... os outros dao quotes diferentes por acesso entao
23+ self.quotes = iter(quote) # nao precisa usar iterador circular, pois depois de mostrar
24+ self.authors = iter(author) # todas, busca-se novas quotes com mais uma chamada deste metodo
25 self.inform_end_of_waiting_process() # done
26
27 def show_quote(self):
28 if (self.source == quotationspage):
29 self.quotation = "\"%s\" ~ %s" % (self.quotes.next(), self.authors.next()) # N-esima quote refere-se ao N-esimo autor."quote[x]~author[x]"
30 elif (self.source == bash or self.source == xkcdb or self.source == qdb or self.source == danstonchat):
31- self.quotation = "%s" % self.quotes.next()
32+ try: # ve a possibilidade de mostrar quotes ja armazenadas
33+ current = self.quotes.next()
34+ except StopIteration: # todas ja foram mostradas
35+ self.get_quotes_from_web() # buscar mais
36+ current = self.quotes.next() # posicionar na primeira para mostra-la
37+ self.quotation = "%s" % current
38 else: # jokestogo provides only one quote per request ...
39 self.quotation = "%s" % self.quotes.next().rstrip()
40 self.get_quotes_from_web() # ... so it is necessary to request it again
41
42=== modified file 'Quote/Quote.conf'
43--- Quote/Quote.conf 2010-12-02 10:17:59 +0000
44+++ Quote/Quote.conf 2010-12-22 14:22:12 +0000
45@@ -1,4 +1,4 @@
46-#!en;0.0.5
47+#!en;0.0.6
48
49 #[gtk-about]
50 [Icon]
51
52=== added file 'Quote/README'
53--- Quote/README 1970-01-01 00:00:00 +0000
54+++ Quote/README 2010-12-22 14:22:12 +0000
55@@ -0,0 +1,6 @@
56+# Contact me
57+
58+Any doubt, suggestion or anything else, except asking for some money, I would be pleased to received a message from you. :¬)
59+
60+Author: Eduardo Mucelli Rezende Oliveira
61+E-mail: edumucelli@gmail.com or eduardom@dcc.ufmg.br
62
63=== modified file 'Quote/auto-load.conf'
64--- Quote/auto-load.conf 2010-12-02 10:17:59 +0000
65+++ Quote/auto-load.conf 2010-12-22 14:22:12 +0000
66@@ -10,4 +10,4 @@
67 category = 7
68
69 # Version of the applet; change it everytime you change something in the config file. Don't forget to update the version both in this file and in the config file.
70-version = 0.0.5
71+version = 0.0.6

Subscribers

People subscribed via source and target branches