<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/NetworkManager.git/examples/python, branch lr/unmanaged-err</title>
<subtitle>gitlab.freedesktop.org: NetworkManager/NetworkManager.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/'/>
<entry>
<title>examples: fix tracking destruction in destroy_nmc()</title>
<updated>2022-07-13T08:05:12+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2022-07-13T08:04:56+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=9511ac7d20b4fdd471039d7756a912f319111c8a'/>
<id>9511ac7d20b4fdd471039d7756a912f319111c8a</id>
<content type='text'>
While iterating the context (once), multiple sources can be dispatched.
So if we get a timeout and shortly after the weak-ref callback, then
we still need to honor the weak-ref.

In particular, because weak_ref.unref() is not safe to do after
the object was already destroyed. So we need to be correct about
tracking destruction.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
While iterating the context (once), multiple sources can be dispatched.
So if we get a timeout and shortly after the weak-ref callback, then
we still need to honor the weak-ref.

In particular, because weak_ref.unref() is not safe to do after
the object was already destroyed. So we need to be correct about
tracking destruction.
</pre>
</div>
</content>
</entry>
<entry>
<title>example: add python example for libnm, NMClient, GMainContext and async</title>
<updated>2022-07-05T16:36:01+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2022-06-30T21:55:03+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=b3181cfbee0ba3f0cd757b9d9b851e61da3cd000'/>
<id>b3181cfbee0ba3f0cd757b9d9b851e61da3cd000</id>
<content type='text'>
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1290
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1290
</pre>
</div>
</content>
</entry>
<entry>
<title>feat: add example for wifi sae connection</title>
<updated>2022-06-16T07:40:55+00:00</updated>
<author>
<name>liaohanqin</name>
<email>liaohanqin@uniontech.com</email>
</author>
<published>2022-06-02T09:05:19+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=5f530904de3ef0b52367bf58191b186d8da30cba'/>
<id>5f530904de3ef0b52367bf58191b186d8da30cba</id>
<content type='text'>
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1247
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1247
</pre>
</div>
</content>
</entry>
<entry>
<title>examples: improve finding last checkpoint in "checkpoint.py"</title>
<updated>2022-05-02T16:04:37+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2022-05-02T16:02:50+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=3ce3ed4c92fb7d21da8f8c2f77b093fa71130455'/>
<id>3ce3ed4c92fb7d21da8f8c2f77b093fa71130455</id>
<content type='text'>
This is a python example. We should do nice things, like
using max() for finding the maximum, instead of sorting.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is a python example. We should do nice things, like
using max() for finding the maximum, instead of sorting.
</pre>
</div>
</content>
</entry>
<entry>
<title>examples: add "--last" argument to "examples/python/gi/checkpoint.py"</title>
<updated>2022-02-23T16:07:16+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2022-02-22T15:27:29+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=4d70c9c4dbedb0b3904796206672b1124d66ce93'/>
<id>4d70c9c4dbedb0b3904796206672b1124d66ce93</id>
<content type='text'>
"examples/python/gi/checkpoint.py" is not only an example. It's also a
useful script for testing checkpoints.

Support a "--last" argument to specify the last checkpoint created.
Otherwise, when you are using this example from a test script, it
can be cumbersome to find the right checkpoint point.

Also, rename "client" and "nm_client" variables to "nmc". The purpose of
using the same variable name for the same thing is readability, but also
it works better when copy+paste snippets into the Python REPL.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
"examples/python/gi/checkpoint.py" is not only an example. It's also a
useful script for testing checkpoints.

Support a "--last" argument to specify the last checkpoint created.
Otherwise, when you are using this example from a test script, it
can be cumbersome to find the right checkpoint point.

