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

Skip to content

Commit 9a37159

Browse files
committed
Merged revisions 59595-59604 via svnmerge from
svn+ssh://[email protected]/python/trunk ........ r59596 | brett.cannon | 2007-12-24 20:58:25 +0100 (Mon, 24 Dec 2007) | 4 lines Fix the docstrings of time.localtime() and gmtime() for the tm_mday field. Will backport. ........ r59598 | brett.cannon | 2007-12-25 00:43:30 +0100 (Tue, 25 Dec 2007) | 3 lines Make trailing whitespace explicit (including when it is an all-whitespace line). ........ r59599 | brett.cannon | 2007-12-25 01:14:34 +0100 (Tue, 25 Dec 2007) | 7 lines Actually execute the tests for the getter/setter/deleter tests on properties. Also fix the test by having the test classes inherit from object. Are the getter/setter/deleter attributes supposed to be able to chain? As of right now they can't as the property tries to call what the property returns, which is another property when they are chained. ........ r59600 | brett.cannon | 2007-12-25 07:44:59 +0100 (Tue, 25 Dec 2007) | 2 lines Remove a straggling debugging print line. ........ r59604 | kurt.kaiser | 2007-12-28 05:18:01 +0100 (Fri, 28 Dec 2007) | 2 lines Configure Dialog: improved layout for keybinding. Patch 1457 Tal Einat. ........
1 parent f609a34 commit 9a37159

5 files changed

Lines changed: 41 additions & 39 deletions

File tree

Lib/idlelib/NEWS.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ What's New in IDLE 2.6a1?
4545

4646
*Release date: XX-XXX-200X* UNRELEASED, but merged into 3.0
4747

48+
- Configure Dialog: improved layout for keybinding. Patch 1457 Tal Einat.
49+
4850
- tabpage.py updated: tabbedPages.py now supports multiple dynamic rows
4951
of tabs. Patch 1612746 Tal Einat.
5052

Lib/idlelib/configDialog.py

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def CreateWidgets(self):
9090
self.buttonApply.pack(side=LEFT,padx=5)
9191
self.buttonCancel.pack(side=LEFT,padx=5)
9292
frameActionButtons.pack(side=BOTTOM)
93-
Frame(self, border=0).pack(side=BOTTOM,pady=2)
93+
Frame(self, height=2, borderwidth=0).pack(side=BOTTOM)
9494
self.tabPages.pack(side=TOP,expand=TRUE,fill=BOTH)
9595

