]> granicus.if.org Git - python/commitdiff
Merged revisions 59595-59604 via svnmerge from
authorChristian Heimes <christian@cheimes.de>
Fri, 28 Dec 2007 14:08:13 +0000 (14:08 +0000)
committerChristian Heimes <christian@cheimes.de>
Fri, 28 Dec 2007 14:08:13 +0000 (14:08 +0000)
svn+ssh://pythondev@svn.python.org/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.
........

Lib/idlelib/NEWS.txt
Lib/idlelib/configDialog.py
Lib/test/test_descr.py
Misc/Vim/vimrc
Modules/timemodule.c

index 6688c5ac189edc1568de2da69db24cce78939f58..12a0c6f726eea58051c5952e840d1ac2e107b061 100644 (file)
@@ -45,6 +45,8 @@ What's New in IDLE 2.6a1?
 
 *Release date: XX-XXX-200X*  UNRELEASED, but merged into 3.0
 
+- Configure Dialog: improved layout for keybinding.  Patch 1457 Tal Einat.
+
 - tabpage.py updated: tabbedPages.py now supports multiple dynamic rows
   of tabs.  Patch 1612746 Tal Einat.
 
index d00b579c20cebcf57a57928e6a050df1dedf15f6..e7a06909cb5375aafebdfe6de4cd10c9880211aa 100644 (file)
@@ -90,7 +90,7 @@ class ConfigDialog(Toplevel):
         self.buttonApply.pack(side=LEFT,padx=5)
         self.buttonCancel.pack(side=LEFT,padx=5)
         frameActionButtons.pack(side=BOTTOM)
-        Frame(self, border=0).pack(side=BOTTOM,pady=2)
+        Frame(self, height=2, borderwidth=0).pack(side=BOTTOM)
         self.tabPages.pack(side=TOP,expand=TRUE,fill=BOTH)
 
     def CreatePageFontTab(self):
@@ -274,26 +274,26 @@ class ConfigDialog(Toplevel):
         self.listBindings.config(xscrollcommand=scrollTargetX.set)
         self.buttonNewKeys=Button(frameCustom,text='Get New Keys for Selection',
             command=self.GetNewKeys,state=DISABLED)
-        buttonSaveCustomKeys=Button(frameCustom,
-                text='Save as New Custom Key Set',command=self.SaveAsNewKeySet)
         #frameKeySets
