From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.92.2 #3 (Red Hat Linux)) id 1iA8Yk-0003Sh-OH for barebox@lists.infradead.org; Tue, 17 Sep 2019 08:10:04 +0000 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Tue, 17 Sep 2019 10:09:56 +0200 Message-Id: <20190917080956.16100-2-u.kleine-koenig@pengutronix.de> In-Reply-To: <20190917080126.2sp36vixvfvlmvtk@pengutronix.de> References: <20190917080126.2sp36vixvfvlmvtk@pengutronix.de> MIME-Version: 1.0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH 2/2] Documentation: make gen_commands helper python3 compatible To: barebox@lists.infradead.org Cc: Stefan Lengfeld T24gc29tZSBtYWNoaW5lcyB0aGUgcHl0aG9uIGNvbW1hbmQgaXMgcHJvdmlkZWQgYnkgUHl0aG9u IDMgd2hpbGUgb24KbW9zdCAoYXQgbGVhc3QgaW4gbXkgYnViYmxlKSBpdCBpcyBzdGlsbCBQeXRo b24gMi4gTW9kaWZ5IHRoZSBjb2RlIHRvCm1ha2UgaXQgdXNhYmxlIGJ5IGJvdGggUHl0aG9uIHZl cnNpb25zLgoKcHJpbnRfZnVuY3Rpb24gaXMgYXZhaWxhYmxlIGluIF9fZnV0dXJlX18gc2luY2Ug UHl0aG9uIDIuNi4wYTIsIHdoaWNoCnNob3VsZG4ndCBiZSBhIHJlbGV2YW50IHJlc3RyaWN0aW9u LgoKVGhlIG1vZGlmaWVkIHNjcmlwdCBnZW5lcmF0ZXMgdGhlIHNhbWUgZG9jdW1lbnRhdGlvbiBh cyB0aGUgb2xkIG9uZTsKaW5kZXBlbmRlbnQgaW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LCBzbyBkbyB0aGlzIGhlcmUuCisgIHJldHVybiBz LnJlcGxhY2UocidcdCcsICcnKQorCiBkZWYgcGFyc2VfYyhuYW1lKToKICAgY21kID0gTm9uZQog ICBsYXN0ID0gTm9uZQotICBmb3IgbGluZSBpbiBmaWxlKG5hbWUsICdyJyk6CisgIGZvciBsaW5l IGluIG9wZW4obmFtZSwgJ3InKToKICAgICB4ID0gSEVMUF9TVEFSVC5tYXRjaChsaW5lKQogICAg IGlmIHg6CiAgICAgICBjbWQgPSBDTURTLnNldGRlZmF1bHQoeC5ncm91cCgxKSwgZGVmYXVsdGRp Y3QobGlzdCkpCkBAIC01MCwxNCArNTcsMTQgQEAgZGVmIHBhcnNlX2MobmFtZSk6CiAgICAgICAg IGxhc3QgPSBjbWRbJ2hfcHJlJ10KICAgICAgIGVsc2U6CiAgICAgICAgIGxhc3QgPSBjbWRbJ2hf cG9zdCddCi0gICAgICBsYXN0LmFwcGVuZCh4Lmdyb3VwKDEpLmRlY29kZSgic3RyaW5nX2VzY2Fw ZSIpLnN0cmlwKCkpCisgICAgICBsYXN0LmFwcGVuZChzdHJpbmdfZXNjYXBlKHguZ3JvdXAoMSkp LnN0cmlwKCkpCiAgICAgICBjb250aW51ZQogICAgIHggPSBIRUxQX09QVC5tYXRjaChsaW5lKQog ICAgIGlmIHg6CiAgICAgICBsYXN0ID0gY21kWydoX29wdHMnXQogICAgICAgbGFzdC5hcHBlbmQo WwotICAgICAgICB4Lmdyb3VwKDEpLmRlY29kZSgic3RyaW5nX2VzY2FwZSIpLAotICAgICAgICB4 Lmdyb3VwKDIpLmRlY29kZSgic3RyaW5nX2VzY2FwZSIpCisgICAgICAgIHN0cmluZ19lc2NhcGUo eC5ncm91cCgxKSksCisgICAgICAgIHN0cmluZ19lc2NhcGUoeC5ncm91cCgyKSksCiAgICAgICBd KQogICAgICAgY29udGludWUKICAgICB4ID0gQ01EX0ZVTkMubWF0Y2gobGluZSkKQEAgLTY4LDEy ICs3NSwxMiBAQCB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19fX19fX19fX19fX19fX19fX19fX19fXwpiYXJlYm94IG1haWxpbmcgbGlz dApiYXJlYm94QGxpc3RzLmluZnJhZGVhZC5vcmcKaHR0cDovL2xpc3RzLmluZnJhZGVhZC5vcmcv bWFpbG1hbi9saXN0aW5mby9iYXJlYm94Cg==