Michael Buesch
ff27e3c8ba
socket: Add socket.error
...
Older CPython versions raised socker.error (or classes derived from it)
as exceptions on errors. Various software still uses it to be compatible
with older Python versions. As it's one-line fix, allow MicroPython to
run such code too.
try:
socket...
except socker.error as e:
...
2015-12-09 00:34:48 +02:00
Paul Sokolovsky
17d96d35b5
uasyncio: Optimize reader/writer callbacks with no arguments.
...
Avoids allocating tuples.
2015-12-07 01:13:00 +02:00
Michael Buesch
18c9084a27
functools: Add very simple implementation of reduce()
...
The implementation was taken from
https://docs.python.org/3/library/functools.html
2015-12-05 22:24:08 +02:00
Paul Sokolovsky
f9eed2340d
uasyncio.core: Optimize for syscalls with single args.
...
Avoids allocating argument tuples.
2015-12-05 22:23:10 +02:00
Michael Buesch
4f36827a6c
__future__: Add dummies for all available feature descriptions
...
This will make statements such as
from __future__ import division
not fail.
2015-12-05 22:13:12 +02:00
Paul Sokolovsky
b6d9dd67d5
collections.deque: Add extend() method.
2015-12-03 00:36:07 +02:00
Paul Sokolovsky
fdcf1aad99
socket: Release 0.3.2.
2015-12-01 19:05:46 +02:00
Paul Sokolovsky
5c2e0becfc
socket: Support "" as host addr, meaning INADDR_ANY (0.0.0.0).
2015-12-01 19:05:30 +02:00
Paul Sokolovsky
9643541e6e
urllib.urequest: Release 0.1.
2015-11-21 02:25:56 +02:00
Paul Sokolovsky
de50429b1a
urllib.urequest: Add absolutely minimal urlopen() implementation.
...
Optimized for low-memory bare-metal systems.
2015-11-21 02:25:31 +02:00
Paul Sokolovsky
bba8fb1032
urllib.parse: Requires collections.defaultdict class.
2015-11-16 18:47:58 +02:00
Paul Sokolovsky
38b6f615d8
upip: Release 0.6.2.
2015-11-15 00:11:56 +02:00
Nico
cd1fea8798
upip: MaxOSX mkdir("/") returns EISDIR, and not EEXIST.
...
Unlike Linux, which return EEXIST. This MacOSX behavior is not documented
in the official documentation:
https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man2/mkdir.2.html
(EISDIR isn't described as possible error for mkdir()!), but other projects
had to apply similar workarounds, e.g.:
https://github.com/janestreet/core/issues/7 . The issue appear to happen
only for root directory path, but workaround is applied conservatively
just in case.
2015-11-15 00:10:30 +02:00
Paul Sokolovsky
4b2d7e91ff
upip: Workaround _os.getenv() accepting only 1 argument.
2015-11-14 17:51:55 +02:00
Paul Sokolovsky
bd37778efb
upip: Get rid of FFI dependency, use builtin _os module instead.
...
Also, delete as many as possible other dependencies (needed functions
are just copied into codebase). This will allow to work on static
MicroPython builds (including being a first step to support bare-metal
ports).
2015-11-14 00:02:10 +02:00
Delio Brignoli
1773bc0788
contextlib: modify TestExitStack to work in uPy
2015-11-04 00:27:03 +03:00
Delio Brignoli
b9f3b49e2e
contextlib: add TestExitStack from CPython 3.4
2015-11-04 00:27:03 +03:00
Delio Brignoli
5fd99fe680
contextlib: modify ExitStack to work in uPy
2015-11-04 00:27:03 +03:00
Delio Brignoli
e41f5da1ea
contextlib: re-instate ExitStack from CPython 3.4
2015-11-01 15:41:51 +01:00
Delio Brignoli
1260289917
unittest: add assertIsNone() and assertIsNotNone() methods to TestCase
2015-11-01 17:01:58 +03:00
Paul Sokolovsky
711eba3a7e
argparse: Release 0.3.1.
2015-10-22 20:52:57 +03:00
Delio Brignoli
680364d20c
contextlib: depend on ucontextlib and fix tests
2015-10-22 20:48:43 +03:00
Delio Brignoli
de39c2417c
ucontextlib: spin off minimal module from contextlib
2015-10-22 20:47:22 +03:00
Delio Brignoli
7472c8aa78
argparse: PEP8 formatting
2015-10-17 04:47:28 +02:00
Paul Sokolovsky
15da903277
socket: Release 0.3.1.
2015-10-19 10:12:12 +03:00
Paul Sokolovsky
8bb6857818
socket: Native struct sockaddr may come as bytes or bytearray.
2015-10-19 10:12:03 +03:00
Paul Sokolovsky
89480056ed
argparse: Release 0.3.
2015-10-19 10:05:48 +03:00
Delio Brignoli
5e9dcae281
argparse: Add test and fix support for pos arg with dest and no name.
2015-10-19 00:28:29 +01:00
Delio Brignoli
e0aab10144
argparse: Do not print a blank line when description is empty.
2015-10-19 00:28:24 +01:00
Delio Brignoli
dd34477222
argparse: Add support for multiple option names to add_argument().
2015-10-19 00:28:19 +01:00
Paul Sokolovsky
b9ca8ea921
upip: Honor MICROPYPATH environment variable.
2015-10-17 20:11:22 +03:00
Paul Sokolovsky
7c444be6ba
argparse: Release 0.2.
2015-10-16 23:03:34 +03:00
Paul Sokolovsky
2c5e45b1b8
argparse: Fix failing testcase.
2015-10-16 23:03:00 +03:00
Paul Sokolovsky
fca6f0cc72
argparse: Description arg is optional.
...
TODO: Make sure that in this case, good help message is printed to user.
2015-10-16 23:02:52 +03:00
Paul Sokolovsky
b0f8d85a62
socket: Release 0.3.
2015-10-16 00:36:13 +03:00
Paul Sokolovsky
e3903c9f64
socket: Allow connect() & bind() to take standard tuple of (host, port).
2015-10-16 00:35:49 +03:00
Paul Sokolovsky
36c802ca14
os: Release 0.3.
2015-10-11 17:42:15 +03:00
Paul Sokolovsky
a1cf086eb3
os: Implement execvp().
2015-10-11 17:41:41 +03:00
Paul Sokolovsky
fff07bd79a
os: Implement dup().
2015-10-11 17:36:28 +03:00
Paul Sokolovsky
e840da936f
xmltok: Release 0.1.
2015-10-10 13:16:47 +03:00
Paul Sokolovsky
db6c6e1a55
xmltok: Add test.
2015-10-10 13:10:11 +03:00
Paul Sokolovsky
8e19a487c5
xmltok: Get rid of string concatenation in a loop.
2015-10-10 13:10:11 +03:00
Paul Sokolovsky
e6a6503193
xmltok: Comment out unused token types.
2015-10-10 13:10:11 +03:00
Paul Sokolovsky
1c63b95740
xmltok: Yield attibute name and value at the same time.
2015-10-10 13:10:11 +03:00
Paul Sokolovsky
cdfe726ab6
xmltok: Make text_of() support namespaced tags.
2015-10-10 13:10:11 +03:00
Paul Sokolovsky
91c590185c
xmltok: Support XML namespaces.
...
Now all tags/attributes represented by pair (namspace, ident). "namespace"
is empty string for default namespace. E.g.:
('START_TAG', ('', 'specVersion'))
('END_TAG', ('s', 'Body'))
2015-10-10 13:10:11 +03:00
Paul Sokolovsky
cebf1973bc
xmltok: Initial draft version of XML tokenizer.
...
API roughly inspired by stdlib "tokenize" module.
2015-10-10 13:10:11 +03:00
Paul Sokolovsky
2bb224b562
_libc: Deprecated, superseded by ffilib.
2015-09-10 01:18:36 +03:00
Paul Sokolovsky
7b9dcba072
signal: Switch to ffilib.
2015-09-09 17:57:25 +03:00
Paul Sokolovsky
6752c6a66a
fcntl: Switch to ffilib.
2015-09-08 22:27:59 +03:00