-
-
Notifications
You must be signed in to change notification settings - Fork 33.9k
bpo-38053 Update documentation for plistlib #15727
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,8 @@ | ||
| :mod:`plistlib` --- Generate and parse Mac OS X ``.plist`` files | ||
| ================================================================ | ||
| :mod:`plistlib` --- Generate and parse Apple ``.plist`` files | ||
| ============================================================= | ||
|
|
||
| .. module:: plistlib | ||
| :synopsis: Generate and parse Mac OS X plist files. | ||
| :synopsis: Generate and parse Apple plist files. | ||
|
|
||
| .. moduleauthor:: Jack Jansen | ||
| .. sectionauthor:: Georg Brandl <[email protected]> | ||
|
|
@@ -17,7 +17,8 @@ | |
| -------------- | ||
|
|
||
| This module provides an interface for reading and writing the "property list" | ||
| files used mainly by Mac OS X and supports both binary and XML plist files. | ||
| files used by Apple, primarily on macOS and iOS. This module supports both binary | ||
| and XML plist files. | ||
|
|
||
| The property list (``.plist``) file format is a simple serialization supporting | ||
| basic object types, like dictionaries, lists, numbers and strings. Usually the | ||
|
|
@@ -33,9 +34,6 @@ Values can be strings, integers, floats, booleans, tuples, lists, dictionaries | |
| (but only with string keys), :class:`bytes`, :class:`bytearray` | ||
| or :class:`datetime.datetime` objects. | ||
|
|
||
| .. versionchanged:: 3.4 | ||
| New API, old API deprecated. Support for binary format plists added. | ||
|
|
||
| .. versionchanged:: 3.8 | ||
| Support added for reading and writing :class:`UID` tokens in binary plists as used | ||
| by NSKeyedArchiver and NSKeyedUnarchiver. | ||
|
|
@@ -76,16 +74,12 @@ This module defines the following functions: | |
| The parser for the binary format raises :exc:`InvalidFileException` | ||
| when the file cannot be parsed. | ||
|
|
||
| .. versionadded:: 3.4 | ||
|
|
||
|
|
||
| .. function:: loads(data, \*, fmt=None, dict_type=dict) | ||
|
|
||
| Load a plist from a bytes object. See :func:`load` for an explanation of | ||
| the keyword arguments. | ||
|
|
||
| .. versionadded:: 3.4 | ||
|
|
||
|
|
||
| .. function:: dump(value, fp, \*, fmt=FMT_XML, sort_keys=True, skipkeys=False) | ||
|
|
||
|
|
@@ -112,16 +106,25 @@ This module defines the following functions: | |
| An :exc:`OverflowError` will be raised for integer values that cannot | ||
| be represented in (binary) plist files. | ||
|
|
||
| .. versionadded:: 3.4 | ||
|
|
||
|
|
||
| .. function:: dumps(value, \*, fmt=FMT_XML, sort_keys=True, skipkeys=False) | ||
|
|
||
| Return *value* as a plist-formatted bytes object. See | ||
| the documentation for :func:`dump` for an explanation of the keyword | ||
| arguments of this function. | ||
|
|
||
| .. versionadded:: 3.4 | ||
|
|
||
| The following classes are available: | ||
|
|
||
| .. class:: UID(data) | ||
|
|
||
| Wraps an :class:`int`. This is used when reading or writing NSKeyedArchiver | ||
| encoded data, which contains UID (see PList manual). | ||
|
|
||
| It has one attribute, :attr:`data` which can be used to retrieve the int value | ||
bigfootjon marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| of the UID. :attr:`data` must be in the range `0 <= data <= 2**64`. | ||
|
|
||
| .. versionadded:: 3.8 | ||
|
|
||
|
|
||
| The following constants are available: | ||
|
|
@@ -130,15 +133,11 @@ The following constants are available: | |
|
|
||
| The XML format for plist files. | ||
|
|
||
| .. versionadded:: 3.4 | ||
|
|
||
|
|
||
| .. data:: FMT_BINARY | ||
|
|
||
| The binary format for plist files | ||
|
|
||
| .. versionadded:: 3.4 | ||
|
|
||
|
|
||
| Examples | ||
| -------- | ||
|
|
||
1 change: 1 addition & 0 deletions
1
Misc/NEWS.d/next/Documentation/2019-09-07-19-09-01.bpo-38053.lttibE.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Modernized the plistlib documentation |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.