Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 70c4378

Browse files
committed
Whitespace normalization.
1 parent a888540 commit 70c4378

57 files changed

Lines changed: 2462 additions & 2468 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Lib/shlex.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
"""A lexical analyzer class for simple shell-like syntaxes."""
22

3-
# Module and documentation by Eric S. Raymond, 21 Dec 1998
3+
# Module and documentation by Eric S. Raymond, 21 Dec 1998
44
# Input stacking and error message cleanup added by ESR, March 2000
5-
# push_source() and pop_source() made explicit by ESR, January 2001.
5+
# push_source() and pop_source() made explicit by ESR, January 2001.
66

77
import os.path
88
import sys
99

1010
class shlex:
11-
"A lexical analyzer class for simple shell-like syntaxes."
11+
"A lexical analyzer class for simple shell-like syntaxes."
1212
def __init__(self, instream=None, infile=None):
1313
if instream:
1414
self.instream = instream
@@ -101,7 +101,7 @@ def read_token(self):
101101
self.lineno = self.lineno + 1
102102
if self.debug >= 3:
103103
print "shlex: in state", repr(self.state), \
104-
"I see character:", repr(nextchar)
104+
"I see character:", repr(nextchar)
105105
if self.state is None:
106106
self.token = '' # past end of file
107107
break
@@ -136,14 +136,14 @@ def read_token(self):
136136
if nextchar == self.state:
137137
self.state = ' '
138138
break
139-
elif not nextchar: # end of file
139+
elif not nextchar: # end of file
140140
if self.debug >= 2:
141141
print "shlex: I see EOF in quotes state"
142142
# XXX what error should be raised here?
143143
raise ValueError, "No closing quotation"
144144
elif self.state == 'a':
145145
if not nextchar:
146-
self.state = None # end of file
146+
self.state = None # end of file
147147
break
148148
elif nextchar in self.whitespace:
149149
if self.debug >= 2:
@@ -194,7 +194,7 @@ def error_leader(self, infile=None, lineno=None):
194194
return "\"%s\", line %d: " % (infile, lineno)
195195

196196

197-
if __name__ == '__main__':
197+
if __name__ == '__main__':
198198
if len(sys.argv) == 1:
199199
lexer = shlex()
200200
else:

Tools/idle/CallTipWindow.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def showtip(self, text):
2828
background="#ffffe0", relief=SOLID, borderwidth=1,
2929
font = self.widget['font'])
3030
label.pack()
31-
31+
3232
def hidetip(self):
3333
tw = self.tipwindow
3434
self.tipwindow = None
@@ -53,7 +53,7 @@ def __init__(self):
5353
text.event_add("<<calltip-hide>>", ")")
5454
text.bind("<<calltip-show>>", self.calltip_show)
5555
text.bind("<<calltip-hide>>", self.calltip_hide)
56-
56+
5757
text.focus_set()
5858
# root.mainloop() # not in idle
5959

Tools/idle/CallTips.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def _remove_calltip_window(self):
4545
if self.calltip:
4646
self.calltip.hidetip()
4747
self.calltip = None
48-
48+
4949
def paren_open_event(self, event):
5050
self._remove_calltip_window()
5151
arg_text = get_arg_text(self.get_object_at_cursor())
@@ -91,9 +91,9 @@ def get_object_at_cursor(self,
9191
namespace = sys.modules.copy()
9292
namespace.update(__main__.__dict__)
9393
try:
94-
return eval(word, namespace)
94+
return eval(word, namespace)
9595
except:
96-
pass
96+
pass
9797
return None # Can't find an object.
9898

9999
def _find_constructor(class_ob):

Tools/idle/ClassBrowser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def OnDoubleClick(self):
9292

9393
def IsExpandable(self):
9494
return os.path.normcase(self.file[-3:]) == ".py"
95-
95+
9696
def listclasses(self):
9797
dir, file = os.path.split(self.file)
9898
name, ext = os.path.splitext(file)

Tools/idle/Debugger.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def __init__(self, pyshell):
1717
bdb.Bdb.__init__(self)
1818
self.pyshell = pyshell
1919
self.make_gui()
20-
20+
2121
def canonic(self, filename):
2222
# Canonicalize filename -- called by Bdb
2323
return os.path.normcase(os.path.abspath(filename))
@@ -299,10 +299,10 @@ def set_break(self, filename, lineno, temporary=0, cond = None):
299299
import linecache # Import as late as possible
300300
line = linecache.getline(filename, lineno)
301301
if not line:
302-
return 'That line does not exist!'
302+
return 'That line does not exist!'
303303
if not self.breaks.has_key(filename):
304-
self.breaks[filename] = []
304+
self.breaks[filename] = []
305305
list = self.breaks[filename]
306306
if not lineno in list:
307-
list.append(lineno)
307+
list.append(lineno)
308308
bp = bdb.Breakpoint(filename, lineno, temporary, cond)

Tools/idle/Delegator.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
class Delegator:
32

43
# The cache is only used to be able to change delegates!

Tools/idle/FileList.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ def __init__(self, root):
2626

2727

2828
def goodname(self, filename):
29-
filename = self.canonize(filename)
30-
key = os.path.normcase(filename)
31-
if self.dict.has_key(key):
32-
edit = self.dict[key]
33-
filename = edit.io.filename or filename
34-
return filename
29+
filename = self.canonize(filename)
30+
key = os.path.normcase(filename)
31+
if self.dict.has_key(key):
32+
edit = self.dict[key]
33+
filename = edit.io.filename or filename
34+
return filename
3535

3636
def open(self, filename):
3737
assert filename

Tools/idle/FormatParagraph.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ class FormatParagraph:
2828
keydefs = {
2929
'<<format-paragraph>>': ['<Alt-q>'],
3030
}
31-
31+
3232
unix_keydefs = {
3333
'<<format-paragraph>>': ['<Meta-q>'],
34-
}
34+
}
3535

