66def register_key (key ,name ,reg = True ):
77 if hasattr (main .window ,name ):
88 try :
9- if reg == True :
9+ if reg :
1010 main .window .handler .register_key (key ,getattr (main .window ,name ))
1111 else :
1212 main .window .handler .unregister_key (key ,getattr (main .window ,name ))
@@ -15,7 +15,7 @@ def register_key(key,name,reg=True):
1515 return False
1616 if hasattr (main .window ,"on" + name ):
1717 try :
18- if reg == True :
18+ if reg :
1919 main .window .handler .register_key (key ,getattr (main .window ,"on" + name ))
2020 else :
2121 main .window .handler .unregister_key (key ,getattr (main .window ,"on" + name ))
@@ -24,7 +24,7 @@ def register_key(key,name,reg=True):
2424 return False
2525 if hasattr (main .window ,"On" + name ):
2626 try :
27- if reg == True :
27+ if reg :
2828 main .window .handler .register_key (key ,getattr (main .window ,"On" + name ))
2929 else :
3030 main .window .handler .unregister_key (key ,getattr (main .window ,"On" + name ))
@@ -33,7 +33,7 @@ def register_key(key,name,reg=True):
3333 return False
3434 if hasattr (inv ,name ):
3535 try :
36- if reg == True :
36+ if reg :
3737 main .window .handler .register_key (key ,getattr (inv ,name ))
3838 else :
3939 main .window .handler .unregister_key (key ,getattr (inv ,name ))
@@ -44,29 +44,29 @@ def register_key(key,name,reg=True):
4444class invisible_interface (object ):
4545 def focus_tl (self ,sync = False ):
4646 globals .currentAccount .currentTimeline = globals .currentAccount .list_timelines ()[globals .currentAccount .currentIndex ]
47- if sync == False and globals .prefs .invisible_sync == True or sync == True :
47+ if not sync and globals .prefs .invisible_sync or sync :
4848 main .window .list .SetSelection (globals .currentAccount .currentIndex )
4949 main .window .on_list_change (None )
5050 extratext = ""
51- if globals .prefs .position == True :
51+ if globals .prefs .position :
5252 if len (globals .currentAccount .currentTimeline .statuses )== 0 :
5353 extratext += "Empty"
5454 else :
5555 extratext += str (globals .currentAccount .currentTimeline .index + 1 )+ " of " + str (len (globals .currentAccount .currentTimeline .statuses ))
56- if globals .currentAccount .currentTimeline .read == True :
56+ if globals .currentAccount .currentTimeline .read :
5757 extratext += ", Autoread"
58- if globals .currentAccount .currentTimeline .mute == True :
58+ if globals .currentAccount .currentTimeline .mute :
5959 extratext += ", muted"
6060 speak .speak (globals .currentAccount .currentTimeline .name + ". " + extratext ,True )
61- if globals .prefs .invisible_sync == False and sync == False :
61+ if not globals .prefs .invisible_sync and not sync :
6262 main .window .play_earcon ()
6363
6464 def focus_tl_item (self ):
65- if globals .prefs .invisible_sync == True :
65+ if globals .prefs .invisible_sync :
6666 main .window .list2 .SetSelection (globals .currentAccount .currentTimeline .index )
6767 main .window .on_list2_change (None )
6868 else :
69- if globals .prefs .earcon_audio == True and len (sound .get_media_urls (utils .find_urls_in_tweet (globals .currentAccount .currentTimeline .statuses [globals .currentAccount .currentTimeline .index ])))> 0 :
69+ if globals .prefs .earcon_audio and len (sound .get_media_urls (utils .find_urls_in_tweet (globals .currentAccount .currentTimeline .statuses [globals .currentAccount .currentTimeline .index ]))) > 0 :
7070 sound .play (globals .currentAccount ,"media" )
7171 self .speak_item ()
7272
@@ -91,19 +91,19 @@ def next_tl(self,sync=False):
9191 def prev_item (self ):
9292 if globals .currentAccount .currentTimeline .index == 0 or len (globals .currentAccount .currentTimeline .statuses )== 0 :
9393 sound .play (globals .currentAccount ,"boundary" )
94- if globals .prefs .repeat == True :
94+ if globals .prefs .repeat :
9595 self .speak_item ()
9696 return
9797 globals .currentAccount .currentTimeline .index -= 1
9898 self .focus_tl_item ()
9999
100100 def prev_item_jump (self ):
101- if globals .currentAccount .currentTimeline .index < 20 :
101+ if globals .currentAccount .currentTimeline .index < globals . prefs . move_amount :
102102 sound .play (globals .currentAccount ,"boundary" )
103- if globals .prefs .repeat == True :
103+ if globals .prefs .repeat :
104104 self .speak_item ()
105105 return
106- globals .currentAccount .currentTimeline .index -= 20
106+ globals .currentAccount .currentTimeline .index -= globals . prefs . move_amount
107107 self .focus_tl_item ()
108108
109109 def top_item (self ):
@@ -113,19 +113,19 @@ def top_item(self):
113113 def next_item (self ):
114114 if globals .currentAccount .currentTimeline .index == len (globals .currentAccount .currentTimeline .statuses )- 1 or len (globals .currentAccount .currentTimeline .statuses )== 0 :
115115 sound .play (globals .currentAccount ,"boundary" )
116- if globals .prefs .repeat == True :
116+ if globals .prefs .repeat :
117117 self .speak_item ()
118118 return
119119 globals .currentAccount .currentTimeline .index += 1
120120 self .focus_tl_item ()
121121
122122 def next_item_jump (self ):
123- if globals .currentAccount .currentTimeline .index >= len (globals .currentAccount .currentTimeline .statuses )- 20 :
123+ if globals .currentAccount .currentTimeline .index >= len (globals .currentAccount .currentTimeline .statuses ) - globals . prefs . move_amount :
124124 sound .play (globals .currentAccount ,"boundary" )
125- if globals .prefs .repeat == True :
125+ if globals .prefs .repeat :
126126 self .speak_item ()
127127 return
128- globals .currentAccount .currentTimeline .index += 20
128+ globals .currentAccount .currentTimeline .index += globals . prefs . move_amount
129129 self .focus_tl_item ()
130130
131131 def bottom_item (self ):
0 commit comments