From patchwork Tue Oct 26 14:14:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Schrimpf X-Patchwork-Id: 1546476 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.a=rsa-sha256 header.s=20210112 header.b=eTB/ipOq; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:4864:20::33e; helo=mail-wm1-x33e.google.com; envelope-from=swupdate+bncbaabbr444cfqmgqeoqkkjei@googlegroups.com; receiver=) Received: from mail-wm1-x33e.google.com (mail-wm1-x33e.google.com [IPv6:2a00:1450:4864:20::33e]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4Hdv7v1mmZz9sRR for ; Wed, 27 Oct 2021 01:18:51 +1100 (AEDT) Received: by mail-wm1-x33e.google.com with SMTP id k6-20020a7bc306000000b0030d92a6bdc7sf994292wmj.3 for ; Tue, 26 Oct 2021 07:18:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1635257928; cv=pass; d=google.com; s=arc-20160816; b=OC8USl7maB4qtD7u9NaD0yXAG2+W9kQtofKA5Ma4aMVnj+3HYH/DTuYyOHXndrBrj2 vrbM5VwxUwAEkcb08WxuhF7xZ1Ayx9SvOQ6Sr2YQVkaiNFNqfGOhdc6xAlpMVIDQaNj4 tVIVGxhKzF3e8l0qNPlZcfeNmNnDEdnVkF1nLVTp43PO7lGYfJ6FSnAAtJO/piMMmUKk 8ihHqWCRJMnwyxAIK3d7jjfX5UI8B6PQg5N+eg2rhyYvcvrUlQI3vFI9wmHw91Dqhi2w YsQyjlTTwWljewwacDKsXyN3U68s1dYKKtIrdZq/Wo5YvpM22rbt72lPimW1q7h17ozi /RrA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:dkim-signature; bh=TzHzn40ooAyTEQRPuFm4uznd9n8GFcxIitfaMVEJsP4=; b=gVLgCdLXg6oMC7JKkKygmqf6v0csbIZEVjpW/PoqbaOvzBd5xqVRz3fsL+nhhcrjmo 2qmiLxQjwS/D/Mi+c+AQWarduoKrf2NLHZ/UMkPDcIF2R9Lzw6gl8tz/JYp8cMiQebgk Rf5VfCIwemiKG+n6ZdOIkKMNSDOY3WV1o9S2ah/3HZ2Vdp01lWObxa7A7UPJp9QY84ox hlG7AxiXgUU+bJjr+dkzoiowLaRPMIlL3FY5gFf8maBD1YDrufiLCw7/FmWkf8nHVDnn lI4ltYjZphzvQ4pAJinUusxES98FYBJ/u5GkyuQl8JurzJX+50JAXM12Vv9zCx7E7iP7 zbzw== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=neutral (google.com: 195.1.58.114 is neither permitted nor denied by best guess record for domain of johannes@johanness-macbook-pro-be.local) smtp.mailfrom=johannes@johanness-macbook-pro-be.local DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=TzHzn40ooAyTEQRPuFm4uznd9n8GFcxIitfaMVEJsP4=; b=eTB/ipOq1VR4NvNoz9I3/Zfgm9fOcuBLV831yaKwO72m1hR0ueXkUaB8Z+uc6lHD5I /RMTyeqQ5wLr2kD8l4Gz7ALxvEKuZZW/kW4kZXai8BrK1Ghh06s0aNkltkyV8ugXj1Ca WZ7Ki6QYjCsgYrWSq8C9a/b819ACisDSnv7TkKOxkRHVHLYL9xp7MIpUaDcGy++Hbf/z kSzNYccfUZIA1Hhq3zAJ36UyGQYNgRdXdHI3JPJ5BMs21opZqQQv1f0wZMzBXezVH3Jq cZ8mNR4m9igxny2Z9TiOLRVDzYDAcn1CAs1rMK7HNm+icMf+HmwNnI7vf3dcXQ3yuvjL aMdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=sender:x-gm-message-state:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=TzHzn40ooAyTEQRPuFm4uznd9n8GFcxIitfaMVEJsP4=; b=1B2eFFZlREdBhBC2NBB0ScS+o0wdVBlV2iIegrY280Oqj79K7jLytIsfefdcaejyXi eJ64Pgu8jmGQvPyeWuDAoQ0CNmEDNT4yUYbd/Pwgz0QTswekWOdMm9ahNmICVFLCwEWA k8nXB62wKsleTu3X3b4YclrcAUcCEKfsdvnR9IEuCJ/zqEyUqx9oNQOOKJ3jKG9TffwL 43PSwadu1LfUwr8VB15BgQJ3XC24R5QLm+gkChSgyO2rUEi1730JcE5FHxaXWDnA7Vze PhEZf+OUP2WlxHiggHwsr31QXy7xdvophJXAxo5UGYqE8UfGcJktWfvtGiLChi4U5osY atCw== Sender: swupdate@googlegroups.com X-Gm-Message-State: AOAM531jj791Y+z56fSjasMkowqT+D12CLHHxZKfCFn6r1pr5ajW2HtK epJ/s6E9aha6kv9L7SID40I= X-Google-Smtp-Source: ABdhPJzQ2gMTIoUsULr3t3gCOClusczJ7XH+5JTbBqJ18r8AHTEqOBtpZcyihiE8Z30FWYQOryiRHA== X-Received: by 2002:adf:a402:: with SMTP id d2mr33895442wra.266.1635257927860; Tue, 26 Oct 2021 07:18:47 -0700 (PDT) X-BeenThere: swupdate@googlegroups.com Received: by 2002:adf:8b92:: with SMTP id o18ls6027895wra.0.gmail; Tue, 26 Oct 2021 07:18:47 -0700 (PDT) X-Received: by 2002:adf:e10a:: with SMTP id t10mr32301972wrz.384.1635257927014; Tue, 26 Oct 2021 07:18:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635257927; cv=none; d=google.com; s=arc-20160816; b=RhbOsNfE+pMBlcuVv45i1kd4UrQXfIg0DT+dTlDFQOQMPZRA37KFNOL46NGFctlH/K LJMI8+fywjxRuYviV+dgbEz1GOH3qS0UwNnJX+QUO0jVqElfquM1wvOzBUk2CTf0CvtX GQdmYwzef40zsIh0g+DJZ37hB8zxqVLyZkRTnVroELthVhiRND0EJe5BkZweH1UI/uDV 9AtOXFGsnyrNyAUU72bKUziRJRvwEloRsN98NVn3laBCDpJvcUa02qWYjdhCyPTpl6hF D5SUfEu8WgwGu7o3t3IXrs70YBkzr5G1fNor9e9I4lDJkjaQg8Xi1gOvMjWpUbVI+HH+ 5j5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=EfjSFHfr68AJqKl0bZPTJJWOkXbQRrgZ0ajD6fvcRF0=; b=PffrSP44ZnPBvwwrAxoZBYMv2N6fZ3tciXt9Q5tKyDCxHGVfftm5cRVyuFMbkIRAFH tlLLbYHk8tkF305lOLSL7/4yev+BVlNLbhgrtOlzXH2WnodY/hMHiRN5Un6mtZDrX42X N6ogaeE/c7+WydoFRzsRnfrggcx22v+ZHf0bJ4kS21uxor6oV1VOhXrNqfI+DJDvX4LU pGVCgNCRJ90LMPjZxELd8Jn/TTASlJZn1/Z3QUtYZ65k5QEzJNvDqYAgam9CeupYRBoJ OEk9N08pUFdIaneLCbVu3rz0jTtJj9I3CWem/HVmtlRef6Gmp/FThX2m6tGPtalrnGJz +9Hg== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=neutral (google.com: 195.1.58.114 is neither permitted nor denied by best guess record for domain of johannes@johanness-macbook-pro-be.local) smtp.mailfrom=johannes@johanness-macbook-pro-be.local Received: from Johanness-MacBook-Pro-BE.local ([195.1.58.114]) by gmr-mx.google.com with ESMTP id h3si170317wml.1.2021.10.26.07.18.46 for ; Tue, 26 Oct 2021 07:18:46 -0700 (PDT) Received-SPF: neutral (google.com: 195.1.58.114 is neither permitted nor denied by best guess record for domain of johannes@johanness-macbook-pro-be.local) client-ip=195.1.58.114; Received: by Johanness-MacBook-Pro-BE.local (Postfix, from userid 501) id 7D91A304F65359; Tue, 26 Oct 2021 16:18:46 +0200 (CEST) From: Johannes Schrimpf To: swupdate@googlegroups.com Cc: Johannes Schrimpf Subject: [swupdate] [PATCH 3/3] Add Pipfile and README.md Date: Tue, 26 Oct 2021 16:14:45 +0200 Message-Id: <20211026141445.85452-3-johannes.schrimpf@blueye.no> X-Mailer: git-send-email 2.30.1 (Apple Git-130) In-Reply-To: <20211026141445.85452-1-johannes.schrimpf@blueye.no> References: <20211026141445.85452-1-johannes.schrimpf@blueye.no> MIME-Version: 1.0 X-Original-Sender: johannes.schrimpf@blueye.no X-Original-Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 195.1.58.114 is neither permitted nor denied by best guess record for domain of johannes@johanness-macbook-pro-be.local) smtp.mailfrom=johannes@johanness-macbook-pro-be.local Precedence: list Mailing-list: list swupdate@googlegroups.com; contact swupdate+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: swupdate@googlegroups.com X-Google-Group-Id: 605343134186 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Signed-off-by: Johannes Schrimpf Signed-off-by: Johannes Schrimpf > --- examples/client/Pipfile | 13 +++++++++++ examples/client/README.md | 47 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 examples/client/Pipfile create mode 100644 examples/client/README.md diff --git a/examples/client/Pipfile b/examples/client/Pipfile new file mode 100644 index 0000000..a237601 --- /dev/null +++ b/examples/client/Pipfile @@ -0,0 +1,13 @@ +[[source]] +url = "https://pypi.org/simple" +verify_ssl = true +name = "pypi" + +[packages] +websockets = "*" +requests = "*" + +[dev-packages] + +[requires] +python_version = "3.9" diff --git a/examples/client/README.md b/examples/client/README.md new file mode 100644 index 0000000..b6e5d32 --- /dev/null +++ b/examples/client/README.md @@ -0,0 +1,47 @@ +## Install dependencies + +### apt +``` +sudo apt update +sudo apt install python3-websockets python3-requests +``` + +### pip +``` +pip install websockets requests +``` + +### pipenv +``` +pipenv install +``` + +## Usage + +### apt/pip +``` +./swupdate_client.py [port] +``` + +### pipenv +``` +pipenv run ./swupdate_client.py [port] +``` + + +## Development +### Import from another python program +``` +from swupdate_client import SWUpdater + +updater = SWUpdater("path-to-swu", "host-name") +if updater.update(): + print("Update successful!") +else: + print("Update failed!") +``` + +### Formatting +``` +black swupdate_client.py +``` \ No newline at end of file