Merge lp:~psquid/heybuddy/api_redent into lp:heybuddy

Proposed by Psychedelic Squid
Status: Needs review
Proposed branch: lp:~psquid/heybuddy/api_redent
Merge into: lp:heybuddy
Diff against target: 134 lines (+34/-10)
3 files modified
Communicator.py (+10/-4)
SettingsPage.py (+11/-0)
heybuddy.py (+13/-6)
To merge this branch: bzr merge lp:~psquid/heybuddy/api_redent
Reviewer Review Type Date Requested Status
jezra Pending
Review via email: mp+60010@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Psychedelic Squid (psquid) wrote :

Sorry about all the merge requests, but the code's done, so there's no reason I can see _not_ to request merges.

Revision history for this message
jezra (jezra) wrote :

I would prefer that anything referring to the retweet API contain "retweet" in the name. That way, when I get angry, I can let everyone know how much I don't like twitter

Revision history for this message
Psychedelic Squid (psquid) wrote :

----- Original message -----
> I would prefer that anything referring to the retweet API contain
> "retweet" in the name. That way, when I get angry, I can let everyone
> know how much I don't like twitter --
> https://code.launchpad.net/~psquid/heybuddy/api_redent/+merge/60010 You
> are the owner of lp:~psquid/heybuddy/api_redent.

Fine by me. If it gets in, I honestly don't care what it's called. :)

lp:~psquid/heybuddy/api_redent updated
271. By Psychedelic Squid

Amended all added code (but not the fixed code - terminology has been left as it was there) to refer to retweet API, rather than repeat/redent.

Revision history for this message
jezra (jezra) wrote :

What is an API? I know, and you know, but will a new user know? or will a new user just see that heybuddy's default is superior to the twitter compatible crap?

lp:~psquid/heybuddy/api_redent updated
272. By Psychedelic Squid

Set default option value of api_retweet as False.

Revision history for this message
Psychedelic Squid (psquid) wrote :

I was kinda intending for it to be an option that you probably don't want to turn on anyway if you don't know what it means.

The other possibility is to change the description to something like "Use shitty twitter-style retweets for redenting" (wording could probably be improved).

Unmerged revisions

272. By Psychedelic Squid

Set default option value of api_retweet as False.

271. By Psychedelic Squid

Amended all added code (but not the fixed code - terminology has been left as it was there) to refer to retweet API, rather than repeat/redent.

270. By Psychedelic Squid

