Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion chroot/usr/lib/python2.7/distutils/command/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ def initialize_options (self):

def finalize_options (self):

# This method (and its pliant slaves, like 'finalize_unix()',
# This method (and its pliant subordinates, like 'finalize_unix()',
# 'finalize_other()', and 'select_scheme()') is where the default
# installation directories for modules, extension modules, and
# anything else we care to install from a Python module
Expand Down
28 changes: 14 additions & 14 deletions chroot/usr/lib/python2.7/doctest.py
Original file line number Diff line number Diff line change
Expand Up @@ -1458,7 +1458,7 @@ def summarize(self, verbose=None):
return TestResults(totalf, totalt)

#/////////////////////////////////////////////////////////////////
# Backward compatibility cruft to maintain doctest.master.
# Backward compatibility cruft to maintain doctest.main.
#/////////////////////////////////////////////////////////////////
def merge(self, other):
d = self._name2ft
Expand Down Expand Up @@ -1754,7 +1754,7 @@ def report_failure(self, out, test, example, got):

# For backward compatibility, a global instance of a DocTestRunner
# class, updated by testmod.
master = None
main = None

def testmod(m=None, name=None, globs=None, verbose=None,
report=True, optionflags=0, extraglobs=None,
Expand Down Expand Up @@ -1816,13 +1816,13 @@ def testmod(m=None, name=None, globs=None, verbose=None,

Advanced tomfoolery: testmod runs methods of a local instance of
class doctest.Tester, then merges the results into (or creates)
global Tester instance doctest.master. Methods of doctest.master
global Tester instance doctest.main. Methods of doctest.main
can be called directly too, if you want to do something unusual.
Passing report=0 to testmod is especially useful then, to delay
displaying a summary. Invoke doctest.master.summarize(verbose)
displaying a summary. Invoke doctest.main.summarize(verbose)
when you're done fiddling.
"""
global master
global main

# If no module was given, then use __main__.
if m is None:
Expand Down Expand Up @@ -1853,10 +1853,10 @@ class doctest.Tester, then merges the results into (or creates)
if report:
runner.summarize()

if master is None:
master = runner
if main is None:
main = runner
else:
master.merge(runner)
main.merge(runner)

return TestResults(runner.failures, runner.tries)

Expand Down Expand Up @@ -1934,13 +1934,13 @@ def testfile(filename, module_relative=True, name=None, package=None,

Advanced tomfoolery: testmod runs methods of a local instance of
class doctest.Tester, then merges the results into (or creates)
global Tester instance doctest.master. Methods of doctest.master
global Tester instance doctest.main. Methods of doctest.main
can be called directly too, if you want to do something unusual.
Passing report=0 to testmod is especially useful then, to delay
displaying a summary. Invoke doctest.master.summarize(verbose)
displaying a summary. Invoke doctest.main.summarize(verbose)
when you're done fiddling.
"""
global master
global main

if package and not module_relative:
raise ValueError("Package may only be specified for module-"
Expand Down Expand Up @@ -1978,10 +1978,10 @@ class doctest.Tester, then merges the results into (or creates)
if report:
runner.summarize()

if master is None:
master = runner
if main is None:
main = runner
else:
master.merge(runner)
main.merge(runner)

return TestResults(runner.failures, runner.tries)

Expand Down
8 changes: 4 additions & 4 deletions chroot/usr/lib/python2.7/gettext.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,17 +272,17 @@ def _parse(self, fp):
# Are we big endian or little endian?
magic = unpack('<I', buf[:4])[0]
if magic == self.LE_MAGIC:
version, msgcount, masteridx, transidx = unpack('<4I', buf[4:20])
version, msgcount, mainidx, transidx = unpack('<4I', buf[4:20])
ii = '<II'
elif magic == self.BE_MAGIC:
version, msgcount, masteridx, transidx = unpack('>4I', buf[4:20])
version, msgcount, mainidx, transidx = unpack('>4I', buf[4:20])
ii = '>II'
else:
raise IOError(0, 'Bad magic number', filename)
# Now put all messages from the .mo file buffer into the catalog
# dictionary.
for i in xrange(0, msgcount):
mlen, moff = unpack(ii, buf[masteridx:masteridx+8])
mlen, moff = unpack(ii, buf[mainidx:mainidx+8])
mend = moff + mlen
tlen, toff = unpack(ii, buf[transidx:transidx+8])
tend = toff + tlen
Expand Down Expand Up @@ -337,7 +337,7 @@ def _parse(self, fp):
tmsg = unicode(tmsg, self._charset)
catalog[msg] = tmsg
# advance to next entry in the seek tables
masteridx += 8
mainidx += 8
transidx += 8

def gettext(self, message):
Expand Down
4 changes: 2 additions & 2 deletions chroot/usr/lib/python2.7/lib-tk/Dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@


class Dialog(Widget):
def __init__(self, master=None, cnf={}, **kw):
def __init__(self, main=None, cnf={}, **kw):
cnf = _cnfmerge((cnf, kw))
self.widgetName = '__dialog__'
Widget._setup(self, master, cnf)
Widget._setup(self, main, cnf)
self.num = self.tk.getint(
self.tk.call(
'tk_dialog', self._w,
Expand Down
20 changes: 10 additions & 10 deletions chroot/usr/lib/python2.7/lib-tk/FileDialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class FileDialog:

Usage:

d = FileDialog(master)
d = FileDialog(main)
fname = d.go(dir_or_file, pattern, default, key)
if fname is None: ...canceled...
else: ...open file...
Expand All @@ -43,12 +43,12 @@ class FileDialog:

title = "File Selection Dialog"

def __init__(self, master, title=None):
def __init__(self, main, title=None):
if title is None: title = self.title
self.master = master
self.main = main
self.directory = None

self.top = Toplevel(master)
self.top = Toplevel(main)
self.top.title(title)
self.top.iconname(title)

Expand Down Expand Up @@ -122,7 +122,7 @@ def go(self, dir_or_file=os.curdir, pattern="*", default="", key=None):
self.top.wait_visibility() # window needs to be visible for the grab
self.top.grab_set()
self.how = None
self.master.mainloop() # Exited by self.quit(how)
self.main.mainloop() # Exited by self.quit(how)
if key:
directory, pattern = self.get_filter()
if self.how:
Expand All @@ -133,7 +133,7 @@ def go(self, dir_or_file=os.curdir, pattern="*", default="", key=None):

def quit(self, how=None):
self.how = how
self.master.quit() # Exit mainloop()
self.main.quit() # Exit mainloop()

def dirs_double_event(self, event):
self.filter_command()
Expand Down Expand Up @@ -162,7 +162,7 @@ def filter_command(self, event=None):
try:
names = os.listdir(dir)
except os.error:
self.master.bell()
self.main.bell()
return
self.directory = dir
self.set_filter(dir, pat)
Expand Down Expand Up @@ -226,7 +226,7 @@ class LoadFileDialog(FileDialog):
def ok_command(self):
file = self.get_selection()
if not os.path.isfile(file):
self.master.bell()
self.main.bell()
else:
self.quit(file)

Expand All @@ -241,7 +241,7 @@ def ok_command(self):
file = self.get_selection()
if os.path.exists(file):
if os.path.isdir(file):
self.master.bell()
self.main.bell()
return
d = Dialog(self.top,
title="Overwrite Existing File Question",
Expand All @@ -254,7 +254,7 @@ def ok_command(self):
else:
head, tail = os.path.split(file)
if not os.path.isdir(head):
self.master.bell()
self.main.bell()
return
self.quit(file)

Expand Down
6 changes: 3 additions & 3 deletions chroot/usr/lib/python2.7/lib-tk/ScrolledText.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
window, etc.)

Configuration options are passed to the Text widget.
A Frame widget is inserted between the master and the text, to hold
A Frame widget is inserted between the main and the text, to hold
the Scrollbar widget.
Most methods calls are inherited from the Text widget; Pack, Grid and
Place methods are redirected to the Frame widget however.
Expand All @@ -17,8 +17,8 @@
from Tkconstants import RIGHT, LEFT, Y, BOTH

class ScrolledText(Text):
def __init__(self, master=None, **kw):
self.frame = Frame(master)
def __init__(self, main=None, **kw):
self.frame = Frame(main)
self.vbar = Scrollbar(self.frame)
self.vbar.pack(side=RIGHT, fill=Y)

Expand Down
34 changes: 17 additions & 17 deletions chroot/usr/lib/python2.7/lib-tk/SimpleDialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@

class SimpleDialog:

def __init__(self, master,
def __init__(self, main,
text='', buttons=[], default=None, cancel=None,
title=None, class_=None):
if class_:
self.root = Toplevel(master, class_=class_)
self.root = Toplevel(main, class_=class_)
else:
self.root = Toplevel(master)
self.root = Toplevel(main)
if title:
self.root.title(title)
self.root.iconname(title)
Expand All @@ -32,32 +32,32 @@ def __init__(self, master,
b.config(relief=RIDGE, borderwidth=8)
b.pack(side=LEFT, fill=BOTH, expand=1)
self.root.protocol('WM_DELETE_WINDOW', self.wm_delete_window)
self._set_transient(master)
self._set_transient(main)

def _set_transient(self, master, relx=0.5, rely=0.3):
def _set_transient(self, main, relx=0.5, rely=0.3):
widget = self.root
widget.withdraw() # Remain invisible while we figure out the geometry
widget.transient(master)
widget.transient(main)
widget.update_idletasks() # Actualize geometry information
if master.winfo_ismapped():
m_width = master.winfo_width()
m_height = master.winfo_height()
m_x = master.winfo_rootx()
m_y = master.winfo_rooty()
if main.winfo_ismapped():
m_width = main.winfo_width()
m_height = main.winfo_height()
m_x = main.winfo_rootx()
m_y = main.winfo_rooty()
else:
m_width = master.winfo_screenwidth()
m_height = master.winfo_screenheight()
m_width = main.winfo_screenwidth()
m_height = main.winfo_screenheight()
m_x = m_y = 0
w_width = widget.winfo_reqwidth()
w_height = widget.winfo_reqheight()
x = m_x + (m_width - w_width) * relx
y = m_y + (m_height - w_height) * rely
if x+w_width > master.winfo_screenwidth():
x = master.winfo_screenwidth() - w_width
if x+w_width > main.winfo_screenwidth():
x = main.winfo_screenwidth() - w_width
elif x < 0:
x = 0
if y+w_height > master.winfo_screenheight():
y = master.winfo_screenheight() - w_height
if y+w_height > main.winfo_screenheight():
y = main.winfo_screenheight() - w_height
elif y < 0:
y = 0
widget.geometry("+%d+%d" % (x, y))
Expand Down
Loading