Commit Graph

32 Commits

Author SHA1 Message Date
Damien George
402df833fe py/modsys: Introduce sys.implementation._machine constant.
This contains a string useful for identifying the underlying machine.  This
string is kept consistent with the second part of the REPL banner via the
new config option MICROPY_BANNER_MACHINE.

This makes os.uname() more or less redundant, as all the information in
os.uname() is now available in the sys module.

Signed-off-by: Damien George <damien@micropython.org>
2022-04-28 17:23:03 +10:00
Damien George
59c5d41611 py/modsys: Rename sys.implementation.mpy to sys.implementation._mpy.
Per CPython docs, non-standard attributes must begin with an underscore.

Signed-off-by: Damien George <damien@micropython.org>
2022-04-28 17:23:03 +10:00
Damien George
ac2293161e py/modsys: Add optional mutable attributes sys.ps1/ps2 and use them.
This allows customising the REPL prompt strings.

Signed-off-by: Damien George <damien@micropython.org>
2022-03-10 10:58:33 +11:00
Damien George
cac939ddc3 py/modsys: Add optional sys.tracebacklimit attribute.
With behaviour as per CPython.

Signed-off-by: Damien George <damien@micropython.org>
2022-03-10 10:43:21 +11:00
Jim Mussared
86394f70fc docs/library/sys.rst: Add note about '.frozen' as an entry in sys.path.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-12-18 00:08:07 +11:00
NitiKaur
b851950c26 docs/library/sys.rst: Add docs for sys.settrace. 2021-11-19 15:30:34 +11:00
Jim Mussared
c737cde947 docs: Replace ufoo with foo in all docs.
Anywhere a module is mentioned, use its "non-u" name for consistency.

The "import module" vs "import umodule" is something of a FAQ, and this
commit intends to help clear that up.  As a first approximation MicroPython
is Python, and so imports should work the same as Python and use the same
name, to a first approximation.  The u-version of a module is a detail that
can be learned later on, when the user wants to understand more and have
finer control over importing.

Existing Python code should just work, as much as it is possible to do that
within the constraints of embedded systems, and the MicroPython
documentation should match the idiomatic way to write Python code.

With universal weak links for modules (via MICROPY_MODULE_WEAK_LINKS) users
can consistently use "import foo" across all ports (with the exception of
the minimal ports).  And the ability to override/extend via "foo.py"
continues to work well.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-08-13 22:53:29 +10:00
Jim Mussared
218606351c docs: Rename ufoo.rst to foo.rst.
This is a simple rename of the files, no content changes
(other than updating index.rst to use the new paths)

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-08-13 20:31:32 +10:00
stijn
40ad8f1666 all: Rename "sys" module to "usys".
This is consistent with the other 'micro' modules and allows implementing
additional features in Python via e.g. micropython-lib's sys.

Note this is a breaking change (not backwards compatible) for ports which
do not enable weak links, as "import sys" must now be replaced with
"import usys".
2020-09-04 00:10:24 +10:00
Jason Neal
7ef2f65114 docs/library: Add / to indicate positional-only args in library docs.
Removes the confusion of positional-only arguments which have defaults that
look like keyword arguments.
2020-01-12 13:44:59 +11:00
Tom McDermott
d5a7741606 docs/library: Document that sys.version_info returns a 3-tuple only.
See issue #4970.
2019-08-15 18:12:22 +10:00
Damien George
ed9c0185d8 docs/library/sys: Add documentation for sys.atexit function. 2019-08-15 17:42:38 +10:00
Paul Sokolovsky
3ff7040c8a docs/library: Add xrefs to "stream" dictionary entry for many modules. 2017-12-04 18:36:20 +02:00
Paul Sokolovsky
64a3c52f66 docs: Consistently link to micropython-lib in glossary. 2017-08-22 09:33:31 +03:00
Paul Sokolovsky
465d84b7e7 docs/library: Add CPython docs xref to each pertinent module.
Cross-reference text/link is implemented as RST substitution, so easy to
consistently.
2017-07-02 15:37:31 +03:00
Paul Sokolovsky
f8ac28964d docs/{micropython,sys,uos}: Use markup adhering to the latest docs conventions. 2017-06-28 00:37:47 +03:00
Paul Sokolovsky
2b6dcdd3e4 docs/sys: print_exception: Fixes/clarifications. 2016-06-18 19:06:53 +03:00
Paul Sokolovsky
9de5eb278d docs/sys: Detailed description of print_exception() diff from traceback module. 2016-06-10 23:06:56 +03:00
Paul Sokolovsky
fd283eba64 docs/sys: Describe sys.platform is port-neutral manner. 2016-05-01 14:39:38 +03:00
Paul Sokolovsky
e9b7610748 docs/sys: Describe sys.maxsize. 2016-05-01 14:31:08 +03:00
Paul Sokolovsky
59603a2e89 docs/sys: Describe sys.implementation. 2016-05-01 13:59:34 +03:00
Paul Sokolovsky
4fb9452bff docs/sys: Clean up print_exception() description. 2016-05-01 13:44:06 +03:00
Paul Sokolovsky
ad2889c141 docs/sys: Clarify description of sys.exit(). 2016-05-01 13:42:36 +03:00
Paul Sokolovsky
8ad1659f68 docs/sys: Make module variable descriptions proper sentences. 2016-05-01 13:38:45 +03:00
Paul Sokolovsky
7781caf8d3 docs/sys: Remove port-specific details from description of stdin/out/err. 2016-05-01 13:37:28 +03:00
Paul Sokolovsky
a9ed42b3b4 docs/sys: Document sys.modules. 2016-05-01 13:32:15 +03:00
Damien George
3eece29807 docs: Change "Micro Python" to "MicroPython" in all places in docs. 2015-06-04 23:53:26 +01:00
Damien George
a37656c132 docs: Make admonition for CPy-difference use "attention" class.
This renders it in yellow/orange box on RTD server.
2014-12-22 13:42:30 +00:00
Damien George
6d3ae569cf docs: Add CPy diff note for print_exception; embellish sys.platform. 2014-12-19 22:10:38 +00:00
Paul Sokolovsky
6c3fc74656 docs: Add sys.print_exception(). 2014-12-10 20:31:38 +02:00
Damien George
a58713a899 docs: Cleanup and update some docs. 2014-10-31 22:21:37 +00:00
Damien George
88d3054ac0 docs: Import documentation from source-code inline comments.
The inline docs (prefixed with /// in .c files) have been converted to
RST format and put in the docs subdirectory.
2014-10-31 01:37:19 +00:00