Also, rename "client" and "nm_client" variables to "nmc". The purpose of
using the same variable name for the same thing is readability, but also
it works better when copy+paste snippets into the Python REPL.
</pre>
</div>
</content>
</entry>
<entry>
<title>examples/python: avoid Python2 "print" statement</title>
<updated>2022-02-14T16:02:34+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2022-02-14T15:57:53+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=95e6a0a6e253dfdcd77ebc65d629fb3789f5f0e3'/>
<id>95e6a0a6e253dfdcd77ebc65d629fb3789f5f0e3</id>
<content type='text'>
Recent python-black (22.0) dropped support for Python 2 and thus fail
for those files. Make the examples Python3 compatible.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Recent python-black (22.0) dropped support for Python 2 and thus fail
for those files. Make the examples Python3 compatible.
</pre>
</div>
</content>
</entry>
<entry>
<title>docs: update URL for latest online documentation</title>
<updated>2021-09-24T12:41:35+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2021-09-24T12:33:17+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=4521e2aa897985ddd105b4d3fbda720d23f3df69'/>
<id>4521e2aa897985ddd105b4d3fbda720d23f3df69</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>examples: rework nm-up-many.py for ratelimiting parallel activations</title>
<updated>2021-06-22T07:47:44+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2021-06-21T21:40:18+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=938f9b075fd4d78a74f7d566f579d1c6517501b6'/>
<id>938f9b075fd4d78a74f7d566f579d1c6517501b6</id>
<content type='text'>
The previous implementation did some ratelimiting, namely how many parallel
ActivateConnection D-Bus calls are in fly. This way we are able to kick off
many parallel calls, but the activations themselves were not ratelimited.

Rework the code. Now there are two rate limits (that can be set via environment
variables):

  NUM_PARALLEL_STARTING
  NUM_PARALLEL_IN_PROGRESS

This allows more control about how much is happening in parallel. If we are
going to activate 1000 profiles, then it matters that we do things in parallel,
but not everything at the same time.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The previous implementation did some ratelimiting, namely how many parallel
ActivateConnection D-Bus calls are in fly. This way we are able to kick off
many parallel calls, but the activations themselves were not ratelimited.

Rework the code. Now there are two rate limits (that can be set via environment
variables):

  NUM_PARALLEL_STARTING
  NUM_PARALLEL_IN_PROGRESS

This allows more control about how much is happening in parallel. If we are
going to activate 1000 profiles, then it matters that we do things in parallel,
but not everything at the same time.
</pre>
</div>
</content>
</entry>
<entry>
<title>example: drop unused import from "nm-up-many.py"</title>
<updated>2021-06-17T13:09:48+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2021-06-17T13:09:48+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=1b895d98c071c853beb0ad28e1a577247dfada70'/>
<id>1b895d98c071c853beb0ad28e1a577247dfada70</id>
<content type='text'>
lgtm.com complains about this. Avoid the warning.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
lgtm.com complains about this. Avoid the warning.
</pre>
</div>
</content>
</entry>
<entry>
<title>examples: add "examples/python/gi/nm-up-many.py"</title>
<updated>2021-06-11T20:48:41+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2021-06-08T16:14:26+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=be4b997e4f2ada217e1067029d53fdd47cff2159'/>
<id>be4b997e4f2ada217e1067029d53fdd47cff2159</id>
<content type='text'>
It's an example for how to use libnm and asynchronous API.
But it's also a script I will use to test activating many
profiles in parallel.

Also add a test script that creates many veth interfaces and connection
profiles. So now you can do:

   sudo NUM_DEVS=100 contrib/scripts/test-create-many-device-setup.sh setup
   ./examples/python/gi/nm-up-many.py c-a{1..100}

and cleanup with

   nmcli connection down c-a{1..100}
   sudo contrib/scripts/test-create-many-device-setup.sh cleanup

Of course, be careful to do this on your production machine.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It's an example for how to use libnm and asynchronous API.
But it's also a script I will use to test activating many
profiles in parallel.

Also add a test script that creates many veth interfaces and connection
profiles. So now you can do:

   sudo NUM_DEVS=100 contrib/scripts/test-create-many-device-setup.sh setup
   ./examples/python/gi/nm-up-many.py c-a{1..100}

and cleanup with

   nmcli connection down c-a{1..100}
   sudo contrib/scripts/test-create-many-device-setup.sh cleanup

Of course, be careful to do this on your production machine.
</pre>
</div>
</content>
</entry>
</feed>
