Added a debug function in Help menu
This commit is contained in:
parent
b41ef5f708
commit
8fd11f6fa5
|
@ -63,11 +63,11 @@
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="label" translatable="yes">_Views</property>
|
<property name="label" translatable="yes">_Views</property>
|
||||||
<property name="use_underline">True</property>
|
<property name="use_underline">True</property>
|
||||||
|
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkMenu" id="view_menu">
|
<widget class="GtkMenu" id="view_menu">
|
||||||
</widget>
|
</widget>
|
||||||
</child>
|
</child>
|
||||||
|
|
||||||
</widget>
|
</widget>
|
||||||
</child>
|
</child>
|
||||||
|
|
||||||
|
@ -76,22 +76,23 @@
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="label" translatable="yes">_Accounts</property>
|
<property name="label" translatable="yes">_Accounts</property>
|
||||||
<property name="use_underline">True</property>
|
<property name="use_underline">True</property>
|
||||||
|
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkMenu" id="accounts_menu">
|
<widget class="GtkMenu" id="accounts_menu">
|
||||||
</widget>
|
</widget>
|
||||||
</child>
|
</child>
|
||||||
|
|
||||||
|
|
||||||
</widget>
|
</widget>
|
||||||
</child>
|
</child>
|
||||||
|
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkMenuItem" id="menuitem10">
|
<widget class="GtkMenuItem" id="help">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="label" translatable="yes">_Help</property>
|
<property name="label" translatable="yes">_Help</property>
|
||||||
<property name="use_underline">True</property>
|
<property name="use_underline">True</property>
|
||||||
|
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkMenu" id="menuitem10_menu">
|
<widget class="GtkMenu" id="help_menu">
|
||||||
|
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkMenuItem" id="about1">
|
<widget class="GtkMenuItem" id="about1">
|
||||||
|
|
20
mytwitter.py
20
mytwitter.py
|
@ -6,6 +6,7 @@ import sys, ConfigParser, os, re, optparse, shelve
|
||||||
import gtk, gtk.glade, gobject
|
import gtk, gtk.glade, gobject
|
||||||
from urllib2 import HTTPError,URLError
|
from urllib2 import HTTPError,URLError
|
||||||
from twitterwidgets import TweetPane
|
from twitterwidgets import TweetPane
|
||||||
|
from threading import enumerate
|
||||||
import apithreads
|
import apithreads
|
||||||
|
|
||||||
|
|
||||||
|
@ -14,6 +15,8 @@ class MyTwitter():
|
||||||
""" Display Tweets, post to twitter """
|
""" Display Tweets, post to twitter """
|
||||||
|
|
||||||
def __init__(self, config_file, resize):
|
def __init__(self, config_file, resize):
|
||||||
|
global debug
|
||||||
|
|
||||||
self.resize = resize
|
self.resize = resize
|
||||||
|
|
||||||
config = ConfigParser.ConfigParser()
|
config = ConfigParser.ConfigParser()
|
||||||
|
@ -105,6 +108,7 @@ class MyTwitter():
|
||||||
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.verified_label = self.widget_tree.get_widget('verified_label')
|
||||||
self.account_label = self.widget_tree.get_widget('account_label')
|
self.account_label = self.widget_tree.get_widget('account_label')
|
||||||
|
self.help_menu = self.widget_tree.get_widget('help_menu')
|
||||||
|
|
||||||
|
|
||||||
def init_widgets(self):
|
def init_widgets(self):
|
||||||
|
@ -132,6 +136,13 @@ class MyTwitter():
|
||||||
self.accounts_menu.append(menu_item)
|
self.accounts_menu.append(menu_item)
|
||||||
menu_item.show()
|
menu_item.show()
|
||||||
|
|
||||||
|
# Add debug options to help menu
|
||||||
|
if debug:
|
||||||
|
menu_item = gtk.MenuItem('debug: Show Threads')
|
||||||
|
menu_item.connect('activate', self.debug_show_threads)
|
||||||
|
self.help_menu.append(menu_item)
|
||||||
|
menu_item.show()
|
||||||
|
|
||||||
# Set the account label
|
# Set the account label
|
||||||
self.update_account_label()
|
self.update_account_label()
|
||||||
|
|
||||||
|
@ -556,11 +567,18 @@ class MyTwitter():
|
||||||
self.update_entry.set_sensitive(True)
|
self.update_entry.set_sensitive(True)
|
||||||
|
|
||||||
|
|
||||||
|
def debug_show_threads(self, widget):
|
||||||
|
print 'debug_show_threads()'
|
||||||
|
for thread in enumerate():
|
||||||
|
print 'debug: thread: ' + thread.name
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### end class MyTwitter
|
### end class MyTwitter
|
||||||
|
|
||||||
|
|
||||||
# main
|
# main
|
||||||
debug = False # global debug variable
|
debug = False
|
||||||
|
|
||||||
parser = optparse.OptionParser()
|
parser = optparse.OptionParser()
|
||||||
parser.add_option('-c' ,'--config', dest="filename", default="~/.mytwitter.conf", help="read configuration from FILENAME instead of the default ~/.mytwitter.conf")
|
parser.add_option('-c' ,'--config', dest="filename", default="~/.mytwitter.conf", help="read configuration from FILENAME instead of the default ~/.mytwitter.conf")
|
||||||
|
|
Reference in New Issue
Block a user