summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/os.rst5
-rw-r--r--Doc/library/platform.rst24
-rw-r--r--Doc/library/webbrowser.rst17
3 files changed, 44 insertions, 2 deletions
diff --git a/Doc/library/os.rst b/Doc/library/os.rst
index 09d8228..e1f29ae 100644
--- a/Doc/library/os.rst
+++ b/Doc/library/os.rst
@@ -784,6 +784,11 @@ process and user.
:func:`socket.gethostname` or even
``socket.gethostbyaddr(socket.gethostname())``.
+ On macOS, iOS and Android, this returns the *kernel* name and version (i.e.,
+ ``'Darwin'`` on macOS and iOS; ``'Linux'`` on Android). :func:`platform.uname()`
+ can be used to get the user-facing operating system name and version on iOS and
+ Android.
+
.. availability:: Unix.
.. versionchanged:: 3.3
diff --git a/Doc/library/platform.rst b/Doc/library/platform.rst
index 6af9168..069dab7 100644
--- a/Doc/library/platform.rst
+++ b/Doc/library/platform.rst
@@ -148,6 +148,9 @@ Cross Platform
Returns the system/OS name, such as ``'Linux'``, ``'Darwin'``, ``'Java'``,
``'Windows'``. An empty string is returned if the value cannot be determined.
+ On iOS and Android, this returns the user-facing OS name (i.e, ``'iOS``,
+ ``'iPadOS'`` or ``'Android'``). To obtain the kernel name (``'Darwin'`` or
+ ``'Linux'``), use :func:`os.uname()`.
.. function:: system_alias(system, release, version)
@@ -161,6 +164,8 @@ Cross Platform
Returns the system's release version, e.g. ``'#3 on degas'``. An empty string is
returned if the value cannot be determined.
+ On iOS and Android, this is the user-facing OS version. To obtain the
+ Darwin or Linux kernel version, use :func:`os.uname()`.
.. function:: uname()
@@ -238,7 +243,6 @@ Windows Platform
macOS Platform
--------------
-
.. function:: mac_ver(release='', versioninfo=('','',''), machine='')
Get macOS version information and return it as tuple ``(release, versioninfo,
@@ -248,6 +252,24 @@ macOS Platform
Entries which cannot be determined are set to ``''``. All tuple entries are
strings.
+iOS Platform
+------------
+
+.. function:: ios_ver(system='', release='', model='', is_simulator=False)
+
+ Get iOS version information and return it as a
+ :func:`~collections.namedtuple` with the following attributes:
+
+ * ``system`` is the OS name; either ``'iOS'`` or ``'iPadOS'``.
+ * ``release`` is the iOS version number as a string (e.g., ``'17.2'``).
+ * ``model`` is the device model identifier; this will be a string like
+ ``'iPhone13,2'`` for a physical device, or ``'iPhone'`` on a simulator.
+ * ``is_simulator`` is a boolean describing if the app is running on a
+ simulator or a physical device.
+
+ Entries which cannot be determined are set to the defaults given as
+ parameters.
+
Unix Platforms
--------------
diff --git a/Doc/library/webbrowser.rst b/Doc/library/webbrowser.rst
index 4667b81..c1c4619 100644
--- a/Doc/library/webbrowser.rst
+++ b/Doc/library/webbrowser.rst
@@ -33,6 +33,13 @@ allow the remote browser to maintain its own windows on the display. If remote
browsers are not available on Unix, the controlling process will launch a new
browser and wait.
+On iOS, the :envvar:`BROWSER` environment variable, as well as any arguments
+controlling autoraise, browser preference, and new tab/window creation will be
+ignored. Web pages will *always* be opened in the user's preferred browser, in
+a new tab, with the browser being brought to the foreground. The use of the
+:mod:`webbrowser` module on iOS requires the :mod:`ctypes` module. If
+:mod:`ctypes` isn't available, calls to :func:`.open` will fail.
+
The script :program:`webbrowser` can be used as a command-line interface for the
module. It accepts a URL as the argument. It accepts the following optional
parameters: ``-n`` opens the URL in a new browser window, if possible;
@@ -147,6 +154,8 @@ for the controller classes, all defined in this module.
+------------------------+-----------------------------------------+-------+
| ``'chromium-browser'`` | ``Chromium('chromium-browser')`` | |
+------------------------+-----------------------------------------+-------+
+| ``'iosbrowser'`` | ``IOSBrowser`` | \(4) |
++------------------------+-----------------------------------------+-------+
Notes:
@@ -161,7 +170,10 @@ Notes:
Only on Windows platforms.
(3)
- Only on macOS platform.
+ Only on macOS.
+
+(4)
+ Only on iOS.
.. versionadded:: 3.2
A new :class:`!MacOSXOSAScript` class has been added
@@ -176,6 +188,9 @@ Notes:
Removed browsers include Grail, Mosaic, Netscape, Galeon,
Skipstone, Iceape, and Firefox versions 35 and below.
+.. versionchanged:: 3.13
+ Support for iOS has been added.
+
Here are some simple examples::
url = 'https://docs.python.org/'