summaryrefslogtreecommitdiff
path: root/examples/python/gi
Commit message (Collapse)AuthorAgeFilesLines
* all: SPDX header conversionLubomir Rintel2019-09-1019-260/+19
| | | | | $ find * -type f |xargs perl contrib/scripts/spdx.pl $ git rm contrib/scripts/spdx.pl
* examples: improve usage/synposis for nm-update2.py and nm-add-connection2.pyThomas Haller2019-08-082-4/+14
|
* example: print WireGuard parameters in nm-wg-set example scriptThomas Haller2019-07-311-0/+12
| | | | (cherry picked from commit e966f4b272331fcf99914ee2c1a980074a01ed94)
* examples: add examples/python/gi/nm-update2.py example scriptThomas Haller2019-07-251-0/+155
| | | | This is useful for manually testing Update2() D-Bus API.
* examples: add examples/python/gi/nm-add-connection2.py example scriptth/settings-add2-and-update2-optionsThomas Haller2019-07-251-0/+156
| | | | This is useful for manually testing AddConnection2() D-Bus API.
* all: drop vim file variables from source filesThomas Haller2019-06-1116-16/+0
| | | | sed '1,3 { /^\(#\|--\) *vim:/d }; 1 { /^\/\* *vim:.*\*\/$/ d}' -i $(git grep -l 'vim:')
* all: drop emacs file variables from source filesThomas Haller2019-06-1116-16/+0
| | | | | | | | | | | | | | | | | | | | | | We no longer add these. If you use Emacs, configure it yourself. Also, due to our "smart-tab" usage the editor anyway does a subpar job handling our tabs. However, on the upside every user can choose whatever tab-width he/she prefers. If "smart-tabs" are used properly (like we do), every tab-width will work. No manual changes, just ran commands: F=($(git grep -l -e '-\*-')) sed '1 { /\/\* *-\*- *[mM]ode.*\*\/$/d }' -i "${F[@]}" sed '1,4 { /^\(#\|--\|dnl\) *-\*- [mM]ode/d }' -i "${F[@]}" Check remaining lines with: git grep -e '-\*-' The ultimate purpose of this is to cleanup our files and eventually use SPDX license identifiers. For that, first get rid of the boilerplate lines.
* all: codespell fixesLubomir Rintel2019-03-111-1/+1
| | | | | | | Codespel run with the same arguments as described in commit 58510ed56679 ('docs: misc. typos pt2'). (cherry picked from commit bf0c4e6ac2855088e3962693886bb6ab71856f7b)
* libnm: change nm_wireguard_peer_set_endpoint() API to allow validationThomas Haller2019-03-071-1/+1
| | | | | | | | This is an API break since 1.16-rc1. Similar to previous commit. (cherry picked from commit 8ae9aa2428c10aafb837c692fb39bfd04ef4235c)
* libnm: change nm_wireguard_peer_set_public_key() API to allow validationThomas Haller2019-03-071-1/+1
| | | | | | | | This is an API break since 1.16-rc1. Similar to previous commit. (cherry picked from commit 7962653918fbfd66b549d389a1cb2cf96ae0d3eb)
* libnm: change nm_wireguard_peer_set_preshared_key() API to allow validationThomas Haller2019-03-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | This is an API break since 1.16-rc1. The functions like _nm_utils_wireguard_decode_key() are internal API and not accessible to a libnm user. Maybe this should be public API, but for now it is not. That makes it cumbersome for a client to validate the setting. The client could only reimplement the validation (bad) or go ahead and set invalid value. When setting an invalid value, the user can afterwards detect it via nm_wireguard_peer_is_valid(), but at that point, it's not clear which exact property is invalid. First I wanted to keep the API conservative and not promissing too much. For example, not promising to do any validation when setting the key. However, libnm indeed validates the key at the time of setting it instead of doing lazy validation later. This makes sense, so we can keep this promise and just expose the validation result to the caller. Another downside of this is that the API just got more complicated. But it not provides a validation API, that we previously did not have. (cherry picked from commit d7bc1750c1bcc5082528d1f277e09454b2cbf1c2)
* examples: fix handling secrets in nm-wg-setThomas Haller2019-02-261-2/+17
| | | | | | | | | | | | | | When setting any secrets via D-Bus' Update2 call, then it assumes that all settings are reset. That means, when we modify any secrets in the client, we need to first load them all. Anyway, load always all secrets, then we can also print them in the get output. Honor WG_HIDE_KEYS like `wg` does. (cherry picked from commit 6aa9e52bd88670f10861e402a8c61c282a1e97c2)
* examples: improve hints about existing WireGuard profiles in nm-wg-setThomas Haller2019-02-261-6/+21
| | | | (cherry picked from commit b5a458c5ffeec091cc60abbabaed4d1a49952872)
* examples: add python example script "nm-wg-set" for modifying WireGuard profileThomas Haller2019-02-221-0/+423
| | | | | | | | Use the script to test how GObject introspection with libnm's WireGuard support works. Also, since support for WireGuard peers is not yet implemented in nmcli (or other clients), this script is rather useful.
* docs: misc. typosluz.paz2018-09-153-3/+3
| | | | | | Found via `codespell -q 3 --skip="*.po"` https://github.com/NetworkManager/NetworkManager/pull/203
* examples/python: utilize nm_utils_get_timestamp_msec()Lubomir Rintel2018-06-151-3/+1
|
* libnm: rework checkpoint APIThomas Haller2018-04-041-25/+30
| | | | | | | | | | | | | | | | | | | | | | The libnm API fir checkpoints was only introduced with 1.11. It is not yet stable, so there is still time to adjust it. Note that this changes API/ABI of the development branch. Changes: - we only add async variants of the checkpoint functions. I believe that synchronous D-Bus methods are fundamentally flawed, because they mess up the ordering of events. Rename the async functions by removing the "_async" suffix. This matches glib style, for which the async form is also not specially marked. - for function that refere to a particular checkpoint (rollback and destroy), accept the D-Bus path as string, instead of an NMCheckpoint instance. This form is more flexible, because it allows to use the function without having a NMCheckpoint instance at hand. On the other hand, if one has a NMCheckpoint instance, he can trivially obtain the path to make the call.
* examples: improve checkpoint.py for python/giThomas Haller2018-04-041-49/+100
| | | | | | | | - make python2 and python3 compatible - support Checkpoint create flags (requires recent libnm for GI of flags) - support adjust-rollback-timeout command - print elapsed time in show output
* checkpoint: generate GIR information for NMCheckpointCreateFlagsThomas Haller2018-04-041-0/+1
| | | | | | | Note that this changes API for checkpoint_create_async() in Python via GIR. Previously it would require an integer argument, now a flags argument. But this API is still unstable, it will be introduced with 1.12.
* all: replace non-leading tabs with spacesThomas Haller2018-02-071-2/+2
| | | | | | We commonly only allow tabs at the beginning of a line, not afterwards. The reason for this style is so that the code looks formated right with tabstop=4 and tabstop=8.
* examples: add python/gi example nm-connection-update-stable-id.pyThomas Haller2017-12-051-0/+116
| | | | | | The example script touches the stable-id of a connection. It does so blocking autoconnect, and was originally written to test that functionality.
* python: make dbus, gi examples, and debug-helper.py python3 readyYifan J2017-12-048-34/+34
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=791121
* examples: add checkpoint example using python gobject-introspectionBeniamino Galvani2017-11-091-0/+130
|
* examples: add python example using VPN import codeThomas Haller2017-11-061-0/+74
| | | | Show how to load and use the VPN plugins from python.
* examples: add setting-user-data.pyThomas Haller2017-05-061-0/+246
| | | | | | | | Add an example python script to show and set setting's user-data. This is useful, as nmcli still doesn't support user data. (cherry picked from commit 447c766f526ec8bc4f5aa109a5e261cf060d1042)
* examples: add DNS example with python and GObject introspectionBeniamino Galvani2016-12-121-0/+63
|
* examples/python: fix "import gi" in exampleThomas Haller2016-11-161-0/+2
| | | | | | | Otherwise there is a warning: from gi.repository import GLib, NM __main__:1: PyGIWarning: NM was imported without specifying a version first. Use gi.require_version(NM, 1.0) before import to ensure that the right version gets loaded.
* build: merge "examples/Makefile.am" into toplevel Makefileth/non-recursive-make-bgo772985Thomas Haller2016-10-211-11/+0
|
* examples: add README for examples/python/giThomas Haller2015-12-072-1/+4
|
* libnm/libnm-glib: add NMClient.get_all_devices() method and AllDevices propertyDan Williams2015-12-041-0/+41
| | | | | Mirror new NetworkManager API to return both real devices and device placeholders.
* python: use gi.require_version() in generate-setting-docs.py and examplesThomas Haller2015-11-1110-0/+20
| | | | | | | | | | | | | | gi now emits a warning when not loading a specific library version [1]: ./generate-setting-docs.py:21: PyGIWarning: NM was imported without specifying a version first. Use gi.require_version(NM, 1.0) before import to ensure that the right version gets loaded. from gi.repository import NM, GObject Seems require_version() is reasonably old to just always use it without breaking on older versions [2]. [1] Related: https://bugzilla.gnome.org/show_bug.cgi?id=727379 [2] https://git.gnome.org/browse/pygobject/commit/?id=76758efb6579752237a0dc4d56cf9518de6c6e55
* examples: add python GI example for retrieving LLDP neighborsBeniamino Galvani2015-10-121-0/+52
|
* examples: add flags and mode parsing to show-wifi-networks.[lua|py]Jiří Klimeš2015-08-241-0/+64
|
* examples: python: print into stderrPetr Vorel2015-03-104-4/+4
| | | | | | https://mail.gnome.org/archives/networkmanager-list/2015-March/msg00024.html Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
* examples: add a Python example deactivating connections by type (bgo #732826)Jiří Klimeš2015-03-052-1/+83
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=732826
* examples: update python examplesDan Winship2014-11-156-92/+85
| | | | | | | | | | Update the raw D-Bus python examples to use newer APIs where appropriate (and split the add-connection example into 1.0-only and 0.9-compatible versions). Update the gi-based python examples for the various API changes since they were last updated. Also add a comment to the ruby add-connection example pointing out that it's still using the old settings APIs.
* examples: fix python GI examples to work after libnm changesJiří Klimeš2014-09-055-76/+56
|
* libnm: make the the use of GInitable mandatoryDan Winship2014-08-014-4/+4
| | | | | | | | | | | Remove _nm_object_ensure_inited(), etc; objects that implement GInitable are now mandatory-to-init(). Remove constructor() implementations that sometimes return NULL; do all the relevant checking in init() instead. Make nm_client_new() and nm_remote_settings_new() take a GCancellable and a GError**.
* all: port everything to libnmDan Winship2014-08-018-41/+39
| | | | | | | | | | | Since the API has not changed at this point, this is mostly just a matter of updating Makefiles, and changing references to the library name in comments. NetworkManager cannot link to libnm due to the duplicated type/symbol names. So it links to libnm-core.la directly, which means that NetworkManager gets a separate copy of that code from libnm.so. Everything else links to libnm.
* examples: add Python D-Bus and GI examples for updating IPv4 setting methodDan Williams2014-06-102-1/+98
|
* example: simplify get-active-connections.py by using ID and Type propertiesJiří Klimeš2014-03-051-16/+3
|
* examples: add a GOI Python example for getting active connectionsJiří Klimeš2014-03-032-1/+49
|
* examples: a Python GOI example for adding connections persistent vs. not savedJiří Klimeš2014-01-242-1/+103
|
* examples: update get_ips.py python example for DNS informationJiří Klimeš2014-01-231-4/+40
|
* examples: add an python example (using GI) getting device IPsJiří Klimeš2014-01-162-1/+129
|
* docs: update documentation linksWilliam Jon McCann2013-12-171-1/+1
| | | | Various GNOME services moved around so links need updating.
* examples: add an python example (using GI) showing Wi-Fi networksJiří Klimeš2013-09-262-1/+75
|
* examples: use GLib.MainLoop instead of deprecated GObject.MainLoop in pythonJiri Popelka2013-09-243-6/+6
| | | | | jklimes: made the change for new firewall-zone.py example as well.
* examples: group python examples - dbus vs. giJiří Klimeš2013-09-244-0/+205
Move examples using dbus-python ('dbus' module) and GObject introspection into their own directories.