9696
def CreatePageFontTab(self):
@@ -274,26 +274,26 @@ def CreatePageKeys(self):
274274
self.listBindings.config(xscrollcommand=scrollTargetX.set)
275275
self.buttonNewKeys=Button(frameCustom,text='Get New Keys for Selection',
276276
command=self.GetNewKeys,state=DISABLED)
277-
buttonSaveCustomKeys=Button(frameCustom,
278-
text='Save as New Custom Key Set',command=self.SaveAsNewKeySet)
279277
#frameKeySets
280-
labelTypeTitle=Label(frameKeySets,text='Select : ')
281-
self.radioKeysBuiltin=Radiobutton(frameKeySets,variable=self.keysAreBuiltin,
282-
value=1,command=self.SetKeysType,text='a Built-in Key Set')
283-
self.radioKeysCustom=Radiobutton(frameKeySets,variable=self.keysAreBuiltin,
284-
value=0,command=self.SetKeysType,text='a Custom Key Set')
285-
self.optMenuKeysBuiltin=DynOptionMenu(frameKeySets,
278+
frames = [Frame(frameKeySets, padx=2, pady=2, borderwidth=0)
279+
for i in range(2)]
280+
self.radioKeysBuiltin=Radiobutton(frames[0],variable=self.keysAreBuiltin,
281+
value=1,command=self.SetKeysType,text='Use a Built-in Key Set')
282+
self.radioKeysCustom=Radiobutton(frames[0],variable=self.keysAreBuiltin,
283+
value=0,command=self.SetKeysType,text='Use a Custom Key Set')
284+
self.optMenuKeysBuiltin=DynOptionMenu(frames[0],
286285
self.builtinKeys,None,command=None)
287-
self.optMenuKeysCustom=DynOptionMenu(frameKeySets,
286+
self.optMenuKeysCustom=DynOptionMenu(frames[0],
288287
self.customKeys,None,command=None)
289-
self.buttonDeleteCustomKeys=Button(frameKeySets,text='Delete Custom Key Set',
288+
self.buttonDeleteCustomKeys=Button(frames[1],text='Delete Custom Key Set',
290289
command=self.DeleteCustomKeys)
290+
buttonSaveCustomKeys=Button(frames[1],
291+
text='Save as New Custom Key Set',command=self.SaveAsNewKeySet)
291292
##widget packing
292293
#body
293-
frameCustom.pack(side=LEFT,padx=5,pady=5,expand=TRUE,fill=BOTH)
294-
frameKeySets.pack(side=LEFT,padx=5,pady=5,fill=Y)
294+
frameCustom.pack(side=BOTTOM,padx=5,pady=5,expand=TRUE,fill=BOTH)
295+
frameKeySets.pack(side=BOTTOM,padx=5,pady=5,fill=BOTH)
295296
#frameCustom
296-
buttonSaveCustomKeys.pack(side=BOTTOM,fill=X,padx=5,pady=5)
297297
self.buttonNewKeys.pack(side=BOTTOM,fill=X,padx=5,pady=5)
298298
frameTarget.pack(side=LEFT,padx=5,pady=5,expand=TRUE,fill=BOTH)
299299
#frame target
@@ -304,12 +304,14 @@ def CreatePageKeys(self):
304304
scrollTargetY.grid(row=1,column=1,sticky=NS)
305305
scrollTargetX.grid(row=2,column=0,sticky=EW)
306306
#frameKeySets
307-
labelTypeTitle.pack(side=TOP,anchor=W,padx=5,pady=5)
308-
self.radioKeysBuiltin.pack(side=TOP,anchor=W,padx=5)
309-
self.radioKeysCustom.pack(side=TOP,anchor=W,padx=5,pady=2)
310-
self.optMenuKeysBuiltin.pack(side=TOP,fill=X,padx=5,pady=5)
311-
self.optMenuKeysCustom.pack(side=TOP,fill=X,anchor=W,padx=5,pady=5)
312-
self.buttonDeleteCustomKeys.pack(side=TOP,fill=X,padx=5,pady=5)
307+
self.radioKeysBuiltin.grid(row=0, column=0, sticky=W+NS)
308+
self.radioKeysCustom.grid(row=1, column=0, sticky=W+NS)
309+
self.optMenuKeysBuiltin.grid(row=0, column=1, sticky=NSEW)
310+
self.optMenuKeysCustom.grid(row=1, column=1, sticky=NSEW)
311+
self.buttonDeleteCustomKeys.pack(side=LEFT,fill=X,expand=True,padx=2)
312+
buttonSaveCustomKeys.pack(side=LEFT,fill=X,expand=True,padx=2)
313+
frames[0].pack(side=TOP, fill=BOTH, expand=True)
314+
frames[1].pack(side=TOP, fill=X, expand=True, pady=2)
313315
return frame
314316

315317
def CreatePageGeneral(self):

Lib/test/test_descr.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1976,7 +1976,7 @@ class X(object):
19761976

19771977

19781978
def properties_plus():
1979-
class C:
1979+
class C(object):
19801980
foo = property(doc="hello")
19811981
@foo.getter
19821982
def foo(self):
@@ -1991,8 +1991,11 @@ def foo(self):
19911991
assert C.foo.__doc__ == "hello"
19921992
assert not hasattr(c, "foo")
19931993
c.foo = -42
1994+
assert hasattr(c, '_foo')
1995+
assert c._foo == 42
19941996
assert c.foo == 42
19951997
del c.foo
1998+
assert not hasattr(c, '_foo')
19961999
assert not hasattr(c, "foo")
19972000

19982001
class D(C):
@@ -2008,20 +2011,20 @@ def foo(self):
20082011
del d.foo
20092012
del d.foo
20102013

2011-
class E:
2014+
class E(object):
20122015
@property
20132016
def foo(self):
20142017
return self._foo
20152018
@foo.setter
2016-
def foo (self, value):
2019+
def foo(self, value):
20172020
raise RuntimeError
20182021
@foo.setter
2022+
def foo(self, value):
2023+
self._foo = abs(value)
20192024
@foo.deleter
20202025
def foo(self, value=None):
2021-
if value is None:
2022-
del self._foo
2023-
else:
2024-
self._foo = abs(value)
2026+
del self._foo
2027+
20252028
e = E()
20262029
e.foo = -42
20272030
assert e.foo == 42
@@ -4223,6 +4226,7 @@ def test_main():
42234226
recursions()
42244227
weakrefs()
42254228
properties()
4229+
properties_plus()
42264230
supers()
42274231
inherits()
42284232
keywords()

Misc/Vim/vimrc

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,12 @@ au BufRead,BufNewFile Makefile* set noexpandtab
4141
" Use the below highlight group when displaying bad whitespace is desired
4242
highlight BadWhitespace ctermbg=red guibg=red
4343

44-
" Display tabs at the beginning of a line in Python mode as bad
44+
" Display tabs at the beginning of a line in Python mode as bad.
4545
" Should be done for C code, but not until all code has been moved to 4-space
4646
" indents.
4747
au BufRead,BufNewFile *.py,*.pyw match BadWhitespace /^\t\+/
48+
" Make trailing whitespace be flagged as bad.
49+
au BufRead,BufNewFile *.py,*.pyw,*.c,*.h match BadWhitespace /\s\+$/
4850

4951
" Wrap text after a certain number of characters
5052
" Python: 79
@@ -86,12 +88,3 @@ au BufNewFile *.py,*.pyw,*.c,*.h set fileformat=unix
8688
" Keep indentation level from previous line: ``set autoindent``
8789

8890
" Folding based on indentation: ``set foldmethod=indent``
89-
90-
" Make trailing whitespace explicit (left off since this will automatically
91-
" insert the highlight or characters *as you type*, which can get annoying):
92-
"``match BadWhitespace /\s\+$/``
93-
"
94-
" or, for a non-colored, character-based solution:
95-
"
96-
"``set list listchars=trail:-``
97-

Modules/timemodule.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ time_gmtime(PyObject *self, PyObject *args)
332332
}
333333

334334
PyDoc_STRVAR(gmtime_doc,
335-
"gmtime([seconds]) -> (tm_year, tm_mon, tm_day, tm_hour, tm_min,\n\
335+
"gmtime([seconds]) -> (tm_year, tm_mon, tm_mday, tm_hour, tm_min,\n\
336336
tm_sec, tm_wday, tm_yday, tm_isdst)\n\
337337
\n\
338338
Convert seconds since the Epoch to a time tuple expressing UTC (a.k.a.\n\
@@ -348,7 +348,8 @@ time_localtime(PyObject *self, PyObject *args)
348348
}
349349

350350
PyDoc_STRVAR(localtime_doc,
351-
"localtime([seconds]) -> (tm_year,tm_mon,tm_day,tm_hour,tm_min,tm_sec,tm_wday,tm_yday,tm_isdst)\n\
351+
"localtime([seconds]) -> (tm_year,tm_mon,tm_mday,tm_hour,tm_min,\n\
352+
tm_sec,tm_wday,tm_yday,tm_isdst)\n\
352353
\n\
353354
Convert seconds since the Epoch to a time tuple expressing local time.\n\
354355
When 'seconds' is not passed in, convert the current time instead.");

0 commit comments

Comments
 (0)