summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2008-01-08 15:46:10 (GMT)
committerChristian Heimes <christian@cheimes.de>2008-01-08 15:46:10 (GMT)
commitb39a756afd08a2261dffe2b649f3a3550fb6294f (patch)
treefbfd9f8215dcddc0ff66b3cf935409d7aa1e60f9 /Doc
parent41f278ffa5babb0e704c9331030a58937a398902 (diff)
downloadcpython-b39a756afd08a2261dffe2b649f3a3550fb6294f.zip
cpython-b39a756afd08a2261dffe2b649f3a3550fb6294f.tar.gz
cpython-b39a756afd08a2261dffe2b649f3a3550fb6294f.tar.bz2
Added __enter__ and __exit__ functions to HKEY object
Added ExpandEnvironmentStrings to the _winreg module.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/_winreg.rst18
1 files changed, 18 insertions, 0 deletions
diff --git a/Doc/library/_winreg.rst b/Doc/library/_winreg.rst
index 7a5aa38..2544b5a 100644
--- a/Doc/library/_winreg.rst
+++ b/Doc/library/_winreg.rst
@@ -133,6 +133,16 @@ This module offers the following functions:
+-------+--------------------------------------------+
+.. function:: ExpandEnvironmentStrings(unicode)
+
+ Expands environment strings %NAME% in unicode string like const:`REG_EXPAND_SZ`::
+
+ >>> ExpandEnvironmentStrings(u"%windir%")
+ u"C:\\Windows"
+
+ .. versionadded: 2.6
+
+
.. function:: FlushKey(key)
Writes all the attributes of a key to the registry.
@@ -418,3 +428,11 @@ handle, and also disconnect the Windows handle from the handle object.
handle is not closed. You would call this function when you need the
underlying Win32 handle to exist beyond the lifetime of the handle object.
+.. method:: PyHKEY.__enter__()
+.. method:: PyHKEY.__exit__(*exc_info)
+
+ The HKEY object implements __enter__ and __exit__ and thus supports the
+ context protocol for the with statement.
+
+ .. versionadded: 2.6
+