@@ -64,6 +64,7 @@ def __init__(self, locals=None, encoding=sys.getdefaultencoding()):
6464 code .InteractiveInterpreter .__init__ (self , locals )
6565
6666 if not py3 :
67+
6768 def runsource (self , source , filename = '<input>' , symbol = 'single' ):
6869 source = '# coding: %s\n %s' % (self .encoding ,
6970 source .encode (self .encoding ))
@@ -130,6 +131,7 @@ def writetb(self, lines):
130131
131132
132133class History (object ):
134+
133135 def __init__ (self , entries = None ):
134136 if entries is None :
135137 self .entries = ['' ]
@@ -189,6 +191,7 @@ def save(self, filename, encoding, lines=0):
189191
190192
191193class MatchesIterator (object ):
194+
192195 def __init__ (self , current_word = '' , matches = []):
193196 self .current_word = current_word
194197 self .matches = list (matches )
@@ -298,7 +301,6 @@ def __init__(self, interp, idle=None):
298301 with open (filename , 'r' ) as f :
299302 self .interp .runsource (f .read (), filename , 'exec' )
300303
301-
302304 def attr_matches (self , text ):
303305 """Taken from rlcompleter.py and bent to my will."""
304306
@@ -586,7 +588,7 @@ def write2file(self):
586588 def pastebin (self ):
587589 """Upload to a pastebin and display the URL in the status bar."""
588590
589- pasteservice_url = OPTS .pastebin_url
591+ pasteservice_url = OPTS .pastebin_url
590592 pasteservice = ServerProxy (urljoin (pasteservice_url , '/xmlrpc/' ))
591593
592594 s = self .getstdout ()
@@ -595,7 +597,7 @@ def pastebin(self):
595597 try :
596598 paste_id = pasteservice .pastes .newPaste ('pycon' , s )
597599 except XMLRPCError , e :
598- self .statusbar .message ( 'Upload failed: %s' % (str (e ), ) )
600+ self .statusbar .message ('Upload failed: %s' % (str (e ), ) )
599601 return
600602
601603 paste_url = urljoin (pasteservice_url , '/show/%s/' % (paste_id , ))
@@ -849,9 +851,11 @@ def split_lines(tokens):
849851 if newline :
850852 yield (Token .Text , newline )
851853
854+
852855def token_is (token_type ):
853856 """Return a callable object that returns whether a token is of the
854857 given type `token_type`."""
858+
855859 def token_is_type (token ):
856860 """Return whether a token is of a certain type or not."""
857861 token = token [0 ]
@@ -861,6 +865,7 @@ def token_is_type(token):
861865
862866 return token_is_type
863867
868+
864869def token_is_any_of (token_types ):
865870 """Return a callable object that returns whether a token is any of the
866871 given types `token_types`."""
0 commit comments