-        labelTypeTitle=Label(frameKeySets,text='Select : ')
-        self.radioKeysBuiltin=Radiobutton(frameKeySets,variable=self.keysAreBuiltin,
-            value=1,command=self.SetKeysType,text='a Built-in Key Set')
-        self.radioKeysCustom=Radiobutton(frameKeySets,variable=self.keysAreBuiltin,
-            value=0,command=self.SetKeysType,text='a Custom Key Set')
-        self.optMenuKeysBuiltin=DynOptionMenu(frameKeySets,
+        frames = [Frame(frameKeySets, padx=2, pady=2, borderwidth=0)
+                  for i in range(2)]
+        self.radioKeysBuiltin=Radiobutton(frames[0],variable=self.keysAreBuiltin,
+            value=1,command=self.SetKeysType,text='Use a Built-in Key Set')
+        self.radioKeysCustom=Radiobutton(frames[0],variable=self.keysAreBuiltin,
+            value=0,command=self.SetKeysType,text='Use a Custom Key Set')
+        self.optMenuKeysBuiltin=DynOptionMenu(frames[0],
             self.builtinKeys,None,command=None)
-        self.optMenuKeysCustom=DynOptionMenu(frameKeySets,
+        self.optMenuKeysCustom=DynOptionMenu(frames[0],
             self.customKeys,None,command=None)
-        self.buttonDeleteCustomKeys=Button(frameKeySets,text='Delete Custom Key Set',
+        self.buttonDeleteCustomKeys=Button(frames[1],text='Delete Custom Key Set',
                 command=self.DeleteCustomKeys)
+        buttonSaveCustomKeys=Button(frames[1],
+                text='Save as New Custom Key Set',command=self.SaveAsNewKeySet)
         ##widget packing
         #body
-        frameCustom.pack(side=LEFT,padx=5,pady=5,expand=TRUE,fill=BOTH)
-        frameKeySets.pack(side=LEFT,padx=5,pady=5,fill=Y)
+        frameCustom.pack(side=BOTTOM,padx=5,pady=5,expand=TRUE,fill=BOTH)
+        frameKeySets.pack(side=BOTTOM,padx=5,pady=5,fill=BOTH)
         #frameCustom
-        buttonSaveCustomKeys.pack(side=BOTTOM,fill=X,padx=5,pady=5)
         self.buttonNewKeys.pack(side=BOTTOM,fill=X,padx=5,pady=5)
         frameTarget.pack(side=LEFT,padx=5,pady=5,expand=TRUE,fill=BOTH)
         #frame target
@@ -304,12 +304,14 @@ class ConfigDialog(Toplevel):
         scrollTargetY.grid(row=1,column=1,sticky=NS)
         scrollTargetX.grid(row=2,column=0,sticky=EW)
         #frameKeySets
-        labelTypeTitle.pack(side=TOP,anchor=W,padx=5,pady=5)
-        self.radioKeysBuiltin.pack(side=TOP,anchor=W,padx=5)
-        self.radioKeysCustom.pack(side=TOP,anchor=W,padx=5,pady=2)
-        self.optMenuKeysBuiltin.pack(side=TOP,fill=X,padx=5,pady=5)
-        self.optMenuKeysCustom.pack(side=TOP,fill=X,anchor=W,padx=5,pady=5)
-        self.buttonDeleteCustomKeys.pack(side=TOP,fill=X,padx=5,pady=5)
+        self.radioKeysBuiltin.grid(row=0, column=0, sticky=W+NS)
+        self.radioKeysCustom.grid(row=1, column=0, sticky=W+NS)
+        self.optMenuKeysBuiltin.grid(row=0, column=1, sticky=NSEW)
+        self.optMenuKeysCustom.grid(row=1, column=1, sticky=NSEW)
+        self.buttonDeleteCustomKeys.pack(side=LEFT,fill=X,expand=True,padx=2)
+        buttonSaveCustomKeys.pack(side=LEFT,fill=X,expand=True,padx=2)
+        frames[0].pack(side=TOP, fill=BOTH, expand=True)
+        frames[1].pack(side=TOP, fill=X, expand=True, pady=2)
         return frame
 
     def CreatePageGeneral(self):
index 199a49ca166ac5cd96f8a28cd4a2a4ee3dadea84..8ccece1e833ed282f1f268c0d90bfa0e3bc81909 100644 (file)
@@ -1976,7 +1976,7 @@ def properties():
 
 
 def properties_plus():
-    class C:
+    class C(object):
         foo = property(doc="hello")
         @foo.getter
         def foo(self):
@@ -1991,8 +1991,11 @@ def properties_plus():
     assert C.foo.__doc__ == "hello"
     assert not hasattr(c, "foo")
     c.foo = -42
+    assert hasattr(c, '_foo')
+    assert c._foo == 42
     assert c.foo == 42
     del c.foo
+    assert not hasattr(c, '_foo')
     assert not hasattr(c, "foo")
 
     class D(C):
@@ -2008,20 +2011,20 @@ def properties_plus():
     del d.foo
     del d.foo
 
-    class E:
+    class E(object):
         @property
         def foo(self):
             return self._foo
         @foo.setter
-        def foo (self, value):
+        def foo(self, value):
             raise RuntimeError
         @foo.setter
+        def foo(self, value):
+            self._foo = abs(value)
         @foo.deleter
         def foo(self, value=None):
-            if value is None:
-                del self._foo
-            else:
-                self._foo = abs(value)
+            del self._foo
+
     e = E()
     e.foo = -42
     assert e.foo == 42
@@ -4223,6 +4226,7 @@ def test_main():
     recursions()
     weakrefs()
     properties()
+    properties_plus()
     supers()
     inherits()
     keywords()
index 11ec638042ec3e0bc9e6bf317ccd939171ebdcdf..2013bf30e69b27cb36c9dd0657575357c7bf2acb 100644 (file)
@@ -41,10 +41,12 @@ au BufRead,BufNewFile Makefile* set noexpandtab
 " Use the below highlight group when displaying bad whitespace is desired
 highlight BadWhitespace ctermbg=red guibg=red
 
-" Display tabs at the beginning of a line in Python mode as bad
+" Display tabs at the beginning of a line in Python mode as bad.
 " Should be done for C code, but not until all code has been moved to 4-space
 "   indents.
 au BufRead,BufNewFile *.py,*.pyw match BadWhitespace /^\t\+/
+" Make trailing whitespace be flagged as bad.
+au BufRead,BufNewFile *.py,*.pyw,*.c,*.h match BadWhitespace /\s\+$/
 
 " Wrap text after a certain number of characters
 " Python: 79 
@@ -86,12 +88,3 @@ au BufNewFile *.py,*.pyw,*.c,*.h set fileformat=unix
 " Keep indentation level from previous line: ``set autoindent``
 
 " Folding based on indentation: ``set foldmethod=indent``
-
-" Make trailing whitespace explicit (left off since this will automatically
-" insert the highlight or characters *as you type*, which can get annoying):
-"``match BadWhitespace /\s\+$/``
-"
-" or, for a non-colored, character-based solution:
-"
-"``set list listchars=trail:-``
-
index 36a723ae339249afd67df675531eaa18ee3a1663..8854d0d825aff1e4b62a74e0e8fa8a4346517b53 100644 (file)
@@ -332,7 +332,7 @@ time_gmtime(PyObject *self, PyObject *args)
 }
 
 PyDoc_STRVAR(gmtime_doc,
-"gmtime([seconds]) -> (tm_year, tm_mon, tm_day, tm_hour, tm_min,\n\
+"gmtime([seconds]) -> (tm_year, tm_mon, tm_mday, tm_hour, tm_min,\n\
                        tm_sec, tm_wday, tm_yday, tm_isdst)\n\
 \n\
 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)
 }
 
 PyDoc_STRVAR(localtime_doc,
-"localtime([seconds]) -> (tm_year,tm_mon,tm_day,tm_hour,tm_min,tm_sec,tm_wday,tm_yday,tm_isdst)\n\
+"localtime([seconds]) -> (tm_year,tm_mon,tm_mday,tm_hour,tm_min,\n\
+                         tm_sec,tm_wday,tm_yday,tm_isdst)\n\
 \n\
 Convert seconds since the Epoch to a time tuple expressing local time.\n\
 When 'seconds' is not passed in, convert the current time instead.");