- Pulls a bunch of ideals from varlink
- Encoded as two msgpack streams, one in each direction
- The stream is broken up into channels, where there is a single call and potentially many responses.
- Method names are forward-dotted paths (eg com.foobar.service.Method)
- Parameters and returns are both maps; at the application level, methods only take keyword arguments and return named return values
- Methods may return 0 or more returns or errors
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env buildahscript | |
#| pip: requests | |
#| arg: eula: bool | |
#| arg: version: str = "latest" | |
#| arg: type: str = "vanilla" | |
with TemporaryDirectory() as td: | |
bin = td / 'bin' | |
bin.mkdir() | |
with workspace('rust:buster') as build: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import contextlib | |
import json | |
import os.path | |
import subprocess | |
import tempfile | |
import time | |
from varlink import Client | |
IMG = "quay.io/libpod/alpine_nginx:latest" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
import enum | |
import dataclasses | |
import struct | |
import asyncio | |
import weakref | |
class InvalidPacket(Exception): | |
""" |
The basic idea: Define GraphQL queries as importable modules.
For example:
# queries.gql
#!starwars
query HeroForEpisode($ep: Episode!) {
hero(episode: $ep) {
- Copy
cybre.desktop
to~/.local/share/applications
- Download https://cybre.space/packs/media/images/logo-cybre-e5f7d490f241e9de9484e194fbc0d3fb.png to
/usr/local/share/pixmaps/cybre.png
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ACTION=="add", ENV{ID_SERIAL}=="*?", RUN+="/home/astraluma/udev-handler" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import collections.abc | |
import pathlib | |
__all__ = ('root',) | |
class AttrsView(collections.abc.KeysView): | |
def __init__(self, root): | |
self._root = pathlib.Path(root) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import functools | |
from gi.repository import GObject | |
from gi.repository import Gio | |
from gi.repository import GLib | |
def runloop(func): | |
@functools.wraps(func) | |
def wrapped(*pargs, **kwargs): | |
func(None) |
Proof of Concept of using Python+Async to connect to a server over SSH.
Requires:
- Python >= 3.6
msgpack
tornado<5
Run client.py
, assumes you're running ssh-server on localhost and that you can log in to it.