Added Verified Account label to verified accounts
This commit is contained in:
parent
d47b12124f
commit
6bde20333f
|
@ -261,6 +261,32 @@
|
||||||
<property name="fill">False</property>
|
<property name="fill">False</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
|
|
||||||
|
<child>
|
||||||
|
<widget class="GtkLabel" id="verified_label">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="label" translatable="yes">Verified Account</property>
|
||||||
|
<property name="use_underline">False</property>
|
||||||
|
<property name="use_markup">False</property>
|
||||||
|
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
||||||
|
<property name="wrap">False</property>
|
||||||
|
<property name="selectable">False</property>
|
||||||
|
<property name="xalign">0.5</property>
|
||||||
|
<property name="yalign">0.5</property>
|
||||||
|
<property name="xpad">0</property>
|
||||||
|
<property name="ypad">0</property>
|
||||||
|
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
|
||||||
|
<property name="width_chars">-1</property>
|
||||||
|
<property name="single_line_mode">False</property>
|
||||||
|
<property name="angle">0</property>
|
||||||
|
</widget>
|
||||||
|
<packing>
|
||||||
|
<property name="padding">0</property>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">False</property>
|
||||||
|
<property name="pack_type">GTK_PACK_END</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
</widget>
|
</widget>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="padding">0</property>
|
<property name="padding">0</property>
|
||||||
|
|
17
mytwitter.py
17
mytwitter.py
|
@ -50,6 +50,7 @@ class MyTwitter():
|
||||||
self.search_entry = self.widget_tree.get_widget('search_entry')
|
self.search_entry = self.widget_tree.get_widget('search_entry')
|
||||||
self.following_button = self.widget_tree.get_widget('following_button')
|
self.following_button = self.widget_tree.get_widget('following_button')
|
||||||
self.at_button = self.widget_tree.get_widget('at_button')
|
self.at_button = self.widget_tree.get_widget('at_button')
|
||||||
|
self.verified_label = self.widget_tree.get_widget('verified_label')
|
||||||
|
|
||||||
self.context_id = self.status_bar.get_context_id('message')
|
self.context_id = self.status_bar.get_context_id('message')
|
||||||
|
|
||||||
|
@ -196,10 +197,12 @@ class MyTwitter():
|
||||||
|
|
||||||
is_user = False
|
is_user = False
|
||||||
following = False
|
following = False
|
||||||
|
verified = False
|
||||||
if re.match('user:', name):
|
if re.match('user:', name):
|
||||||
is_user = True
|
is_user = True
|
||||||
following = self.check_following(name)
|
following = self.check_following(name)
|
||||||
new_pane = TweetPane(name, num_entries=self.num_entries, single_tweet=single_tweet, is_user=is_user, following=following)
|
verified = self.check_verified(name)
|
||||||
|
new_pane = TweetPane(name, num_entries=self.num_entries, single_tweet=single_tweet, is_user=is_user, following=following, verified=verified)
|
||||||
self.tweet_notebook.append_page_menu(new_pane, new_pane.get_tab_label(), gtk.Label(name))
|
self.tweet_notebook.append_page_menu(new_pane, new_pane.get_tab_label(), gtk.Label(name))
|
||||||
new_pane.get_tab_label().connect('close-clicked', self.remove_view_callback, name)
|
new_pane.get_tab_label().connect('close-clicked', self.remove_view_callback, name)
|
||||||
new_pane.connect('tweet-reply', self.on_reply)
|
new_pane.connect('tweet-reply', self.on_reply)
|
||||||
|
@ -230,6 +233,10 @@ class MyTwitter():
|
||||||
self.at_button.show()
|
self.at_button.show()
|
||||||
else:
|
else:
|
||||||
self.at_button.hide()
|
self.at_button.hide()
|
||||||
|
if pane.get_verified():
|
||||||
|
self.verified_label.show()
|
||||||
|
else:
|
||||||
|
self.verified_label.hide()
|
||||||
|
|
||||||
|
|
||||||
def on_search(self, event):
|
def on_search(self, event):
|
||||||
|
@ -263,6 +270,13 @@ class MyTwitter():
|
||||||
return relationship.source.following
|
return relationship.source.following
|
||||||
|
|
||||||
|
|
||||||
|
# Name is the name of a pane, with the 'user: ' in place
|
||||||
|
def check_verified(self, name):
|
||||||
|
screen_name = re.sub('user: ', '', name)
|
||||||
|
user = self.api.GetUser(screen_name)
|
||||||
|
return user.verified
|
||||||
|
|
||||||
|
|
||||||
def update_follow_button(self, pane):
|
def update_follow_button(self, pane):
|
||||||
if not pane.get_is_user():
|
if not pane.get_is_user():
|
||||||
self.following_button.set_label('')
|
self.following_button.set_label('')
|
||||||
|
@ -358,7 +372,6 @@ class User():
|
||||||
self.name = None
|
self.name = None
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# main
|
# main
|
||||||
parser = optparse.OptionParser()
|
parser = optparse.OptionParser()
|
||||||
parser.add_option('-c' ,'--config', dest="filename", default="~/.mytwitter")
|
parser.add_option('-c' ,'--config', dest="filename", default="~/.mytwitter")
|
||||||
|
|
28
python-twitter-GetUser_verified.patch
Normal file
28
python-twitter-GetUser_verified.patch
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
diff -r 51ac454d5d89 twitter.py
|
||||||
|
--- a/twitter.py Thu Dec 31 15:06:42 2009 -0500
|
||||||
|
+++ b/twitter.py Fri Apr 16 17:30:32 2010 -0400
|
||||||
|
@@ -221,6 +221,7 @@
|
||||||
|
_CopyProperty(data, user, 'profile_link_color', 'profile.link_color')
|
||||||
|
_CopyProperty(data, user, 'profile_text_color', 'profile.text_color')
|
||||||
|
_CopyProperty(data, user, 'protected')
|
||||||
|
+ _CopyProperty(data, user, 'verified')
|
||||||
|
_CopyProperty(data, user, 'utc_offset')
|
||||||
|
_CopyProperty(data, user, 'time_zone')
|
||||||
|
_CopyProperty(data, user, 'url')
|
||||||
|
diff -r 51ac454d5d89 twitter_pb2.py
|
||||||
|
--- a/twitter_pb2.py Thu Dec 31 15:06:42 2009 -0500
|
||||||
|
+++ b/twitter_pb2.py Fri Apr 16 17:30:32 2010 -0400
|
||||||
|
@@ -253,6 +253,13 @@
|
||||||
|
message_type=None, enum_type=None, containing_type=None,
|
||||||
|
is_extension=False, extension_scope=None,
|
||||||
|
options=None),
|
||||||
|
+ descriptor.FieldDescriptor(
|
||||||
|
+ name='verified', full_name='twitter.User.verified', index=18,
|
||||||
|
+ number=19, type=8, cpp_type=7, label=1,
|
||||||
|
+ default_value=False,
|
||||||
|
+ message_type=None, enum_type=None, containing_type=None,
|
||||||
|
+ is_extension=False, extension_scope=None,
|
||||||
|
+ options=None),
|
||||||
|
],
|
||||||
|
extensions=[
|
||||||
|
],
|
|
@ -13,7 +13,7 @@ class TweetPane(gtk.ScrolledWindow):
|
||||||
It also gets some data from its parent, including num_entries
|
It also gets some data from its parent, including num_entries
|
||||||
'''
|
'''
|
||||||
|
|
||||||
def __init__(self, list_name, num_entries=20, single_tweet=None, is_user=False, following=False):
|
def __init__(self, list_name, num_entries=20, single_tweet=None, is_user=False, following=False, verified=False):
|
||||||
gtk.ScrolledWindow.__init__(self)
|
gtk.ScrolledWindow.__init__(self)
|
||||||
|
|
||||||
self.updated_once = False
|
self.updated_once = False
|
||||||
|
@ -27,6 +27,7 @@ class TweetPane(gtk.ScrolledWindow):
|
||||||
|
|
||||||
self.is_user = is_user
|
self.is_user = is_user
|
||||||
self.following = following
|
self.following = following
|
||||||
|
self.verified = verified
|
||||||
|
|
||||||
self.tab_label = CloseTabLabel(self.list_name)
|
self.tab_label = CloseTabLabel(self.list_name)
|
||||||
|
|
||||||
|
@ -148,6 +149,10 @@ class TweetPane(gtk.ScrolledWindow):
|
||||||
return self.following
|
return self.following
|
||||||
|
|
||||||
|
|
||||||
|
def get_verified(self):
|
||||||
|
return self.verified
|
||||||
|
|
||||||
|
|
||||||
def set_following(self, following):
|
def set_following(self, following):
|
||||||
self.following = following
|
self.following = following
|
||||||
|
|
||||||
|
|
Reference in New Issue
Block a user