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

Proposed by Eduardo Mucelli Rezende Oliveira
Status: Merged
Merged at revision: 236
Proposed branch: lp:~eduardo-mucelli/cairo-dock-plug-ins-extras/Twitter
Merge into: lp:~cairo-dock-team/cairo-dock-plug-ins-extras/third-party
Diff against target: 56 lines (+4/-9)
1 file modified
Twitter/Twitter (+4/-9)
To merge this branch: bzr merge lp:~eduardo-mucelli/cairo-dock-plug-ins-extras/Twitter
Reviewer Review Type Date Requested Status
Matthieu Baerts Approve
Review via email: mp+96461@code.launchpad.net

Description of the change

Fixing a mistake when removing the tweets by the own user from the notification, actually it was not working before. Removing some packages were not being used.

To post a comment you must log in.
Revision history for this message
Matthieu Baerts (matttbe) wrote :

Thank you :)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Twitter/Twitter'
2--- Twitter/Twitter 2012-03-07 02:50:21 +0000
3+++ Twitter/Twitter 2012-03-07 21:27:33 +0000
4@@ -27,14 +27,12 @@
5 # To see the received direct messages right-click on the icon -> Twitter -> Received direct messages
6 # To see some user's info right-click on the icon -> Twitter -> Info
7
8-import urlparse, os, webbrowser, simplejson, threading, Queue, time, urllib2
9+import os, webbrowser, simplejson, threading, Queue, urllib2
10 from oauth import oauth
11 from http import post, get #, stream
12 from util import *
13 from CDApplet import CDApplet, _
14 # TODO import ConfigParser later conver files to config syntax
15-# from threading import Thread
16-# import time
17
18 class TwitterOauth:
19 def __init__(self):
20@@ -73,9 +71,8 @@
21 oauth_request.sign_request(self.signature_method, self.consumer, self.request_token)
22 url = oauth_request.to_url()
23 response = get(url)
24- self.access_token = oauth.OAuthToken.from_string(response)
25- access_token_data = dict((x, y) for x, y in urlparse.parse_qsl(response)) # tuple to dict
26- return access_token_data['oauth_token'], access_token_data['oauth_token_secret']
27+ self.access_token = oauth.OAuthToken.from_string(response) # create both .key and .secret attributes
28+ return self.access_token.key, self.access_token.secret
29
30 # TODO: Check also the possible inheritance with TwitterOauth
31 class API():
32@@ -107,7 +104,6 @@
33 while True:
34 chunk = req.read(1)
35 if not chunk:
36- print buffer
37 break
38
39 buffer += chunk
40@@ -158,7 +154,6 @@
41 oauth_request.sign_request(self.signature_method, self.consumer, self.access_token)
42 url = oauth_request.to_url()
43 response = get(url)
44- print simplejson.loads(response)[0]
45 return simplejson.loads(response)
46
47 def verify_credentials(self):
48@@ -192,7 +187,7 @@
49 # TwitterStreamAPI(access_key, access_secret, self.on_receive_new_tweet_callback)
50 # TODO: Make available an "Animation" option upon a new tweet arrival
51 def on_receive_new_tweet_callback(self, tweet):
52- if 'screen_name' in tweet and not (tweet['screen_name'] == self.user.screen_name):
53+ if not tweet['user']['screen_name'] == self.user.screen_name:
54 logp("Inserting new tweet on the stream Queue: %s" % tweet) # not sent by the own user
55 self.stream.put(tweet) # put the new tweet on the stream queue
56 self.icon.SetQuickInfo(str(self.stream.qsize())) # update the new tweets counter on the icon

Subscribers

People subscribed via source and target branches