3636
def __init__(self, editwin):
3737
self.editwin = editwin

Tools/idle/IdleConf.py

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,24 @@ class IdleConfParser(ConfigParser):
1010
builtin_sections = {}
1111
for section in ('EditorWindow', 'Colors'):
1212
builtin_sections[section] = section
13-
13+
1414
def getcolor(self, sec, name):
1515
"""Return a dictionary with foreground and background colors
1616
1717
The return value is appropriate for passing to Tkinter in, e.g.,
1818
a tag_config call.
1919
"""
20-
fore = self.getdef(sec, name + "-foreground")
21-
back = self.getdef(sec, name + "-background")
20+
fore = self.getdef(sec, name + "-foreground")
21+
back = self.getdef(sec, name + "-background")
2222
return {"foreground": fore,
2323
"background": back}
2424

2525
def getdef(self, sec, options, raw=0, vars=None, default=None):
2626
"""Get an option value for given section or return default"""
27-
try:
27+
try:
2828
return self.get(sec, options, raw, vars)
29-
except (NoSectionError, NoOptionError):
30-
return default
29+
except (NoSectionError, NoOptionError):
30+
return default
3131

3232
def getsection(self, section):
3333
"""Return a SectionConfigParser object"""
@@ -37,10 +37,10 @@ def getextensions(self):
3737
exts = []
3838
for sec in self.sections():
3939
if self.builtin_sections.has_key(sec):
40-
continue
41-
# enable is a bool, but it may not be defined
42-
if self.getdef(sec, 'enable') != '0':
43-
exts.append(sec)
40+
continue
41+
# enable is a bool, but it may not be defined
42+
if self.getdef(sec, 'enable') != '0':
43+
exts.append(sec)
4444
return exts
4545

4646
def reload(self):
@@ -69,10 +69,10 @@ def getdef(self, options, raw=0, vars=None, default=None):
6969

7070
def getint(self, option):
7171
return self.config.getint(self.section, option)
72-
72+
7373
def getfloat(self, option):
7474
return self.config.getint(self.section, option)
75-
75+
7676
def getboolean(self, option):
7777
return self.config.getint(self.section, option)
7878

@@ -98,7 +98,7 @@ def load(dir):
9898
genplatfile = os.path.join(dir, "config-mac.txt")
9999
else:
100100
genplatfile = os.path.join(dir, "config-unix.txt")
101-
101+
102102
platfile = os.path.join(dir, "config-%s.txt" % sys.platform)
103103

104104
try:
@@ -110,4 +110,3 @@ def load(dir):
110110
os.path.join(homedir, ".idle")))
111111

112112
idleconf = IdleConfParser()
113-

Tools/idle/IdleHistory.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,4 +86,3 @@ def recall(self, s):
8686
self.text.mark_set("insert", "end-1c")
8787
self.text.insert("insert", s)
8888
self.text.see("insert")
89-

0 commit comments

Comments
 (0)