Add support for using the repeat API to redent, and fix the send_redent method to behave correctly.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Communicator.py'
2--- Communicator.py 2011-03-11 20:33:23 +0000
3+++ Communicator.py 2011-05-06 04:52:12 +0000
4@@ -91,6 +91,10 @@
5 gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE,
6 (gobject.TYPE_STRING,)
7 ),
8+ 'redent-statusXML': (
9+ gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE,
10+ (gobject.TYPE_STRING,)
11+ ),
12 'block-createXML': (
13 gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE,
14 (gobject.TYPE_STRING,)
15@@ -284,12 +288,14 @@
16 #add this request to the front of the communication queue
17 self.queue.append( (request,'new-statusXML',None) )
18
19-
20 def send_redent(self,status_id):
21- url="%s/statuses/retweet/%s.xml" % (self.apiroot,status_id)
22+ url="%s/statuses/retweet.xml" % (self.sapiroot)
23+ data={"id":status_id}
24+ encoded_data =urlencode(data)
25 #print url
26- request = urllib2.Request(url,encoded_data)
27- self.process_httprequest(request,'redent-statusXML')
28+ request = urllib2.Request(url, encoded_data)
29+ request.add_header("Authorization", self.authheader)
30+ self.queue.append( (request,'redent-statusXML',None) )
31
32 def block_create(self,user_id):
33 url="%s/blocks/create.xml?user_id=%s" % (self.sapiroot,user_id)
34
35=== modified file 'SettingsPage.py'
36--- SettingsPage.py 2011-04-11 18:31:17 +0000
37+++ SettingsPage.py 2011-05-06 04:52:12 +0000
38@@ -17,6 +17,10 @@
39 gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE,
40 (gobject.TYPE_BOOLEAN,)
41 ),
42+ 'option-api-retweet': (
43+ gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE,
44+ (gobject.TYPE_BOOLEAN,)
45+ ),
46 'option-ctrl-enter': (
47 gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE,
48 (gobject.TYPE_BOOLEAN,)
49@@ -120,6 +124,9 @@
50 self.ctrl_enter = gtk.CheckButton(_("CTRL+Enter submits status"))
51 self.ctrl_enter.connect("toggled", self.option_toggled,'option-ctrl-enter')
52
53+ self.api_retweet = gtk.CheckButton(_("Use retweet API for redents"))
54+ self.api_retweet.connect("toggled", self.option_toggled,'option-api-retweet')
55+
56 self.enable_notifications = gtk.CheckButton(_("Enable notifications"))
57 self.enable_notifications.connect("toggled", self.option_toggled,'option-notifications')
58 self.enable_notify_replies = gtk.CheckButton(_("Enable @replies notifications"))
59@@ -128,6 +135,7 @@
60 options_box.pack_start(self.ctrl_enter,False,False,0)
61 options_box.pack_start(self.context_back_asswards,False,False,0)
62 options_box.pack_start(self.disable_avatars,False,False,0)
63+ options_box.pack_start(self.api_retweet,False,False,0)
64 #does the app have notifications?
65 if has_pynotify:
66 options_box.pack_start(self.enable_notifications,False,False,0)
67@@ -224,6 +232,9 @@
68 def set_ctrl_enter(self,boolean):
69 self.ctrl_enter.set_active(boolean)
70
71+ def set_api_retweet(self,boolean):
72+ self.api_retweet.set_active(boolean)
73+
74
75 #More Code for notifications
76 def set_notifications(self,boolean):
77
78=== modified file 'heybuddy.py'
79--- heybuddy.py 2011-05-05 04:54:00 +0000
80+++ heybuddy.py 2011-05-06 04:52:12 +0000
81@@ -92,7 +92,7 @@
82 self.conversation_id="0"
83 #keep track of the filters
84 self.filters ={'users':[],'strings':[]}
85- self.options={'run_as_tray_app':False,'context_backwards':False,'no_avatars':False,'notifications':True,'notify_replies':False}
86+ self.options={'run_as_tray_app':False,'context_backwards':False,'no_avatars':False,'notifications':True,'notify_replies':False,'api_retweet':False}
87 #keep track of the direct_message requests
88 self.last_direct_message_time=0
89 #something something direct message
90@@ -145,6 +145,7 @@
91 self.comm.connect('userXML',self.process_userXML)
92 self.comm.connect('groupXML',self.process_groupXML)
93 self.comm.connect('new-statusXML',self.process_new_statusXML)
94+ self.comm.connect('redent-statusXML',self.process_new_statusXML)
95 self.comm.connect('user_is_friendXML',self.process_user_is_friendXML)
96 self.comm.connect('user_is_memberXML',self.process_user_is_memberXML)
97 self.comm.connect('friendshipXML',self.process_friendshipXML)
98@@ -284,6 +285,8 @@
99 self.settingspage.set_context_backwards( self.options['context_backwards'] )
100 self.options['no_avatar']= self.conf.get_bool_option('no_avatars')
101 self.settingspage.set_no_avatars( self.options['no_avatar'] )
102+ self.options['api_retweet'] = self.conf.get_bool_option('api_retweet')
103+ self.settingspage.set_api_retweet( self.options['api_retweet'] )
104 self.options['notifications']= self.conf.get_bool_option('notifications')
105 self.settingspage.set_notifications( self.options['notifications'] )
106 self.options['notify_replies']= self.conf.get_bool_option('notify_replies')
107@@ -296,6 +299,7 @@
108 self.settingspage.connect('option-ctrl-enter', self.option_changed, 'ctrl_enter')
109 self.settingspage.connect('option-context-backwards',self.option_changed, 'context_backwards')
110 self.settingspage.connect('option-no-avatars',self.option_changed, 'no_avatars')
111+ self.settingspage.connect('option-api-retweet', self.option_changed, 'api_retweet')
112 self.settingspage.connect('option-notifications',self.option_changed, 'notifications')
113 self.settingspage.connect('option-notify-replies',self.option_changed, 'notify_replies')
114 self.settingspage.connect('initial-dents',self.set_initial_dents)
115@@ -992,11 +996,14 @@
116 self.mainwindow.set_ctrl_enter(value)
117
118 def redent_clicked(self,dent,name,text):
119- self.respond_to_id=dent.id
120- #formatted_text= u'\u267A @%s: %s' % (name,text)
121- formatted_text= u'\u267A @%s: %s' % (name,text)
122- self.mainwindow.update_textbuffer.set_text(formatted_text )
123- self.mainwindow.update_textview.grab_focus()
124+ if self.options['api_retweet']:
125+ self.comm.send_redent(dent.id)
126+ else:
127+ self.respond_to_id=dent.id
128+ #formatted_text= u'\u267A @%s: %s' % (name,text)
129+ formatted_text= u'\u267A @%s: %s' % (name,text)
130+ self.mainwindow.update_textbuffer.set_text(formatted_text )
131+ self.mainwindow.update_textview.grab_focus()
132
133 def view_group(self,widget,group_name):
134 #where were we?

Subscribers

People subscribed via source and target branches