diff --git a/.flake8 b/.flake8 new file mode 100644 index 000000000..ef4fa65a3 --- /dev/null +++ b/.flake8 @@ -0,0 +1,8 @@ +[flake8] +extend-ignore = + X100, E262, + # See https://github.com/PyCQA/pycodestyle/issues/373 + E203, + # black +max-line-length = 88 +# black diff --git a/Pipfile b/Pipfile index 6003e85fb..baee05d08 100644 --- a/Pipfile +++ b/Pipfile @@ -6,17 +6,16 @@ name = "pypi" [packages] [dev-packages] -"flake8" = ">=3.9.0" -"flake8-commas" = "*" -"flake8-comprehensions" = "*" -"flake8-isort" = "*" -"python-magic" = "*" +black = "*" +isort = "*" +flake8 = "*" +flake8-black = "*" +flake8-isort = "*" adafruit-ampy = "*" ipdb = "*" ipython = "*" -isort = "*" neovim = "*" s3cmd = "*" -black = "==21.6b0" -flake8-quotes = "*" -flake8-black = "*" + +[requires] +python = "3.9" \ No newline at end of file diff --git a/Pipfile.lock b/Pipfile.lock index 019daa574..4ae84da24 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,10 +1,12 @@ { "_meta": { "hash": { - "sha256": "0a04ec24d4aef6828e4f5eefa0a7d2c312f21f2b2f18c42c7004cdbe0c02bd53" + "sha256": "752889363476f8e08002c8f4e4c0162ecb24870deeb893c8fb1f1c9b8dec48e4" }, "pipfile-spec": 6, - "requires": {}, + "requires": { + "python": "3.9" + }, "sources": [ { "name": "pypi", @@ -23,12 +25,12 @@ "index": "pypi", "version": "==1.1.0" }, - "appdirs": { + "asttokens": { "hashes": [ - "sha256:7d5d0167b2b1ba821647616af46a749d1c653740dd0d2415100fe26e27afdf41", - "sha256:a841dacd6b99318a741b166adb07e19ee71a274450e68237b4650ca1055ab128" + "sha256:c61e16246ecfb2cde2958406b4c8ebc043c9e6d73aaa83c941673b35e5d3a76b", + "sha256:e3305297c744ae53ffa032c45dc347286165e4ffce6875dc662b205db0623d86" ], - "version": "==1.4.4" + "version": "==2.0.8" }, "backcall": { "hashes": [ @@ -39,19 +41,40 @@ }, "black": { "hashes": [ - "sha256:dc132348a88d103016726fe360cb9ede02cecf99b76e3660ce6c596be132ce04", - "sha256:dfb8c5a069012b2ab1e972e7b908f5fb42b6bbabcba0a788b86dc05067c7d9c7" + "sha256:0a12e4e1353819af41df998b02c6742643cfef58282915f781d0e4dd7a200411", + "sha256:0ad827325a3a634bae88ae7747db1a395d5ee02cf05d9aa7a9bd77dfb10e940c", + "sha256:32a4b17f644fc288c6ee2bafdf5e3b045f4eff84693ac069d87b1a347d861497", + "sha256:3b2c25f8dea5e8444bdc6788a2f543e1fb01494e144480bc17f806178378005e", + "sha256:4a098a69a02596e1f2a58a2a1c8d5a05d5a74461af552b371e82f9fa4ada8342", + "sha256:5107ea36b2b61917956d018bd25129baf9ad1125e39324a9b18248d362156a27", + "sha256:53198e28a1fb865e9fe97f88220da2e44df6da82b18833b588b1883b16bb5d41", + "sha256:5594efbdc35426e35a7defa1ea1a1cb97c7dbd34c0e49af7fb593a36bd45edab", + "sha256:5b879eb439094751185d1cfdca43023bc6786bd3c60372462b6f051efa6281a5", + "sha256:78dd85caaab7c3153054756b9fe8c611efa63d9e7aecfa33e533060cb14b6d16", + "sha256:792f7eb540ba9a17e8656538701d3eb1afcb134e3b45b71f20b25c77a8db7e6e", + "sha256:8ce13ffed7e66dda0da3e0b2eb1bdfc83f5812f66e09aca2b0978593ed636b6c", + "sha256:a05da0430bd5ced89176db098567973be52ce175a55677436a271102d7eaa3fe", + "sha256:a983526af1bea1e4cf6768e649990f28ee4f4137266921c2c3cee8116ae42ec3", + "sha256:bc4d4123830a2d190e9cc42a2e43570f82ace35c3aeb26a512a2102bce5af7ec", + "sha256:c3a73f66b6d5ba7288cd5d6dad9b4c9b43f4e8a4b789a94bf5abfb878c663eb3", + "sha256:ce957f1d6b78a8a231b18e0dd2d94a33d2ba738cd88a7fe64f53f659eea49fdd", + "sha256:cea1b2542d4e2c02c332e83150e41e3ca80dc0fb8de20df3c5e98e242156222c", + "sha256:d2c21d439b2baf7aa80d6dd4e3659259be64c6f49dfd0f32091063db0e006db4", + "sha256:d839150f61d09e7217f52917259831fe2b689f5c8e5e32611736351b89bb2a90", + "sha256:dd82842bb272297503cbec1a2600b6bfb338dae017186f8f215c8958f8acf869", + "sha256:e8166b7bfe5dcb56d325385bd1d1e0f635f24aae14b3ae437102dedc0c186747", + "sha256:e981e20ec152dfb3e77418fb616077937378b322d7b26aa1ff87717fb18b4875" ], "index": "pypi", - "version": "==21.6b0" + "version": "==22.8.0" }, "click": { "hashes": [ - "sha256:353f466495adaeb40b6b5f592f9f91cb22372351c84caeb068132442a4518ef3", - "sha256:410e932b050f5eed773c4cda94de75971c89cdb3155a72a0831139a79e5ecb5b" + "sha256:7682dc8afb30297001674575ea00d1814d808d6a36af415a82bd481d37ba7b8e", + "sha256:bb4d8133cb15a609f44e8213d9b391b0809795062913b383c62be0ee95b1db48" ], - "markers": "python_version >= '3.6'", - "version": "==8.0.3" + "markers": "python_version >= '3.7'", + "version": "==8.1.3" }, "decorator": { "hashes": [ @@ -61,113 +84,96 @@ "markers": "python_version >= '3.5'", "version": "==5.1.1" }, - "flake8": { + "executing": { "hashes": [ - "sha256:07528381786f2a6237b061f6e96610a4167b226cb926e2aa2b6b1d78057c576b", - "sha256:bf8fd333346d844f616e8d47905ef3a3384edae6b4e9beb0c5101e25e3110907" + "sha256:550d581b497228b572235e633599133eeee67073c65914ca346100ad56775349", + "sha256:98daefa9d1916a4f0d944880d5aeaf079e05585689bebd9ff9b32e31dd5e1017" ], - "index": "pypi", - "version": "==3.9.2" + "version": "==1.0.0" }, - "flake8-black": { - "hashes": [ - "sha256:941514149cb8b489cb17a4bb1cf18d84375db3b34381bb018de83509437931a0", - "sha256:f26651bc10db786c03f4093414f7c9ea982ed8a244cec323c984feeffdf4c118" - ], - "index": "pypi", - "version": "==0.2.1" - }, - "flake8-commas": { + "flake8": { "hashes": [ - "sha256:d3005899466f51380387df7151fb59afec666a0f4f4a2c6a8995b975de0f44b7", - "sha256:ee2141a3495ef9789a3894ed8802d03eff1eaaf98ce6d8653a7c573ef101935e" + "sha256:6fbe320aad8d6b95cec8b8e47bc933004678dc63095be98528b7bdd2a9f510db", + "sha256:7a1cf6b73744f5806ab95e526f6f0d8c01c66d7bbe349562d22dfca20610b248" ], "index": "pypi", - "version": "==2.0.0" + "version": "==5.0.4" }, - "flake8-comprehensions": { + "flake8-black": { "hashes": [ - "sha256:b07aef3277623db32310aa241a1cec67212b53c1d18e767d7e26d4d83aa05bf7", - "sha256:f24be9032587127f7a5bc6d066bf755b6e66834f694383adb8a673e229c1f559" + "sha256:7d667d0059fd1aa468de1669d77cc934b7f1feeac258d57bdae69a8e73c4cd90", + "sha256:8211f5e20e954cb57c709acccf2f3281ce27016d4c4b989c3e51f878bb7ce12a" ], "index": "pypi", - "version": "==3.5.0" + "version": "==0.3.3" }, "flake8-isort": { "hashes": [ - "sha256:2b91300f4f1926b396c2c90185844eb1a3d5ec39ea6138832d119da0a208f4d9", - "sha256:729cd6ef9ba3659512dee337687c05d79c78e1215fdf921ed67e5fe46cce2f3c" - ], - "index": "pypi", - "version": "==4.0.0" - }, - "flake8-quotes": { - "hashes": [ - "sha256:3f1116e985ef437c130431ac92f9b3155f8f652fda7405ac22ffdfd7a9d1055e" + "sha256:26571500cd54976bbc0cf1006ffbcd1a68dd102f816b7a1051b219616ba9fee0", + "sha256:5b87630fb3719bf4c1833fd11e0d9534f43efdeba524863e15d8f14a7ef6adbf" ], "index": "pypi", - "version": "==3.2.0" + "version": "==4.2.0" }, "greenlet": { "hashes": [ - "sha256:0051c6f1f27cb756ffc0ffbac7d2cd48cb0362ac1736871399a739b2885134d3", - "sha256:00e44c8afdbe5467e4f7b5851be223be68adb4272f44696ee71fe46b7036a711", - "sha256:013d61294b6cd8fe3242932c1c5e36e5d1db2c8afb58606c5a67efce62c1f5fd", - "sha256:049fe7579230e44daef03a259faa24511d10ebfa44f69411d99e6a184fe68073", - "sha256:14d4f3cd4e8b524ae9b8aa567858beed70c392fdec26dbdb0a8a418392e71708", - "sha256:166eac03e48784a6a6e0e5f041cfebb1ab400b394db188c48b3a84737f505b67", - "sha256:17ff94e7a83aa8671a25bf5b59326ec26da379ace2ebc4411d690d80a7fbcf23", - "sha256:1e12bdc622676ce47ae9abbf455c189e442afdde8818d9da983085df6312e7a1", - "sha256:21915eb821a6b3d9d8eefdaf57d6c345b970ad722f856cd71739493ce003ad08", - "sha256:288c6a76705dc54fba69fbcb59904ae4ad768b4c768839b8ca5fdadec6dd8cfd", - "sha256:2bde6792f313f4e918caabc46532aa64aa27a0db05d75b20edfc5c6f46479de2", - "sha256:32ca72bbc673adbcfecb935bb3fb1b74e663d10a4b241aaa2f5a75fe1d1f90aa", - "sha256:356b3576ad078c89a6107caa9c50cc14e98e3a6c4874a37c3e0273e4baf33de8", - "sha256:40b951f601af999a8bf2ce8c71e8aaa4e8c6f78ff8afae7b808aae2dc50d4c40", - "sha256:572e1787d1460da79590bf44304abbc0a2da944ea64ec549188fa84d89bba7ab", - "sha256:58df5c2a0e293bf665a51f8a100d3e9956febfbf1d9aaf8c0677cf70218910c6", - "sha256:64e6175c2e53195278d7388c454e0b30997573f3f4bd63697f88d855f7a6a1fc", - "sha256:7227b47e73dedaa513cdebb98469705ef0d66eb5a1250144468e9c3097d6b59b", - "sha256:7418b6bfc7fe3331541b84bb2141c9baf1ec7132a7ecd9f375912eca810e714e", - "sha256:7cbd7574ce8e138bda9df4efc6bf2ab8572c9aff640d8ecfece1b006b68da963", - "sha256:7ff61ff178250f9bb3cd89752df0f1dd0e27316a8bd1465351652b1b4a4cdfd3", - "sha256:833e1551925ed51e6b44c800e71e77dacd7e49181fdc9ac9a0bf3714d515785d", - "sha256:8639cadfda96737427330a094476d4c7a56ac03de7265622fcf4cfe57c8ae18d", - "sha256:8c5d5b35f789a030ebb95bff352f1d27a93d81069f2adb3182d99882e095cefe", - "sha256:8c790abda465726cfb8bb08bd4ca9a5d0a7bd77c7ac1ca1b839ad823b948ea28", - "sha256:8d2f1fb53a421b410751887eb4ff21386d119ef9cde3797bf5e7ed49fb51a3b3", - "sha256:903bbd302a2378f984aef528f76d4c9b1748f318fe1294961c072bdc7f2ffa3e", - "sha256:93f81b134a165cc17123626ab8da2e30c0455441d4ab5576eed73a64c025b25c", - "sha256:95e69877983ea39b7303570fa6760f81a3eec23d0e3ab2021b7144b94d06202d", - "sha256:9633b3034d3d901f0a46b7939f8c4d64427dfba6bbc5a36b1a67364cf148a1b0", - "sha256:97e5306482182170ade15c4b0d8386ded995a07d7cc2ca8f27958d34d6736497", - "sha256:9f3cba480d3deb69f6ee2c1825060177a22c7826431458c697df88e6aeb3caee", - "sha256:aa5b467f15e78b82257319aebc78dd2915e4c1436c3c0d1ad6f53e47ba6e2713", - "sha256:abb7a75ed8b968f3061327c433a0fbd17b729947b400747c334a9c29a9af6c58", - "sha256:aec52725173bd3a7b56fe91bc56eccb26fbdff1386ef123abb63c84c5b43b63a", - "sha256:b11548073a2213d950c3f671aa88e6f83cda6e2fb97a8b6317b1b5b33d850e06", - "sha256:b1692f7d6bc45e3200844be0dba153612103db241691088626a33ff1f24a0d88", - "sha256:b336501a05e13b616ef81ce329c0e09ac5ed8c732d9ba7e3e983fcc1a9e86965", - "sha256:b8c008de9d0daba7b6666aa5bbfdc23dcd78cafc33997c9b7741ff6353bafb7f", - "sha256:b92e29e58bef6d9cfd340c72b04d74c4b4e9f70c9fa7c78b674d1fec18896dc4", - "sha256:be5f425ff1f5f4b3c1e33ad64ab994eed12fc284a6ea71c5243fd564502ecbe5", - "sha256:dd0b1e9e891f69e7675ba5c92e28b90eaa045f6ab134ffe70b52e948aa175b3c", - "sha256:e30f5ea4ae2346e62cedde8794a56858a67b878dd79f7df76a0767e356b1744a", - "sha256:e6a36bb9474218c7a5b27ae476035497a6990e21d04c279884eb10d9b290f1b1", - "sha256:e859fcb4cbe93504ea18008d1df98dee4f7766db66c435e4882ab35cf70cac43", - "sha256:eb6ea6da4c787111adf40f697b4e58732ee0942b5d3bd8f435277643329ba627", - "sha256:ec8c433b3ab0419100bd45b47c9c8551248a5aee30ca5e9d399a0b57ac04651b", - "sha256:eff9d20417ff9dcb0d25e2defc2574d10b491bf2e693b4e491914738b7908168", - "sha256:f0214eb2a23b85528310dad848ad2ac58e735612929c8072f6093f3585fd342d", - "sha256:f276df9830dba7a333544bd41070e8175762a7ac20350786b322b714b0e654f5", - "sha256:f3acda1924472472ddd60c29e5b9db0cec629fbe3c5c5accb74d6d6d14773478", - "sha256:f70a9e237bb792c7cc7e44c531fd48f5897961701cdaa06cf22fc14965c496cf", - "sha256:f9d29ca8a77117315101425ec7ec2a47a22ccf59f5593378fc4077ac5b754fce", - "sha256:fa877ca7f6b48054f847b61d6fa7bed5cebb663ebc55e018fda12db09dcc664c", - "sha256:fdcec0b8399108577ec290f55551d926d9a1fa6cad45882093a7a07ac5ec147b" + "sha256:0118817c9341ef2b0f75f5af79ac377e4da6ff637e5ee4ac91802c0e379dadb4", + "sha256:048d2bed76c2aa6de7af500ae0ea51dd2267aec0e0f2a436981159053d0bc7cc", + "sha256:07c58e169bbe1e87b8bbf15a5c1b779a7616df9fd3e61cadc9d691740015b4f8", + "sha256:095a980288fe05adf3d002fbb180c99bdcf0f930e220aa66fcd56e7914a38202", + "sha256:0b181e9aa6cb2f5ec0cacc8cee6e5a3093416c841ba32c185c30c160487f0380", + "sha256:1626185d938d7381631e48e6f7713e8d4b964be246073e1a1d15c2f061ac9f08", + "sha256:184416e481295832350a4bf731ba619a92f5689bf5d0fa4341e98b98b1265bd7", + "sha256:1dd51d2650e70c6c4af37f454737bf4a11e568945b27f74b471e8e2a9fd21268", + "sha256:1ec2779774d8e42ed0440cf8bc55540175187e8e934f2be25199bf4ed948cd9e", + "sha256:2cf45e339cabea16c07586306a31cfcc5a3b5e1626d365714d283732afed6809", + "sha256:2fb0aa7f6996879551fd67461d5d3ab0c3c0245da98be90c89fcb7a18d437403", + "sha256:44b4817c34c9272c65550b788913620f1fdc80362b209bc9d7dd2f40d8793080", + "sha256:466ce0928e33421ee84ae04c4ac6f253a3a3e6b8d600a79bd43fd4403e0a7a76", + "sha256:4f166b4aca8d7d489e82d74627a7069ab34211ef5ebb57c300ec4b9337b60fc0", + "sha256:510c3b15587afce9800198b4b142202b323bf4b4b5f9d6c79cb9a35e5e3c30d2", + "sha256:5b756e6730ea59b2745072e28ad27f4c837084688e6a6b3633c8b1e509e6ae0e", + "sha256:5fbe1ab72b998ca77ceabbae63a9b2e2dc2d963f4299b9b278252ddba142d3f1", + "sha256:6200a11f003ec26815f7e3d2ded01b43a3810be3528dd760d2f1fa777490c3cd", + "sha256:65ad1a7a463a2a6f863661329a944a5802c7129f7ad33583dcc11069c17e622c", + "sha256:694ffa7144fa5cc526c8f4512665003a39fa09ef00d19bbca5c8d3406db72fbe", + "sha256:6f5d4b2280ceea76c55c893827961ed0a6eadd5a584a7c4e6e6dd7bc10dfdd96", + "sha256:7532a46505470be30cbf1dbadb20379fb481244f1ca54207d7df3bf0bbab6a20", + "sha256:76a53bfa10b367ee734b95988bd82a9a5f0038a25030f9f23bbbc005010ca600", + "sha256:77e41db75f9958f2083e03e9dd39da12247b3430c92267df3af77c83d8ff9eed", + "sha256:7a43bbfa9b6cfdfaeefbd91038dde65ea2c421dc387ed171613df340650874f2", + "sha256:7b41d19c0cfe5c259fe6c539fd75051cd39a5d33d05482f885faf43f7f5e7d26", + "sha256:7c5227963409551ae4a6938beb70d56bf1918c554a287d3da6853526212fbe0a", + "sha256:870a48007872d12e95a996fca3c03a64290d3ea2e61076aa35d3b253cf34cd32", + "sha256:88b04e12c9b041a1e0bcb886fec709c488192638a9a7a3677513ac6ba81d8e79", + "sha256:8c287ae7ac921dfde88b1c125bd9590b7ec3c900c2d3db5197f1286e144e712b", + "sha256:903fa5716b8fbb21019268b44f73f3748c41d1a30d71b4a49c84b642c2fed5fa", + "sha256:9537e4baf0db67f382eb29255a03154fcd4984638303ff9baaa738b10371fa57", + "sha256:9951dcbd37850da32b2cb6e391f621c1ee456191c6ae5528af4a34afe357c30e", + "sha256:9b2f7d0408ddeb8ea1fd43d3db79a8cefaccadd2a812f021333b338ed6b10aba", + "sha256:9c88e134d51d5e82315a7c32b914a58751b7353eb5268dbd02eabf020b4c4700", + "sha256:9fae214f6c43cd47f7bef98c56919b9222481e833be2915f6857a1e9e8a15318", + "sha256:a3a669f11289a8995d24fbfc0e63f8289dd03c9aaa0cc8f1eab31d18ca61a382", + "sha256:aa741c1a8a8cc25eb3a3a01a62bdb5095a773d8c6a86470bde7f607a447e7905", + "sha256:b0877a9a2129a2c56a2eae2da016743db7d9d6a05d5e1c198f1b7808c602a30e", + "sha256:bcb6c6dd1d6be6d38d6db283747d07fda089ff8c559a835236560a4410340455", + "sha256:caff52cb5cd7626872d9696aee5b794abe172804beb7db52eed1fd5824b63910", + "sha256:cbc1eb55342cbac8f7ec159088d54e2cfdd5ddf61c87b8bbe682d113789331b2", + "sha256:cd16a89efe3a003029c87ff19e9fba635864e064da646bc749fc1908a4af18f3", + "sha256:ce5b64dfe8d0cca407d88b0ee619d80d4215a2612c1af8c98a92180e7109f4b5", + "sha256:d58a5a71c4c37354f9e0c24c9c8321f0185f6945ef027460b809f4bb474bfe41", + "sha256:db41f3845eb579b544c962864cce2c2a0257fe30f0f1e18e51b1e8cbb4e0ac6d", + "sha256:db5b25265010a1b3dca6a174a443a0ed4c4ab12d5e2883a11c97d6e6d59b12f9", + "sha256:dd0404d154084a371e6d2bafc787201612a1359c2dee688ae334f9118aa0bf47", + "sha256:de431765bd5fe62119e0bc6bc6e7b17ac53017ae1782acf88fcf6b7eae475a49", + "sha256:df02fdec0c533301497acb0bc0f27f479a3a63dcdc3a099ae33a902857f07477", + "sha256:e8533f5111704d75de3139bf0b8136d3a6c1642c55c067866fa0a51c2155ee33", + "sha256:f2f908239b7098799b8845e5936c2ccb91d8c2323be02e82f8dcb4a80dcf4a25", + "sha256:f8bfd36f368efe0ab2a6aa3db7f14598aac454b06849fb633b762ddbede1db90", + "sha256:ffe73f9e7aea404722058405ff24041e59d31ca23d1da0895af48050a07b6932" ], "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'", - "version": "==1.1.2" + "version": "==1.1.3" }, "ipdb": { "hashes": [ @@ -178,19 +184,19 @@ }, "ipython": { "hashes": [ - "sha256:55df3e0bd0f94e715abd968bedd89d4e8a7bce4bf498fb123fed4f5398fea874", - "sha256:b5548ec5329a4bcf054a5deed5099b0f9622eb9ea51aaa7104d215fece201d8c" + "sha256:097bdf5cd87576fd066179c9f7f208004f7a6864ee1b20f37d346c0bcb099f84", + "sha256:6f090e29ab8ef8643e521763a4f1f39dc3914db643122b1e9d3328ff2e43ada2" ], "index": "pypi", - "version": "==7.31.1" + "version": "==8.5.0" }, "isort": { "hashes": [ - "sha256:0a943902919f65c5684ac4e0154b1ad4fac6dcaa5d9f3426b732f1c8b5419be6", - "sha256:2bb1680aad211e3c9944dbce1d4ba09a989f04e238296c87fe2139faa26d655d" + "sha256:6f62d78e2f89b4500b080fe3a81690850cd254227f27f75c3a0c491a1f351ba7", + "sha256:e8443a5e7a020e9d7f97f1d7d9cd17c88bcb3bc7e218bf9cf5095fe550be2951" ], "index": "pypi", - "version": "==5.8.0" + "version": "==5.10.1" }, "jedi": { "hashes": [ @@ -202,57 +208,76 @@ }, "matplotlib-inline": { "hashes": [ - "sha256:a04bfba22e0d1395479f866853ec1ee28eea1485c1d69a6faf00dc3e24ff34ee", - "sha256:aed605ba3b72462d64d475a21a9296f400a19c4f74a31b59103d2a99ffd5aa5c" + "sha256:f1f41aab5328aa5aaea9b16d083b128102f8712542f819fe7e6a420ff581b311", + "sha256:f887e5f10ba98e8d2b150ddcf4702c1e5f8b3a20005eb0f74bfdbd360ee6f304" ], "markers": "python_version >= '3.5'", - "version": "==0.1.3" + "version": "==0.1.6" }, "mccabe": { "hashes": [ - "sha256:ab8a6258860da4b6677da4bd2fe5dc2c659cff31b3ee4f7f5d64e79735b80d42", - "sha256:dd8d182285a0fe56bace7f45b5e7d1a6ebcbf524e8f3bd87eb0f125271b8831f" + "sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325", + "sha256:6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e" ], - "version": "==0.6.1" + "markers": "python_version >= '3.6'", + "version": "==0.7.0" }, "msgpack": { "hashes": [ - "sha256:0d8c332f53ffff01953ad25131272506500b14750c1d0ce8614b17d098252fbc", - "sha256:1c58cdec1cb5fcea8c2f1771d7b5fec79307d056874f746690bd2bdd609ab147", - "sha256:2c3ca57c96c8e69c1a0d2926a6acf2d9a522b41dc4253a8945c4c6cd4981a4e3", - "sha256:2f30dd0dc4dfe6231ad253b6f9f7128ac3202ae49edd3f10d311adc358772dba", - "sha256:2f97c0f35b3b096a330bb4a1a9247d0bd7e1f3a2eba7ab69795501504b1c2c39", - "sha256:36a64a10b16c2ab31dcd5f32d9787ed41fe68ab23dd66957ca2826c7f10d0b85", - "sha256:3d875631ecab42f65f9dce6f55ce6d736696ced240f2634633188de2f5f21af9", - "sha256:40fb89b4625d12d6027a19f4df18a4de5c64f6f3314325049f219683e07e678a", - "sha256:47d733a15ade190540c703de209ffbc42a3367600421b62ac0c09fde594da6ec", - "sha256:494471d65b25a8751d19c83f1a482fd411d7ca7a3b9e17d25980a74075ba0e88", - "sha256:51fdc7fb93615286428ee7758cecc2f374d5ff363bdd884c7ea622a7a327a81e", - "sha256:6eef0cf8db3857b2b556213d97dd82de76e28a6524853a9beb3264983391dc1a", - "sha256:6f4c22717c74d44bcd7af353024ce71c6b55346dad5e2cc1ddc17ce8c4507c6b", - "sha256:73a80bd6eb6bcb338c1ec0da273f87420829c266379c8c82fa14c23fb586cfa1", - "sha256:89908aea5f46ee1474cc37fbc146677f8529ac99201bc2faf4ef8edc023c2bf3", - "sha256:8a3a5c4b16e9d0edb823fe54b59b5660cc8d4782d7bf2c214cb4b91a1940a8ef", - "sha256:96acc674bb9c9be63fa8b6dabc3248fdc575c4adc005c440ad02f87ca7edd079", - "sha256:973ad69fd7e31159eae8f580f3f707b718b61141838321c6fa4d891c4a2cca52", - "sha256:9b6f2d714c506e79cbead331de9aae6837c8dd36190d02da74cb409b36162e8a", - "sha256:9c0903bd93cbd34653dd63bbfcb99d7539c372795201f39d16fdfde4418de43a", - "sha256:9fce00156e79af37bb6db4e7587b30d11e7ac6a02cb5bac387f023808cd7d7f4", - "sha256:a598d0685e4ae07a0672b59792d2cc767d09d7a7f39fd9bd37ff84e060b1a996", - "sha256:b0a792c091bac433dfe0a70ac17fc2087d4595ab835b47b89defc8bbabcf5c73", - "sha256:bb87f23ae7d14b7b3c21009c4b1705ec107cb21ee71975992f6aca571fb4a42a", - "sha256:bf1e6bfed4860d72106f4e0a1ab519546982b45689937b40257cfd820650b920", - "sha256:c1ba333b4024c17c7591f0f372e2daa3c31db495a9b2af3cf664aef3c14354f7", - "sha256:c2140cf7a3ec475ef0938edb6eb363fa704159e0bf71dde15d953bacc1cf9d7d", - "sha256:c7e03b06f2982aa98d4ddd082a210c3db200471da523f9ac197f2828e80e7770", - "sha256:d02cea2252abc3756b2ac31f781f7a98e89ff9759b2e7450a1c7a0d13302ff50", - "sha256:da24375ab4c50e5b7486c115a3198d207954fe10aaa5708f7b65105df09109b2", - "sha256:e4c309a68cb5d6bbd0c50d5c71a25ae81f268c2dc675c6f4ea8ab2feec2ac4e2", - "sha256:f01b26c2290cbd74316990ba84a14ac3d599af9cebefc543d241a66e785cf17d", - "sha256:f201d34dc89342fabb2a10ed7c9a9aaaed9b7af0f16a5923f1ae562b31258dea", - "sha256:f74da1e5fcf20ade12c6bf1baa17a2dc3604958922de8dc83cbe3eff22e8b611" - ], - "version": "==1.0.3" + "sha256:002b5c72b6cd9b4bafd790f364b8480e859b4712e91f43014fe01e4f957b8467", + "sha256:0a68d3ac0104e2d3510de90a1091720157c319ceeb90d74f7b5295a6bee51bae", + "sha256:0df96d6eaf45ceca04b3f3b4b111b86b33785683d682c655063ef8057d61fd92", + "sha256:0dfe3947db5fb9ce52aaea6ca28112a170db9eae75adf9339a1aec434dc954ef", + "sha256:0e3590f9fb9f7fbc36df366267870e77269c03172d086fa76bb4eba8b2b46624", + "sha256:11184bc7e56fd74c00ead4f9cc9a3091d62ecb96e97653add7a879a14b003227", + "sha256:112b0f93202d7c0fef0b7810d465fde23c746a2d482e1e2de2aafd2ce1492c88", + "sha256:1276e8f34e139aeff1c77a3cefb295598b504ac5314d32c8c3d54d24fadb94c9", + "sha256:1576bd97527a93c44fa856770197dec00d223b0b9f36ef03f65bac60197cedf8", + "sha256:1e91d641d2bfe91ba4c52039adc5bccf27c335356055825c7f88742c8bb900dd", + "sha256:26b8feaca40a90cbe031b03d82b2898bf560027160d3eae1423f4a67654ec5d6", + "sha256:2999623886c5c02deefe156e8f869c3b0aaeba14bfc50aa2486a0415178fce55", + "sha256:2a2df1b55a78eb5f5b7d2a4bb221cd8363913830145fad05374a80bf0877cb1e", + "sha256:2bb8cdf50dd623392fa75525cce44a65a12a00c98e1e37bf0fb08ddce2ff60d2", + "sha256:2cc5ca2712ac0003bcb625c96368fd08a0f86bbc1a5578802512d87bc592fe44", + "sha256:35bc0faa494b0f1d851fd29129b2575b2e26d41d177caacd4206d81502d4c6a6", + "sha256:3c11a48cf5e59026ad7cb0dc29e29a01b5a66a3e333dc11c04f7e991fc5510a9", + "sha256:449e57cc1ff18d3b444eb554e44613cffcccb32805d16726a5494038c3b93dab", + "sha256:462497af5fd4e0edbb1559c352ad84f6c577ffbbb708566a0abaaa84acd9f3ae", + "sha256:4733359808c56d5d7756628736061c432ded018e7a1dff2d35a02439043321aa", + "sha256:48f5d88c99f64c456413d74a975bd605a9b0526293218a3b77220a2c15458ba9", + "sha256:49565b0e3d7896d9ea71d9095df15b7f75a035c49be733051c34762ca95bbf7e", + "sha256:4ab251d229d10498e9a2f3b1e68ef64cb393394ec477e3370c457f9430ce9250", + "sha256:4d5834a2a48965a349da1c5a79760d94a1a0172fbb5ab6b5b33cbf8447e109ce", + "sha256:4dea20515f660aa6b7e964433b1808d098dcfcabbebeaaad240d11f909298075", + "sha256:545e3cf0cf74f3e48b470f68ed19551ae6f9722814ea969305794645da091236", + "sha256:63e29d6e8c9ca22b21846234913c3466b7e4ee6e422f205a2988083de3b08cae", + "sha256:6916c78f33602ecf0509cc40379271ba0f9ab572b066bd4bdafd7434dee4bc6e", + "sha256:6a4192b1ab40f8dca3f2877b70e63799d95c62c068c84dc028b40a6cb03ccd0f", + "sha256:6c9566f2c39ccced0a38d37c26cc3570983b97833c365a6044edef3574a00c08", + "sha256:76ee788122de3a68a02ed6f3a16bbcd97bc7c2e39bd4d94be2f1821e7c4a64e6", + "sha256:7760f85956c415578c17edb39eed99f9181a48375b0d4a94076d84148cf67b2d", + "sha256:77ccd2af37f3db0ea59fb280fa2165bf1b096510ba9fe0cc2bf8fa92a22fdb43", + "sha256:81fc7ba725464651190b196f3cd848e8553d4d510114a954681fd0b9c479d7e1", + "sha256:85f279d88d8e833ec015650fd15ae5eddce0791e1e8a59165318f371158efec6", + "sha256:9667bdfdf523c40d2511f0e98a6c9d3603be6b371ae9a238b7ef2dc4e7a427b0", + "sha256:a75dfb03f8b06f4ab093dafe3ddcc2d633259e6c3f74bb1b01996f5d8aa5868c", + "sha256:ac5bd7901487c4a1dd51a8c58f2632b15d838d07ceedaa5e4c080f7190925bff", + "sha256:aca0f1644d6b5a73eb3e74d4d64d5d8c6c3d577e753a04c9e9c87d07692c58db", + "sha256:b17be2478b622939e39b816e0aa8242611cc8d3583d1cd8ec31b249f04623243", + "sha256:c1683841cd4fa45ac427c18854c3ec3cd9b681694caf5bff04edb9387602d661", + "sha256:c23080fdeec4716aede32b4e0ef7e213c7b1093eede9ee010949f2a418ced6ba", + "sha256:d5b5b962221fa2c5d3a7f8133f9abffc114fe218eb4365e40f17732ade576c8e", + "sha256:d603de2b8d2ea3f3bcb2efe286849aa7a81531abc52d8454da12f46235092bcb", + "sha256:e83f80a7fec1a62cf4e6c9a660e39c7f878f603737a0cdac8c13131d11d97f52", + "sha256:eb514ad14edf07a1dbe63761fd30f89ae79b42625731e1ccf5e1f1092950eaa6", + "sha256:eba96145051ccec0ec86611fe9cf693ce55f2a3ce89c06ed307de0e085730ec1", + "sha256:ed6f7b854a823ea44cf94919ba3f727e230da29feb4a99711433f25800cf747f", + "sha256:f0029245c51fd9473dc1aede1160b0a29f4a912e6b1dd353fa6d317085b219da", + "sha256:f5d869c18f030202eb412f08b28d2afeea553d6613aee89e200d7aca7ef01f5f", + "sha256:fb62ea4b62bfcb0b380d5680f9a4b3f9a2d166d9394e9bbd9666c0ee09a3645c", + "sha256:fcb8a47f43acc113e24e910399376f7277cf8508b27e5b88499f053de6b115a8" + ], + "version": "==1.0.4" }, "mypy-extensions": { "hashes": [ @@ -278,10 +303,11 @@ }, "pathspec": { "hashes": [ - "sha256:7d15c4ddb0b5c802d161efc417ec1a2558ea2653c2e8ad9c19098201dc1c993a", - "sha256:e564499435a2673d586f6b2130bb5b95f04a3ba06f81b8f895b651a3c76aabb1" + "sha256:46846318467efc4556ccfd27816e004270a9eeeeb4d062ce5e6fc7a87c573f93", + "sha256:7ace6161b621d31e7902eb6b5ae148d12cfd23f4a249b9ffb6b9fee12084323d" ], - "version": "==0.9.0" + "markers": "python_version >= '3.7'", + "version": "==0.10.1" }, "pexpect": { "hashes": [ @@ -298,13 +324,21 @@ ], "version": "==0.7.5" }, + "platformdirs": { + "hashes": [ + "sha256:027d8e83a2d7de06bbac4e5ef7e023c02b863d7ea5d079477e722bb41ab25788", + "sha256:58c8abb07dcb441e6ee4b11d8df0ac856038f944ab98b7be6b27b2a3c7feef19" + ], + "markers": "python_version >= '3.7'", + "version": "==2.5.2" + }, "prompt-toolkit": { "hashes": [ - "sha256:1bb05628c7d87b645974a1bad3f17612be0c29fa39af9f7688030163f680bad6", - "sha256:e56f2ff799bacecd3e88165b1e2f5ebf9bcd59e80e06d395fa0cc4b8bd7bb506" + "sha256:9696f386133df0fc8ca5af4895afe5d78f5fcfe5258111c2a79a1c3e41ffa96d", + "sha256:9ada952c9d1787f52ff6d5f3484d0b4df8952787c087edf6a1f7c2cb1ea88148" ], "markers": "python_full_version >= '3.6.2'", - "version": "==3.0.24" + "version": "==3.0.31" }, "ptyprocess": { "hashes": [ @@ -313,29 +347,36 @@ ], "version": "==0.7.0" }, + "pure-eval": { + "hashes": [ + "sha256:01eaab343580944bc56080ebe0a674b39ec44a945e6d09ba7db3cb8cec289350", + "sha256:2b45320af6dfaa1750f543d714b6d1c520a1688dec6fd24d339063ce0aaa9ac3" + ], + "version": "==0.2.2" + }, "pycodestyle": { "hashes": [ - "sha256:514f76d918fcc0b55c6680472f0a37970994e07bbb80725808c17089be302068", - "sha256:c389c1d06bf7904078ca03399a4816f974a1d590090fecea0c63ec26ebaf1cef" + "sha256:2c9607871d58c76354b697b42f5d57e1ada7d261c261efac224b664affdc5785", + "sha256:d1735fc58b418fd7c5f658d28d943854f8a849b01a5d0a1e6f3f3fdd0166804b" ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", - "version": "==2.7.0" + "markers": "python_version >= '3.6'", + "version": "==2.9.1" }, "pyflakes": { "hashes": [ - "sha256:7893783d01b8a89811dd72d7dfd4d84ff098e5eed95cfa8905b22bbffe52efc3", - "sha256:f5bc8ecabc05bb9d291eb5203d6810b49040f6ff446a756326104746cc00c1db" + "sha256:4579f67d887f804e67edb544428f264b7b24f435b263c4614f384135cea553d2", + "sha256:491feb020dca48ccc562a8c0cbe8df07ee13078df59813b83959cbdada312ea3" ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", - "version": "==2.3.1" + "markers": "python_version >= '3.6'", + "version": "==2.5.0" }, "pygments": { "hashes": [ - "sha256:44238f1b60a76d78fc8ca0528ee429702aae011c265fe6a8dd8b63049ae41c65", - "sha256:4e426f72023d88d03b2fa258de560726ce890ff3b630f88c21cbb8b2503b8c6a" + "sha256:56a8508ae95f98e2b9bdf93a6be5ae3f7d8af858b43e02c5a2ff083726be40c1", + "sha256:f643f331ab57ba3c9d89212ee4a2dabc6e94f117cf4eefde99a0574720d14c42" ], - "markers": "python_version >= '3.5'", - "version": "==2.11.2" + "markers": "python_version >= '3.6'", + "version": "==2.13.0" }, "pynvim": { "hashes": [ @@ -360,114 +401,35 @@ }, "python-dotenv": { "hashes": [ - "sha256:32b2bdc1873fd3a3c346da1c6db83d0053c3c62f28f1f38516070c4c8971b1d3", - "sha256:a5de49a31e953b45ff2d2fd434bbc2670e8db5273606c1e737cc6b93eff3655f" + "sha256:1684eb44636dd462b66c3ee016599815514527ad99965de77f43e0944634a7e5", + "sha256:b77d08274639e3d34145dfa6c7008e66df0f04b7be7a75fd0d5292c191d79045" ], - "markers": "python_version >= '3.5'", - "version": "==0.19.2" + "markers": "python_version >= '3.7'", + "version": "==0.21.0" }, "python-magic": { "hashes": [ - "sha256:4fec8ee805fea30c07afccd1592c0f17977089895bdfaae5fec870a84e997626", - "sha256:de800df9fb50f8ec5974761054a708af6e4246b03b4bdaee993f948947b0ebcf" + "sha256:c1ba14b08e4a5f5c31a302b7721239695b2f0f058d125bd5ce1ee36b9d9d3c3b", + "sha256:c212960ad306f700aa0d01e5d7a325d20548ff97eb9920dcd29513174f0294d3" ], - "index": "pypi", - "version": "==0.4.24" - }, - "regex": { - "hashes": [ - "sha256:04611cc0f627fc4a50bc4a9a2e6178a974c6a6a4aa9c1cca921635d2c47b9c87", - "sha256:0b5d6f9aed3153487252d00a18e53f19b7f52a1651bc1d0c4b5844bc286dfa52", - "sha256:0d2f5c3f7057530afd7b739ed42eb04f1011203bc5e4663e1e1d01bb50f813e3", - "sha256:11772be1eb1748e0e197a40ffb82fb8fd0d6914cd147d841d9703e2bef24d288", - "sha256:1333b3ce73269f986b1fa4d5d395643810074dc2de5b9d262eb258daf37dc98f", - "sha256:16f81025bb3556eccb0681d7946e2b35ff254f9f888cff7d2120e8826330315c", - "sha256:1a171eaac36a08964d023eeff740b18a415f79aeb212169080c170ec42dd5184", - "sha256:1d6301f5288e9bdca65fab3de6b7de17362c5016d6bf8ee4ba4cbe833b2eda0f", - "sha256:1e031899cb2bc92c0cf4d45389eff5b078d1936860a1be3aa8c94fa25fb46ed8", - "sha256:1f8c0ae0a0de4e19fddaaff036f508db175f6f03db318c80bbc239a1def62d02", - "sha256:2245441445099411b528379dee83e56eadf449db924648e5feb9b747473f42e3", - "sha256:22709d701e7037e64dae2a04855021b62efd64a66c3ceed99dfd684bfef09e38", - "sha256:24c89346734a4e4d60ecf9b27cac4c1fee3431a413f7aa00be7c4d7bbacc2c4d", - "sha256:25716aa70a0d153cd844fe861d4f3315a6ccafce22b39d8aadbf7fcadff2b633", - "sha256:2dacb3dae6b8cc579637a7b72f008bff50a94cde5e36e432352f4ca57b9e54c4", - "sha256:34316bf693b1d2d29c087ee7e4bb10cdfa39da5f9c50fa15b07489b4ab93a1b5", - "sha256:36b2d700a27e168fa96272b42d28c7ac3ff72030c67b32f37c05616ebd22a202", - "sha256:37978254d9d00cda01acc1997513f786b6b971e57b778fbe7c20e30ae81a97f3", - "sha256:38289f1690a7e27aacd049e420769b996826f3728756859420eeee21cc857118", - "sha256:385ccf6d011b97768a640e9d4de25412204fbe8d6b9ae39ff115d4ff03f6fe5d", - "sha256:3c7ea86b9ca83e30fa4d4cd0eaf01db3ebcc7b2726a25990966627e39577d729", - "sha256:49810f907dfe6de8da5da7d2b238d343e6add62f01a15d03e2195afc180059ed", - "sha256:519c0b3a6fbb68afaa0febf0d28f6c4b0a1074aefc484802ecb9709faf181607", - "sha256:51f02ca184518702975b56affde6c573ebad4e411599005ce4468b1014b4786c", - "sha256:552a39987ac6655dad4bf6f17dd2b55c7b0c6e949d933b8846d2e312ee80005a", - "sha256:596f5ae2eeddb79b595583c2e0285312b2783b0ec759930c272dbf02f851ff75", - "sha256:6014038f52b4b2ac1fa41a58d439a8a00f015b5c0735a0cd4b09afe344c94899", - "sha256:61ebbcd208d78658b09e19c78920f1ad38936a0aa0f9c459c46c197d11c580a0", - "sha256:6213713ac743b190ecbf3f316d6e41d099e774812d470422b3a0f137ea635832", - "sha256:637e27ea1ebe4a561db75a880ac659ff439dec7f55588212e71700bb1ddd5af9", - "sha256:6aa427c55a0abec450bca10b64446331b5ca8f79b648531138f357569705bc4a", - "sha256:6ca45359d7a21644793de0e29de497ef7f1ae7268e346c4faf87b421fea364e6", - "sha256:6db1b52c6f2c04fafc8da17ea506608e6be7086715dab498570c3e55e4f8fbd1", - "sha256:752e7ddfb743344d447367baa85bccd3629c2c3940f70506eb5f01abce98ee68", - "sha256:760c54ad1b8a9b81951030a7e8e7c3ec0964c1cb9fee585a03ff53d9e531bb8e", - "sha256:768632fd8172ae03852e3245f11c8a425d95f65ff444ce46b3e673ae5b057b74", - "sha256:7a0b9f6a1a15d494b35f25ed07abda03209fa76c33564c09c9e81d34f4b919d7", - "sha256:7e070d3aef50ac3856f2ef5ec7214798453da878bb5e5a16c16a61edf1817cc3", - "sha256:7e12949e5071c20ec49ef00c75121ed2b076972132fc1913ddf5f76cae8d10b4", - "sha256:7e26eac9e52e8ce86f915fd33380f1b6896a2b51994e40bb094841e5003429b4", - "sha256:85ffd6b1cb0dfb037ede50ff3bef80d9bf7fa60515d192403af6745524524f3b", - "sha256:8618d9213a863c468a865e9d2ec50221015f7abf52221bc927152ef26c484b4c", - "sha256:8acef4d8a4353f6678fd1035422a937c2170de58a2b29f7da045d5249e934101", - "sha256:8d2f355a951f60f0843f2368b39970e4667517e54e86b1508e76f92b44811a8a", - "sha256:90b6840b6448203228a9d8464a7a0d99aa8fa9f027ef95fe230579abaf8a6ee1", - "sha256:9187500d83fd0cef4669385cbb0961e227a41c0c9bc39219044e35810793edf7", - "sha256:93c20777a72cae8620203ac11c4010365706062aa13aaedd1a21bb07adbb9d5d", - "sha256:93cce7d422a0093cfb3606beae38a8e47a25232eea0f292c878af580a9dc7605", - "sha256:94c623c331a48a5ccc7d25271399aff29729fa202c737ae3b4b28b89d2b0976d", - "sha256:97f32dc03a8054a4c4a5ab5d761ed4861e828b2c200febd4e46857069a483916", - "sha256:9a2bf98ac92f58777c0fafc772bf0493e67fcf677302e0c0a630ee517a43b949", - "sha256:a602bdc8607c99eb5b391592d58c92618dcd1537fdd87df1813f03fed49957a6", - "sha256:a9d24b03daf7415f78abc2d25a208f234e2c585e5e6f92f0204d2ab7b9ab48e3", - "sha256:abfcb0ef78df0ee9df4ea81f03beea41849340ce33a4c4bd4dbb99e23ec781b6", - "sha256:b013f759cd69cb0a62de954d6d2096d648bc210034b79b1881406b07ed0a83f9", - "sha256:b02e3e72665cd02afafb933453b0c9f6c59ff6e3708bd28d0d8580450e7e88af", - "sha256:b52cc45e71657bc4743a5606d9023459de929b2a198d545868e11898ba1c3f59", - "sha256:ba37f11e1d020969e8a779c06b4af866ffb6b854d7229db63c5fdddfceaa917f", - "sha256:bb804c7d0bfbd7e3f33924ff49757de9106c44e27979e2492819c16972ec0da2", - "sha256:bf594cc7cc9d528338d66674c10a5b25e3cde7dd75c3e96784df8f371d77a298", - "sha256:c38baee6bdb7fe1b110b6b3aaa555e6e872d322206b7245aa39572d3fc991ee4", - "sha256:c73d2166e4b210b73d1429c4f1ca97cea9cc090e5302df2a7a0a96ce55373f1c", - "sha256:c9099bf89078675c372339011ccfc9ec310310bf6c292b413c013eb90ffdcafc", - "sha256:cf0db26a1f76aa6b3aa314a74b8facd586b7a5457d05b64f8082a62c9c49582a", - "sha256:d19a34f8a3429bd536996ad53597b805c10352a8561d8382e05830df389d2b43", - "sha256:da80047524eac2acf7c04c18ac7a7da05a9136241f642dd2ed94269ef0d0a45a", - "sha256:de2923886b5d3214be951bc2ce3f6b8ac0d6dfd4a0d0e2a4d2e5523d8046fdfb", - "sha256:defa0652696ff0ba48c8aff5a1fac1eef1ca6ac9c660b047fc8e7623c4eb5093", - "sha256:e54a1eb9fd38f2779e973d2f8958fd575b532fe26013405d1afb9ee2374e7ab8", - "sha256:e5c31d70a478b0ca22a9d2d76d520ae996214019d39ed7dd93af872c7f301e52", - "sha256:ebaeb93f90c0903233b11ce913a7cb8f6ee069158406e056f884854c737d2442", - "sha256:ecfe51abf7f045e0b9cdde71ca9e153d11238679ef7b5da6c82093874adf3338", - "sha256:f99112aed4fb7cee00c7f77e8b964a9b10f69488cdff626ffd797d02e2e4484f", - "sha256:fd914db437ec25bfa410f8aa0aa2f3ba87cdfc04d9919d608d02330947afaeab" - ], - "version": "==2022.1.18" + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'", + "version": "==0.4.27" }, "s3cmd": { "hashes": [ - "sha256:49cd23d516b17974b22b611a95ce4d93fe326feaa07320bd1d234fed68cbccfa", - "sha256:966b0a494a916fc3b4324de38f089c86c70ee90e8e1cae6d59102103a4c0cc03" + "sha256:2a7d2afe09ce5aa9f2ce925b68c6e0c1903dd8d4e4a591cd7047da8e983a99c3", + "sha256:50ef46a83c6292439aaa2b15d6d134eddb3f28757732e3c65e30cbed2a8a9565" ], "index": "pypi", - "version": "==2.1.0" + "version": "==2.2.0" }, "setuptools": { "hashes": [ - "sha256:2404879cda71495fc4d5cbc445ed52fdaddf352b36e40be8dcc63147cb4edabe", - "sha256:68eb94073fc486091447fcb0501efd6560a0e5a1839ba249e5ff3c4c93f05f90" + "sha256:2e24e0bec025f035a2e72cdd1961119f557d78ad331bb00ff82efb2ab8da8e82", + "sha256:7732871f4f7fa58fb6bdcaeadb0161b2bd046c85905dbaa066bdcbcc81953b57" ], "markers": "python_version >= '3.7'", - "version": "==60.5.0" + "version": "==65.3.0" }, "six": { "hashes": [ @@ -477,12 +439,12 @@ "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", "version": "==1.16.0" }, - "testfixtures": { + "stack-data": { "hashes": [ - "sha256:2600100ae96ffd082334b378e355550fef8b4a529a6fa4c34f47130905c7426d", - "sha256:6ddb7f56a123e1a9339f130a200359092bd0a6455e31838d6c477e8729bb7763" + "sha256:66d2ebd3d7f29047612ead465b6cae5371006a71f45037c7e2507d01367bce3b", + "sha256:715c8855fbf5c43587b141e46cc9d9339cc0d1f8d6e0f98ed0d01c6cb974e29f" ], - "version": "==6.18.3" + "version": "==0.5.0" }, "toml": { "hashes": [ @@ -492,13 +454,29 @@ "markers": "python_version >= '2.6' and python_version not in '3.0, 3.1, 3.2, 3.3'", "version": "==0.10.2" }, + "tomli": { + "hashes": [ + "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc", + "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f" + ], + "markers": "python_full_version < '3.11.0a7'", + "version": "==2.0.1" + }, "traitlets": { "hashes": [ - "sha256:059f456c5a7c1c82b98c2e8c799f39c9b8128f6d0d46941ee118daace9eb70c7", - "sha256:2d313cc50a42cd6c277e7d7dc8d4d7fedd06a2c215f78766ae7b1a66277e0033" + "sha256:0bb9f1f9f017aa8ec187d8b1b2a7a6626a2a1d877116baba52a129bfa124f8e2", + "sha256:65fa18961659635933100db8ca120ef6220555286949774b9cfc106f941d1c7a" ], "markers": "python_version >= '3.7'", - "version": "==5.1.1" + "version": "==5.3.0" + }, + "typing-extensions": { + "hashes": [ + "sha256:25642c956049920a5aa49edcdd6ab1e06d7e5d467fc00e0506c44ac86fbfca02", + "sha256:e6d2677a32f47fc7eb2795db1dd15c1f34eff616bcaf2cfb5e997f854fa1c4a6" + ], + "markers": "python_version < '3.10'", + "version": "==4.3.0" }, "wcwidth": { "hashes": [ diff --git a/boards/Pico87/main.py b/boards/Pico87/main.py index 26e20f0dc..e54d14e23 100644 --- a/boards/Pico87/main.py +++ b/boards/Pico87/main.py @@ -1,5 +1,4 @@ import board - from kb import KMKKeyboard from kmk.extensions.lock_status import LockStatus @@ -23,7 +22,9 @@ def set_lock_leds(self): Pico87.leds.set_brightness(0, leds=[1]) def after_hid_send(self, sandbox): - super().after_hid_send(sandbox) # Critically important. Removing this will break lock status. + super().after_hid_send( + sandbox + ) # Critically important. Removing this will break lock status. if self.report_updated: self.set_lock_leds() @@ -36,8 +37,10 @@ def after_hid_send(self, sandbox): MOLYR = KC.MO(1) # Make this for better looking formatting... -______ = 'NO' +______ = "NO" +# flake8: noqa +# fmt: off Pico87.keymap = [[ # Layer 0 QWERTY 'ESC', ______, 'F1', 'F2', 'F3', 'F4', ______, 'F5', 'F6', 'F7', 'F8', 'F9', 'F10', 'F11', 'F12', 'PSCR', 'SLCK', 'PAUS', @@ -55,6 +58,7 @@ def after_hid_send(self, sandbox): ______, 'LSFT', 'Z', 'X', 'C', 'V', 'B', 'N', 'M', 'COMM', 'DOT', 'SLSH', ______, 'RSFT', ______, ______, 'UP', ______, 'LCTL', 'LGUI', ______, 'LALT', ______, ______, 'SPC', ______, ______, ______, 'RALT', 'RGUI', ______, MOLYR, 'RCTL', 'LEFT', 'DOWN', 'RGHT', ]] +# fmt: on -if __name__ == '__main__': +if __name__ == "__main__": Pico87.go() diff --git a/boards/anavi/knob1/code.py b/boards/anavi/knob1/code.py index c3d369aa5..7544f8e4a 100644 --- a/boards/anavi/knob1/code.py +++ b/boards/anavi/knob1/code.py @@ -19,7 +19,7 @@ encoder_handler.map = (((KC.VOLD, KC.VOLU, KC.MUTE),),) knob.modules.append(encoder_handler) -print('ANAVI Knob 1') +print("ANAVI Knob 1") rgb_ext = RGB( pixel_pin=board.NEOPIXEL, @@ -32,5 +32,5 @@ knob.keymap = [[KC.MUTE]] -if __name__ == '__main__': +if __name__ == "__main__": knob.go() diff --git a/boards/anavi/knobs3/code.py b/boards/anavi/knobs3/code.py index 054d47c9b..2fde11325 100644 --- a/boards/anavi/knobs3/code.py +++ b/boards/anavi/knobs3/code.py @@ -25,7 +25,7 @@ ) knob.modules.append(encoder_handler) -print('ANAVI Knobs 3') +print("ANAVI Knobs 3") rgb_ext = RGB( pixel_pin=board.NEOPIXEL, @@ -38,5 +38,5 @@ knob.keymap = [[KC.MUTE]] -if __name__ == '__main__': +if __name__ == "__main__": knob.go() diff --git a/boards/anavi/macro-pad-10/code.py b/boards/anavi/macro-pad-10/code.py index 6affbaf50..b148b1568 100644 --- a/boards/anavi/macro-pad-10/code.py +++ b/boards/anavi/macro-pad-10/code.py @@ -8,7 +8,7 @@ from kmk.modules.encoder import EncoderHandler from kmk.scanners import DiodeOrientation -print('ANAVI Macro Pad 10') +print("ANAVI Macro Pad 10") keyboard = KMKKeyboard() led_ext = LED( @@ -82,5 +82,5 @@ encoder_handler.map = (((KC.VOLD, KC.VOLU, KC.MUTE),),) keyboard.modules.append(encoder_handler) -if __name__ == '__main__': +if __name__ == "__main__": keyboard.go() diff --git a/boards/atreus62/main.py b/boards/atreus62/main.py index 73ab37c80..788f751c5 100644 --- a/boards/atreus62/main.py +++ b/boards/atreus62/main.py @@ -1,5 +1,4 @@ import board - from kb import KMKKeyboard from kmk.handlers.sequences import send_string, simple_key_sequence @@ -174,6 +173,8 @@ # make keymap +# flake8: noqa +# fmt: off keyboard.keymap = [ [ # qwerty KC.ESC, KC.N1, KC.N2, KC.N3, KC.N4, KC.N5, KC.N6, KC.N7, KC.N8, KC.N9, KC.N0, KC.MINS, @@ -200,7 +201,7 @@ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC.TRNS, KC.TRNS, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, ], ] - +# fmt: on # for use in the encoder extension encoder_map = [ @@ -219,5 +220,5 @@ ], ] -if __name__ == '__main__': +if __name__ == "__main__": keyboard.go() diff --git a/boards/boardsource/3x4/main.py b/boards/boardsource/3x4/main.py index b01abcb8c..5f0e14644 100644 --- a/boards/boardsource/3x4/main.py +++ b/boards/boardsource/3x4/main.py @@ -14,6 +14,8 @@ RAISE = KC.MO(1) +# flake8: noqa +# fmt: off keyboard.keymap = [ [ #Base KC.N0, KC.N1, KC.N4, KC.N7, @@ -26,6 +28,7 @@ _______, _______, _______, _______ ] ] +# fmt: on -if __name__ == '__main__': +if __name__ == "__main__": keyboard.go() diff --git a/boards/boardsource/4x12/main.py b/boards/boardsource/4x12/main.py index e5fb6e959..103443bcb 100644 --- a/boards/boardsource/4x12/main.py +++ b/boards/boardsource/4x12/main.py @@ -19,6 +19,8 @@ LOWER = KC.MO(1) RAISE = KC.MO(2) +# flake8: noqa +# fmt:off keyboard.keymap = [ [ #QWERTY KC.TAB, KC.Q, KC.W, KC.E, KC.R, KC.T, KC.Y, KC.U, KC.I, KC.O, KC.P, KC.BSPC, @@ -39,6 +41,7 @@ _______, _______, _______, _______, _______, _______, _______, _______, KC.MNXT, KC.VOLD, KC.VOLU, KC.MPLY ] ] +# fmt: on -if __name__ == '__main__': +if __name__ == "__main__": keyboard.go() diff --git a/boards/boardsource/5x12/main.py b/boards/boardsource/5x12/main.py index 447f93608..8c05bbc1f 100644 --- a/boards/boardsource/5x12/main.py +++ b/boards/boardsource/5x12/main.py @@ -19,6 +19,8 @@ LOWER = KC.MO(1) RAISE = KC.MO(2) +# flake8: noqa +# fmt: off keyboard.keymap = [ [ #QWERTY KC.GRV, KC.N1, KC.N2, KC.N3, KC.N4, KC.N5, KC.N6, KC.N7, KC.N8, KC.N9, KC.N0, KC.BSPC, @@ -42,6 +44,7 @@ _______, _______, _______, _______, _______, _______, _______, _______, KC.MNXT, KC.VOLD, KC.VOLU, KC.MPLY ] ] +# fmt: on -if __name__ == '__main__': +if __name__ == "__main__": keyboard.go() diff --git a/boards/boardsource/Lulu/kb.py b/boards/boardsource/Lulu/kb.py index 1dc3f1d87..48896733f 100644 --- a/boards/boardsource/Lulu/kb.py +++ b/boards/boardsource/Lulu/kb.py @@ -12,20 +12,21 @@ def __init__(self): self.matrix = [ MatrixScanner( # required arguments: - column_pins = self.col_pins, - row_pins = self.row_pins, + column_pins=self.col_pins, + row_pins=self.row_pins, # optional arguments with defaults: columns_to_anodes=DiodeOrientation.COL2ROW, interval=0.02, - max_events=64 + max_events=64, ), RotaryioEncoder( pin_a=board.GP08, pin_b=board.GP09, # optional divisor=4, - ) + ), ] + col_pins = ( board.GP02, board.GP03, @@ -43,12 +44,13 @@ def __init__(self): data_pin = board.RX rgb_pixel_pin = board.GP29 i2c = board.I2C - SCL=board.SCL - SDA=board.SDA - encoder_a=board.GP08 - encoder_b=board.GP09 - # NOQA + SCL = board.SCL + SDA = board.SDA + encoder_a = board.GP08 + encoder_b = board.GP09 + # flake8: noqa + # fmt: off led_key_pos =[11,10,9 ,8 ,7 ,6 , 41,42,43,44,45,46, 12,13,14,15,16,17, 52,51,50,49,48,47, 23,22,21,20,19,18, 53,54,55,56,57,58, @@ -57,11 +59,12 @@ def __init__(self): 3 ,4 ,5 , 40,39,38, 2 ,1 ,0 , 35,36,37 ] + # fmt: on brightness_limit = 0.5 num_pixels = 70 - # NOQA # flake8: noqa + # fmt: off coord_mapping = [ 0, 1, 2, 3, 4, 5, 37, 36, 35, 34, 33, 32, 6, 7, 8, 9, 10, 11, 43, 42, 41, 40, 39, 38, @@ -70,4 +73,4 @@ def __init__(self): 25,26, 27, 28, 60, 59, 58, 57, 30,31, 62,63 ] - + # fmt: on diff --git a/boards/boardsource/Lulu/main.py b/boards/boardsource/Lulu/main.py index 7834850a7..a7a6ae77f 100644 --- a/boards/boardsource/Lulu/main.py +++ b/boards/boardsource/Lulu/main.py @@ -1,5 +1,4 @@ import supervisor - from kb import KMKKeyboard from kmk.extensions.peg_oled_Display import ( @@ -24,18 +23,18 @@ oled_ext = Oled( OledData( - corner_one={0: OledReactionType.STATIC, 1: ['qwertyzzzz']}, + corner_one={0: OledReactionType.STATIC, 1: ["qwertyzzzz"]}, corner_two={ 0: OledReactionType.LAYER, - 1: ['1', '2', '3', '4', '5', '6', '7', '8'], + 1: ["1", "2", "3", "4", "5", "6", "7", "8"], }, corner_three={ 0: OledReactionType.LAYER, - 1: ['base', 'raise', 'lower', 'adjust', '5', '6', '7', '8'], + 1: ["base", "raise", "lower", "adjust", "5", "6", "7", "8"], }, corner_four={ 0: OledReactionType.LAYER, - 1: ['qwertyzzz', 'nums', 'shifted', 'leds', '5', '6', '7', '8'], + 1: ["qwertyzzz", "nums", "shifted", "leds", "5", "6", "7", "8"], }, ), toDisplay=OledDisplayMode.TXT, @@ -129,6 +128,8 @@ split = Split(data_pin=keyboard.rx, data_pin2=keyboard.tx, uart_flip=False) keyboard.modules.append(split) +# flake8: noqa +# fmt: off keyboard.keymap = [ [ KC.ESC, KC.N1, KC.N2, KC.N3, KC.N4, KC.N5, KC.N6, KC.N7, KC.N8, KC.N9, KC.N0, KC.GRV, @@ -226,5 +227,7 @@ KC.TRNS, ], ] -if __name__ == '__main__': +# fmt: on + +if __name__ == "__main__": keyboard.go(hid_type=HIDModes.USB) diff --git a/boards/boardsource/microdox/kb.py b/boards/boardsource/microdox/kb.py index 95ab1df1d..bc8d02cc2 100644 --- a/boards/boardsource/microdox/kb.py +++ b/boards/boardsource/microdox/kb.py @@ -16,9 +16,11 @@ class KMKKeyboard(_KMKKeyboard): # NOQA # flake8: noqa + # fmt: off coord_mapping = [ 0, 1, 2, 3, 4, 20, 21, 22, 23, 24, 5, 6, 7, 8, 9, 25, 26, 27, 28, 29, 10, 11, 12, 13, 14, 30, 31, 32, 33, 34, 17, 18, 19, 35, 36, 37, ] + # fmt: on diff --git a/boards/boardsource/microdox/main.py b/boards/boardsource/microdox/main.py index bbae56660..c44045f3b 100644 --- a/boards/boardsource/microdox/main.py +++ b/boards/boardsource/microdox/main.py @@ -30,6 +30,8 @@ RGB_VAI = KC.RGB_VAI RGB_VAD = KC.RGB_VAD +# flake8: noqa +# fmt: off keyboard.keymap = [ [ #QWERTY KC.Q, KC.W, KC.E, KC.R, KC.T, KC.Y, KC.U, KC.I, KC.O, KC.P,\ @@ -50,6 +52,7 @@ XXXXXXX, XXXXXXX, XXXXXXX, KC.ENT, XXXXXXX, KC.DEL ] ] +# fmt: on -if __name__ == '__main__': +if __name__ == "__main__": keyboard.go() diff --git a/boards/crkbd/kb.py b/boards/crkbd/kb.py index 5754816dd..7698437e8 100644 --- a/boards/crkbd/kb.py +++ b/boards/crkbd/kb.py @@ -21,10 +21,11 @@ class KMKKeyboard(_KMKKeyboard): powersave_pin = board.P0_13 # flake8: noqa + # fmt: off coord_mapping = [ 0, 1, 2, 3, 4, 5, 29, 28, 27, 26, 25, 24, 6, 7, 8, 9, 10, 11, 35, 34, 33, 32, 31, 30, 12, 13, 14, 15, 16, 17, 41, 40, 39, 38, 37, 36, 21, 22, 23, 47, 46, 45, ] - + # fmt: on diff --git a/boards/crkbd/kb_rp2040.py b/boards/crkbd/kb_rp2040.py index b173f2a13..96aa84d56 100644 --- a/boards/crkbd/kb_rp2040.py +++ b/boards/crkbd/kb_rp2040.py @@ -20,9 +20,11 @@ class KMKKeyboard(_KMKKeyboard): i2c = board.I2C # flake8: noqa + # fmt: off coord_mapping = [ 0, 1, 2, 3, 4, 5, 29, 28, 27, 26, 25, 24, 6, 7, 8, 9, 10, 11, 35, 34, 33, 32, 31, 30, 12, 13, 14, 15, 16, 17, 41, 40, 39, 38, 37, 36, 21, 22, 23, 47, 46, 45, ] + # fmt: on diff --git a/boards/crkbd/main.py b/boards/crkbd/main.py index e1d2e2d71..cbcf3d759 100644 --- a/boards/crkbd/main.py +++ b/boards/crkbd/main.py @@ -8,7 +8,14 @@ keyboard = KMKKeyboard() # Adding extensions -rgb = RGB(pixel_pin=keyboard.rgb_pixel_pin, num_pixels=27, val_limit=100, hue_default=190, sat_default=100, val_default=5) +rgb = RGB( + pixel_pin=keyboard.rgb_pixel_pin, + num_pixels=27, + val_limit=100, + hue_default=190, + sat_default=100, + val_default=5, +) # TODO Comment one of these on each side split_side = SplitSide.LEFT @@ -36,7 +43,8 @@ RGB_VAI = KC.RGB_VAI RGB_VAD = KC.RGB_VAD - +# flake8: noqa +# fmt: off keyboard.keymap = [ [ #QWERTY KC.TAB, KC.Q, KC.W, KC.E, KC.R, KC.T, KC.Y, KC.U, KC.I, KC.O, KC.P, KC.BSPC,\ @@ -63,6 +71,7 @@ KC.LGUI, LOWER, ADJUST, KC.ENT, RAISE, KC.RALT, ] ] +# fmt: off if __name__ == '__main__': keyboard.go() diff --git a/boards/crowboard/main.py b/boards/crowboard/main.py index 8aa8b1702..3773c24b3 100644 --- a/boards/crowboard/main.py +++ b/boards/crowboard/main.py @@ -1,5 +1,4 @@ import board - from kb import KMKKeyboard from kmk.keys import KC @@ -24,12 +23,14 @@ CAD = KC.LCTL(KC.LALT(KC.DEL)) - ZSFT = KC.MT(KC.Z, KC.LSFT, prefer_hold=True, tap_interrupted=False, tap_time=3000) -SLSHSFT = KC.MT(KC.SLSH, KC.LSFT, prefer_hold=True, tap_interrupted=False, tap_time=3000) +SLSHSFT = KC.MT( + KC.SLSH, KC.LSFT, prefer_hold=True, tap_interrupted=False, tap_time=3000 +) ALCTL = KC.MT(KC.A, KC.LCTRL, prefer_hold=False, tap_interrupted=False, tap_time=150) -# flake8: noqa: E261 +# flake8: noqa +# fmt: off keyboard.keymap = [ [ # QWERTY KC.Q, KC.W, KC.E, KC.R, KC.T, KC.Y, KC.U, KC.I, KC.O, KC.P, @@ -60,6 +61,7 @@ ] ] +# fmt: on # Uncomment for Trackball # from kmk.modules.pimoroni_trackball import Trackball, TrackballMode @@ -88,5 +90,5 @@ # keyboard.debug_enabled = True -if __name__ == '__main__': +if __name__ == "__main__": keyboard.go() diff --git a/boards/ergo_travel/kb.py b/boards/ergo_travel/kb.py index 78fc8b04a..efa022de0 100644 --- a/boards/ergo_travel/kb.py +++ b/boards/ergo_travel/kb.py @@ -23,11 +23,12 @@ class KMKKeyboard(_KMKKeyboard): i2c = board.I2C powersave_pin = board.P0_13 - # NOQA # flake8: noqa + # fmt: off coord_mapping = [ 0, 1, 2, 3, 4, 5, 6, 34, 33, 32, 31, 30, 29, 28, 7, 8, 9, 10, 11, 12, 13, 41, 40, 39, 38, 37, 36, 35, 14, 15, 16, 17, 18, 19, 20, 48, 47, 46, 45, 44, 43, 42, 21, 22, 23, 24, 25, 26, 54, 53, 52, 51, 50, 49, ] + # fmt: on diff --git a/boards/ergo_travel/main.py b/boards/ergo_travel/main.py index f48427564..5db5fd7f6 100644 --- a/boards/ergo_travel/main.py +++ b/boards/ergo_travel/main.py @@ -15,7 +15,7 @@ media = MediaKeys() layers_ext = Layers() keyboard.modules = [layers_ext, split] -keyboard.extensions = (media) +keyboard.extensions = media # Cleaner key names _______ = KC.TRNS @@ -28,6 +28,8 @@ CALTDEL = KC.LCTL(KC.LALT(KC.DEL)) TSKMGR = KC.LCTL(KC.LSFT(KC.KC_ESC)) +# flake8: noqa +# fmt: off keyboard.keymap = [ [ #QWERTY KC.ESC, KC.Q, KC.W, KC.E, KC.R, KC.T, KC.MINS, KC.EQL, KC.Y, KC.U, KC.I, KC.O, KC.P, KC.BSPC,\ @@ -54,6 +56,7 @@ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, ] ] +# fmt: off if __name__ == '__main__': keyboard.go() diff --git a/boards/fingerpunch/ffkb/kb2040/kb.py b/boards/fingerpunch/ffkb/kb2040/kb.py index 00fba7d4b..24c0aad47 100644 --- a/boards/fingerpunch/ffkb/kb2040/kb.py +++ b/boards/fingerpunch/ffkb/kb2040/kb.py @@ -29,10 +29,12 @@ class KMKKeyboard(_KMKKeyboard): rgb_num_pixels = 42 i2c = board.I2C -# flake8: noqa + # flake8: noqa + # fmt: off coord_mapping = [ ic(0, 0), ic(0, 1), ic(0, 2), ic(0, 3), ic(0, 4), ic(0, 5), ic(0, 6), ic(0, 7), ic(4, 3), ic(3, 4), ic(4, 5), ic(3, 7), ic(1, 0), ic(1, 1), ic(1, 2), ic(1, 3), ic(1, 4), ic(1, 5), ic(4, 1), ic(1, 6), ic(1, 7), ic(3, 2), ic(4, 4), ic(3, 5), ic(4, 7), ic(2, 0), ic(2, 1), ic(2, 2), ic(2, 3), ic(2, 4), ic(2, 5), ic(2, 6), ic(2, 7), ic(4, 2), ic(3, 3), ic(3, 6), ic(4, 6), ic(5, 1), ic(5, 3), ic(5, 4), ic(5, 5), ic(5, 6), ic(5, 7), ic(5, 2), ic(5, 0) ] + # fmt: on diff --git a/boards/fingerpunch/ffkb/kb2040/main.py b/boards/fingerpunch/ffkb/kb2040/main.py index a37d3bda9..1d07c9b5c 100644 --- a/boards/fingerpunch/ffkb/kb2040/main.py +++ b/boards/fingerpunch/ffkb/kb2040/main.py @@ -1,6 +1,5 @@ import board - -from kb_kb2040 import KMKKeyboard +from kb import KMKKeyboard from kmk.extensions.media_keys import MediaKeys from kmk.extensions.rgb import RGB @@ -19,7 +18,14 @@ XXXXXXX = KC.NO # Adding extensions -rgb = RGB(pixel_pin=keyboard.rgb_pixel_pin, num_pixels=keyboard.rgb_num_pixels, val_limit=50, hue_default=190, sat_default=100, val_default=5) +rgb = RGB( + pixel_pin=keyboard.rgb_pixel_pin, + num_pixels=keyboard.rgb_num_pixels, + val_limit=50, + hue_default=190, + sat_default=100, + val_default=5, +) modtap = ModTap() layers = Layers() @@ -27,12 +33,12 @@ encoder_handler = EncoderHandler() -keyboard.modules = [layers, modtap] #, encoder_handler] +keyboard.modules = [layers, modtap] # , encoder_handler] keyboard.modules.append(MouseKeys()) keyboard.extensions = [rgb, media_keys] -encoder_handler.pins = ((board.D3, board.D2, board.D10, False)) +encoder_handler.pins = (board.D3, board.D2, board.D10, False) ZOOM_IN = KC.LCTRL(KC.EQUAL) ZOOM_OUT = KC.LCTRL(KC.MINUS) @@ -88,6 +94,8 @@ RGB_M_K = KC.RGB_MODE_KNIGHT RGB_M_S = KC.RGB_MODE_SWIRL +# flake8: noqa +# fmt: off keyboard.keymap = [ [ #COLEMAK-DH KC.ESC, KC.Q, KC.W, KC.F, KC.P, KC.B, KC.J, KC.L, KC.U, KC.Y, KC.SCLN, KC.BSPC, @@ -136,5 +144,6 @@ ((_______, _______, _______)), # Layer 6 ] -if __name__ == '__main__': +# fmt: on +if __name__ == "__main__": keyboard.go() diff --git a/boards/fingerpunch/ffkb/nice_nano/kb.py b/boards/fingerpunch/ffkb/nice_nano/kb.py index ceea10614..add0b6ece 100644 --- a/boards/fingerpunch/ffkb/nice_nano/kb.py +++ b/boards/fingerpunch/ffkb/nice_nano/kb.py @@ -28,12 +28,15 @@ class KMKKeyboard(_KMKKeyboard): rgb_num_pixels = 42 i2c = board.I2C -# flake8: noqa + # flake8: noqa + # fmt: off coord_mapping = [ 0, 1, 2, 3, 4, 5, 6, 7, 35, 28, 37, 31, 8, 9, 10, 11, 12, 13, 33, 14, 15, 26, 36, 29, 39, 16, 17, 18, 19, 20, 21, 22, 23, 34, 27, 30, 38, 41, 43, 44, 45, 46, 47, 42, 40, ] + # fmt: on -encoder_pins = ((board.P0_20, board.P0_17, board.P0_09, False)) + +encoder_pins = ((board.P0_20, board.P0_17, board.P0_09, False),) diff --git a/boards/fingerpunch/ffkb/nice_nano/main.py b/boards/fingerpunch/ffkb/nice_nano/main.py index db913c349..9b9d52bf2 100644 --- a/boards/fingerpunch/ffkb/nice_nano/main.py +++ b/boards/fingerpunch/ffkb/nice_nano/main.py @@ -1,5 +1,4 @@ import board - import kb from kmk.keys import KC @@ -10,10 +9,10 @@ combos = Combos() dyn_seq = DynamicSequences( - slots=1, # The number of sequence slots to use - timeout=60000, # Maximum time to spend in record or config mode before stopping automatically, milliseconds - key_interval=20, # Milliseconds between key events while playing - use_recorded_speed=False, # Whether to play the sequence at the speed it was typed + slots=1, + timeout=60000, + key_interval=20, + use_recorded_speed=False, ) layers = Layers() oneshot = OneShot() @@ -42,9 +41,10 @@ Sequence((KC.LEADER, KC.P), KC.LCTL(KC.V)), # Paste Sequence((KC.LEADER, KC.U), KC.LCTL(KC.Z)), # Undo Sequence((KC.LEADER, KC.Y), KC.LCTL(KC.Y)), # redo - ] +] # flake8: noqa +# fmt: off keyboard.keymap = [ [ # 0: Colemak-DH letters KC.ESC, KC.Q, KC.W, KC.F, KC.P, KC.B, KC.J, KC.L, KC.U, KC.Y, KC.SCLN, KC.LEADER, @@ -65,6 +65,7 @@ _______, _______, _______, _______, _______, _______, _______, _______, ], ] +# fmt: on -if __name__ == '__main__': +if __name__ == "__main__": keyboard.go() diff --git a/boards/fourtypercentclub/gherkin/main.py b/boards/fourtypercentclub/gherkin/main.py index 7be13b75a..1690a5cfb 100644 --- a/boards/fourtypercentclub/gherkin/main.py +++ b/boards/fourtypercentclub/gherkin/main.py @@ -31,6 +31,8 @@ BL_DEC = KC.BL_DEC BL_INC = KC.BL_INC +# flake8: noqa +# fmt: off keyboard.keymap = [ [ KC.Q, KC.W, KC.E, KC.R, KC.T, KC.Y, KC.U, KC.I, KC.O, KC.P, @@ -63,6 +65,7 @@ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ] ] +# fmt: on -if __name__ == '__main__': +if __name__ == "__main__": keyboard.go() diff --git a/boards/fourtypercentclub/luddite/main.py b/boards/fourtypercentclub/luddite/main.py index 8c53634cf..e17629ef7 100644 --- a/boards/fourtypercentclub/luddite/main.py +++ b/boards/fourtypercentclub/luddite/main.py @@ -19,6 +19,8 @@ BASE = 0 FN1 = 1 +# flake8: noqa +# fmt: off keyboard.keymap = [ [ KC.GESC, KC.N1, KC.N2, KC.N3, KC.N4, KC.N5, KC.N6, KC.N7, KC.N8, KC.N9, KC.N0, KC.MINS, KC.EQL, KC.BSPC, @@ -36,6 +38,7 @@ KC.GRV, _______, _______, _______, _______, _______, _______, _______, ], ] +# fmt: on -if __name__ == '__main__': +if __name__ == "__main__": keyboard.go() diff --git a/boards/keebio/iris/kb.py b/boards/keebio/iris/kb.py index 8913fe17c..0b39ac41e 100644 --- a/boards/keebio/iris/kb.py +++ b/boards/keebio/iris/kb.py @@ -23,6 +23,7 @@ class KMKKeyboard(_KMKKeyboard): powersave_pin = board.P0_13 # flake8: noqa + # fmt: off coord_mapping = [ 0, 1, 2, 3, 4, 5, 35, 34, 33, 32, 31, 30, 6, 7, 8, 9, 10, 11, 41, 40, 39, 38, 37, 36, @@ -30,3 +31,4 @@ class KMKKeyboard(_KMKKeyboard): 18, 19, 20, 21, 22, 23, 26, 56, 53, 52, 51, 50, 49, 48, 27, 28, 29, 59, 58, 57, ] + # fmt: on diff --git a/boards/keebio/iris/kb_converter.py b/boards/keebio/iris/kb_converter.py index d01c2682d..82e36eb7b 100644 --- a/boards/keebio/iris/kb_converter.py +++ b/boards/keebio/iris/kb_converter.py @@ -30,7 +30,9 @@ class KMKKeyboard(_KMKKeyboard): # just like the above three rows, however, visually speaking, the # top-right thumb cluster button (when looking at the left-half PCB) # is more inline with R3, so we'll jam that key (and its mirror) in here + # flake8: noqa + # fmt: off coord_mapping = [ 0, 1, 2, 3, 4, 5, 36, 35, 34, 33, 32, 31, 6, 7, 8, 9, 10, 11, 42, 41, 40, 39, 38, 37, @@ -38,3 +40,4 @@ class KMKKeyboard(_KMKKeyboard): 18, 19, 20, 21, 22, 23, 26, 57, 54, 53, 52, 51, 50, 49, 28, 29, 30, 60, 59, 58, ] + # fmt: on diff --git a/boards/keebio/iris/main.py b/boards/keebio/iris/main.py index 3df4db677..e1f30c20e 100644 --- a/boards/keebio/iris/main.py +++ b/boards/keebio/iris/main.py @@ -67,7 +67,8 @@ keyboard.extensions = [rgb_ext] keyboard.modules = [split, layers_ext] - +# flake8: noqa +# fmt: off keyboard.keymap = [ [ KC.GESC, KC.N1, KC.N2, KC.N3, KC.N4, KC.N5, KC.N6, KC.N7, KC.N8, KC.N9, KC.N0, KC.BSPC, @@ -91,6 +92,7 @@ KC.HOME, KC.END, _______, KC.VOLD, KC.PGUP, KC.PGDN, ], ] +# fmt: on if __name__ == '__main__': keyboard.go() diff --git a/boards/keebio/levinson/kb_converter.py b/boards/keebio/levinson/kb_converter.py index 517510784..706b67b17 100644 --- a/boards/keebio/levinson/kb_converter.py +++ b/boards/keebio/levinson/kb_converter.py @@ -9,7 +9,7 @@ class KMKKeyboard(_KMKKeyboard): row_pins = (board.D13, board.D11, board.D10, board.D9) diode_orientation = DiodeOrientation.COLUMNS - split_type = 'UART' + split_type = "UART" split_flip = True split_offsets = [6, 6, 6, 6, 6] data_pin = board.SCL diff --git a/boards/keebio/levinson/main.py b/boards/keebio/levinson/main.py index e60efecb4..9644721e8 100644 --- a/boards/keebio/levinson/main.py +++ b/boards/keebio/levinson/main.py @@ -24,6 +24,8 @@ RAISE = KC.MO(4) ADJUST = KC.MO(5) +# flake8: noqa +# fmt: off keyboard.keymap = [ # Qwerty # ,-----------------------------------------------------------------------------------. @@ -126,8 +128,8 @@ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, ], - ] +# fmt: on -if __name__ == '__main__': +if __name__ == "__main__": keyboard.go() diff --git a/boards/keebio/nyquist/main.py b/boards/keebio/nyquist/main.py index 0817bc92c..4c73cbefe 100644 --- a/boards/keebio/nyquist/main.py +++ b/boards/keebio/nyquist/main.py @@ -25,6 +25,8 @@ RAISE = KC.MO(4) ADJUST = KC.MO(5) +# flake8: noqa +# fmt: off keyboard.keymap = [ # Qwerty # ,-----------------------------------------------------------------------------------. @@ -145,8 +147,8 @@ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, ], - ] +# fmt: on -if __name__ == '__main__': +if __name__ == "__main__": keyboard.go() diff --git a/boards/kyria/main.py b/boards/kyria/main.py index f022e1aef..b3bad2b34 100644 --- a/boards/kyria/main.py +++ b/boards/kyria/main.py @@ -15,7 +15,8 @@ keyboard.modules.append(ModTap()) keyboard.extensions.append(MediaKeys()) -# Using drive names (KYRIAL, KYRIAR) to recognize sides; use split_side arg if you're not doing it +# Using drive names (KYRIAL, KYRIAR) to recognize sides; use split_side arg if you're +# not doing it split = Split(split_type=SplitType.UART, use_pio=True) keyboard.modules.append(split) @@ -32,11 +33,15 @@ keyboard.extensions.append(rgb_ext) # Edit your layout below -# Currently, that's a default QMK Kyria Layout - https://config.qmk.fm/#/splitkb/kyria/rev1/LAYOUT +# Currently, that's a default QMK Kyria Layout - +# https://config.qmk.fm/#/splitkb/kyria/rev1/LAYOUT ESC_LCTL = KC.MT(KC.ESC, KC.LCTL) QUOTE_RCTL = KC.MT(KC.QUOTE, KC.RCTL) ENT_LALT = KC.MT(KC.ENT, KC.LALT) MINUS_RCTL = KC.MT(KC.MINUS, KC.RCTL) + +# flake8: noqa +# fmt: off keyboard.keymap = [ [ KC.TAB, KC.Q, KC.W, KC.E, KC.R, KC.T, KC.Y, KC.U, KC.I, KC.O, KC.P, KC.BSPC, @@ -81,6 +86,7 @@ KC.TRNS, KC.TRNS, KC.TRNS, KC.TRNS, KC.TRNS, KC.TRNS, KC.TRNS, KC.TRNS, KC.TRNS, KC.TRNS, ], ] +# fmt: on # Uncomment below if using an encoder # Edit your encoder layout below @@ -95,5 +101,5 @@ ) keyboard.modules.append(encoder_handler) -if __name__ == '__main__': +if __name__ == "__main__": keyboard.go() diff --git a/boards/lily58/kb.py b/boards/lily58/kb.py index fe167ee0f..cdf396264 100644 --- a/boards/lily58/kb.py +++ b/boards/lily58/kb.py @@ -22,6 +22,7 @@ class KMKKeyboard(_KMKKeyboard): powersave_pin = board.P0_13 # flake8: noqa + # fmt: off coord_mapping = [ 0, 1, 2, 3, 4, 5, 36, 35, 34, 33, 32, 31, 6, 7, 8, 9, 10, 11, 42, 41, 40, 39, 38, 37, @@ -29,3 +30,4 @@ class KMKKeyboard(_KMKKeyboard): 18, 19, 20, 21, 22, 23, 54, 53, 52, 51, 50, 49, 26, 27, 28, 29, 30, 60, 59, 58, 57, 56, ] + # fmt: on diff --git a/boards/lily58/main.py b/boards/lily58/main.py index c6e9889b4..4ea5edb37 100644 --- a/boards/lily58/main.py +++ b/boards/lily58/main.py @@ -24,7 +24,14 @@ RGB_VAD = KC.RGB_VAD # Adding extensions -rgb = RGB(pixel_pin=rgb_pixel_pin, num_pixels=27, val_limit=100, hue_default=190, sat_default=100, val_default=5) +rgb = RGB( + pixel_pin=rgb_pixel_pin, + num_pixels=27, + val_limit=100, + hue_default=190, + sat_default=100, + val_default=5, +) # TODO Comment one of these on each side # Left is 0, Right is 1 @@ -36,6 +43,8 @@ extensions = [layers_ext, split, rgb] +# flake8: noqa +# fmt: off keyboard.keymap = [ [ #QWERTY XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,\ @@ -66,6 +75,7 @@ KC.LGUI, LOWER, ADJUST, KC.ENT, RAISE, KC.RALT, ] ] +# fmt: on -if __name__ == '__main__': +if __name__ == "__main__": keyboard.go() diff --git a/boards/lunakey_pico/kb.py b/boards/lunakey_pico/kb.py index 969ee1672..c0747a222 100644 --- a/boards/lunakey_pico/kb.py +++ b/boards/lunakey_pico/kb.py @@ -10,9 +10,11 @@ class KMKKeyboard(_KMKKeyboard): diode_orientation = DiodeOrientation.COLUMNS # flake8: noqa + # fmt: off coord_mapping = [ 0, 1, 2, 3, 4, 5, 29, 28, 27, 26, 25, 24, 6, 7, 8, 9, 10, 11, 35, 34, 33, 32, 31, 30, 12, 13, 14, 15, 16, 17, 41, 40, 39, 38, 37, 36, 20, 21, 22, 23, 47, 46, 45, 44, ] + # fmt: on diff --git a/boards/lunakey_pico/main.py b/boards/lunakey_pico/main.py index 15baace50..7cb3dac75 100644 --- a/boards/lunakey_pico/main.py +++ b/boards/lunakey_pico/main.py @@ -1,8 +1,8 @@ +import time + import board import digitalio - import pwmio -import time from kb import KMKKeyboard from kmk.extensions.media_keys import MediaKeys @@ -34,13 +34,11 @@ split_type=SplitType.UART, split_flip=True, data_pin=data_pin, - data_pin2=data_pin2 + data_pin2=data_pin2, ) rgb_ext = RGB( - pixel_pin=board.GP6, - num_pixels=6, - animation_mode=AnimationModes.BREATHING_RAINBOW + pixel_pin=board.GP6, num_pixels=6, animation_mode=AnimationModes.BREATHING_RAINBOW ) keyboard.modules = [layers_ext, modtap_ext, split] @@ -71,6 +69,8 @@ LANG1 = KC.LANG1 LANG2 = KC.LANG2 +# flake8: noqa +# fmt: off keyboard.keymap = [ [ # QWERTY # ------+--------+--------+--------+--------+--------+ +--------+--------+--------+--------+--------+--------+ @@ -117,6 +117,7 @@ # ------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+ ] ] +# fmt: on -if __name__ == '__main__': +if __name__ == "__main__": keyboard.go() diff --git a/boards/may_pad/main.py b/boards/may_pad/main.py index ba108decd..a3cb7c62d 100644 --- a/boards/may_pad/main.py +++ b/boards/may_pad/main.py @@ -16,6 +16,8 @@ _______ = KC.TRNS XXXXXXX = KC.NO +# flake8: noqa +# fmt: off keyboard.keymap = [ [ KC.NLCK, KC.PSLS, KC.PAST, KC.PMNS, @@ -25,6 +27,7 @@ _______, KC.P0, KC.PDOT, KC.PENT, ] ] +# fmt: on -if __name__ == '__main__': +if __name__ == "__main__": keyboard.go() diff --git a/boards/navi10/main.py b/boards/navi10/main.py index 72cf8520d..415f917f3 100644 --- a/boards/navi10/main.py +++ b/boards/navi10/main.py @@ -16,6 +16,8 @@ _______ = KC.TRNS XXXXXXX = KC.NO +# flake8: noqa +# fmt: off keyboard.keymap = [ [ #Nav Keys KC.INSERT, KC.HOME, KC.PGUP, @@ -36,6 +38,7 @@ KC.MPRV, KC.VOLD, KC.MNXT ], ] +# fmt: on -if __name__ == '__main__': +if __name__ == "__main__": keyboard.go() diff --git a/boards/pimoroni/keybow/code.py b/boards/pimoroni/keybow/code.py index c416005d2..b5a56d3dc 100644 --- a/boards/pimoroni/keybow/code.py +++ b/boards/pimoroni/keybow/code.py @@ -20,5 +20,5 @@ keybow.modules.extend([Layers()]) # fmt: on -if __name__ == '__main__': +if __name__ == "__main__": keybow.go() diff --git a/boards/pimoroni/keybow/keybow.py b/boards/pimoroni/keybow/keybow.py index 34438bfe5..c2f06730d 100644 --- a/boards/pimoroni/keybow/keybow.py +++ b/boards/pimoroni/keybow/keybow.py @@ -1,4 +1,4 @@ -''' +""" KMK keyboard for Pimoroni Keybow. WARNING: This doesn't currently function correctly on the Raspberry Pi Zero, @@ -30,12 +30,12 @@ C0 C1 C2 This keyboard file should automatically select the correct mapping at runtime. -''' +""" -import board +import sys import adafruit_dotstar -import sys +import board from kmk.extensions.rgb import RGB, AnimationModes from kmk.kmk_keyboard import KMKKeyboard @@ -63,7 +63,7 @@ def itsybitsy_pins(): def isPi(): - return sys.platform == 'BROADCOM' + return sys.platform == "BROADCOM" if isPi(): @@ -84,9 +84,9 @@ def isPi(): class Keybow(KMKKeyboard): - ''' + """ Default keyboard config for the Keybow. - ''' + """ extensions = [rgb_ext] diff --git a/boards/pimoroni/keybow_2040/code.py b/boards/pimoroni/keybow_2040/code.py index 464be5010..3fc52579c 100644 --- a/boards/pimoroni/keybow_2040/code.py +++ b/boards/pimoroni/keybow_2040/code.py @@ -26,5 +26,5 @@ ] # fmt: on -if __name__ == '__main__': +if __name__ == "__main__": keybow.go() diff --git a/boards/pimoroni/keybow_2040/is31fl3731_pixelbuf.py b/boards/pimoroni/keybow_2040/is31fl3731_pixelbuf.py index 6be76a8f6..86c1d244a 100644 --- a/boards/pimoroni/keybow_2040/is31fl3731_pixelbuf.py +++ b/boards/pimoroni/keybow_2040/is31fl3731_pixelbuf.py @@ -1,22 +1,21 @@ -''' -Simple PixelBuf wrapper for the IS31FL3731 controller used for the Keybow2040's RGB LEDs. -''' +""" +Simple PixelBuf wrapper for IS31FL3731 controller used for the Keybow2040's RGB LEDs. +""" import board - from adafruit_is31fl3731.keybow2040 import Keybow2040 as KeybowLeds from adafruit_pixelbuf import PixelBuf class Keybow2040Leds(PixelBuf): - ''' + """ Minimal PixelBuf wrapper for the Keybow 2040's LED array. - ''' + """ def __init__(self, size: int): self.leds = KeybowLeds(board.I2C()) self._pixels = size - super().__init__(size, byteorder='RGB') + super().__init__(size, byteorder="RGB") def _transmit(self, buffer): for pixel in range(self._pixels): diff --git a/boards/pimoroni/keybow_2040/keybow_2040.py b/boards/pimoroni/keybow_2040/keybow_2040.py index 162d0877c..8a54f867b 100644 --- a/boards/pimoroni/keybow_2040/keybow_2040.py +++ b/boards/pimoroni/keybow_2040/keybow_2040.py @@ -1,4 +1,4 @@ -''' +""" KMK keyboard for Pimoroni Keybow 2040. This is a 4x4 macro pad based on the RP2040. Each key is attached to a single @@ -19,7 +19,7 @@ The binding defined in the _KEY_CFG array binds the switches to keys such that the keymap can be written in a way that lines up with the natural order of the key switches, then adds [BOOT] in (4,0). [RESET] can't be mapped as a key. -''' +""" import board @@ -38,9 +38,9 @@ class Keybow2040(KMKKeyboard): - ''' + """ Default keyboard config for the Keybow2040. - ''' + """ def __init__(self): self.matrix = KeysScanner(_KEY_CFG) diff --git a/boards/reviung39/main.py b/boards/reviung39/main.py index e4bec6d6b..c2e666f64 100644 --- a/boards/reviung39/main.py +++ b/boards/reviung39/main.py @@ -8,7 +8,14 @@ keyboard = KMKKeyboard() # Adding extensions -rgb = RGB(pixel_pin=keyboard.rgb_pixel_pin, num_pixels=keyboard.rgb_num_pixels, val_limit=100, hue_default=190, sat_default=100, val_default=5) +rgb = RGB( + pixel_pin=keyboard.rgb_pixel_pin, + num_pixels=keyboard.rgb_num_pixels, + val_limit=100, + hue_default=190, + sat_default=100, + val_default=5, +) modtap = ModTap() layers_ext = Layers() @@ -23,6 +30,8 @@ LOWER = KC.MO(1) RAISE = KC.MO(2) +# flake8: noqa +# fmt: off keyboard.keymap = [ [ #QWERTY KC.ESC, KC.N1, KC.N2, KC.N3, KC.N4, KC.N5, KC.N6, KC.N7, KC.N8, KC.N9, KC.N0, KC.GRV, @@ -44,6 +53,7 @@ _______, _______, _______, _______, _______, _______, _______, _______ ] ] +# fmt: on -if __name__ == '__main__': +if __name__ == "__main__": keyboard.go() diff --git a/boards/reviung41/main.py b/boards/reviung41/main.py index 6933fb15e..749bd505a 100644 --- a/boards/reviung41/main.py +++ b/boards/reviung41/main.py @@ -8,7 +8,14 @@ keyboard = KMKKeyboard() # Adding extensions -rgb = RGB(pixel_pin=keyboard.rgb_pixel_pin, num_pixels=keyboard.rgb_num_pixels, val_limit=100, hue_default=190, sat_default=100, val_default=5) +rgb = RGB( + pixel_pin=keyboard.rgb_pixel_pin, + num_pixels=keyboard.rgb_num_pixels, + val_limit=100, + hue_default=190, + sat_default=100, + val_default=5, +) modtap = ModTap() layers_ext = Layers() @@ -34,6 +41,8 @@ RGB_VAI = KC.RGB_VAI RGB_VAD = KC.RGB_VAD +# flake8: noqa +# fmt: off keyboard.keymap = [ [ #QWERTY KC.TAB, KC.Q, KC.W, KC.E, KC.R, KC.T, KC.Y, KC.U, KC.I, KC.O, KC.P, KC.BSPC, @@ -60,6 +69,7 @@ KC.LALT, LOWER, KC.SPC, RAISE, KC.RGUI, ] ] +# fmt: on -if __name__ == '__main__': +if __name__ == "__main__": keyboard.go() diff --git a/boards/rhymestone/main.py b/boards/rhymestone/main.py index 66075b5bb..19fbfe608 100644 --- a/boards/rhymestone/main.py +++ b/boards/rhymestone/main.py @@ -27,6 +27,8 @@ KC_11SF = KC.LSFT(KC.F11) KC_GRSF = KC.RSFT(KC.GRV) +# flake8: noqa +# fmt: off keyboard.keymap = [ [ #QWERTY KC.Q, KC.W, KC.E, KC.R, KC.T, KC.Y, KC.U, KC.I, KC.O, KC.P, @@ -47,6 +49,7 @@ _______, _______, _______, _______, KC.DEL, _______, _______, _______, _______, _______ ] ] +# fmt: on -if __name__ == '__main__': +if __name__ == "__main__": keyboard.go() diff --git a/boards/sofle/sofleV2/kb.py b/boards/sofle/sofleV2/kb.py index 3dbb9f512..524a7f1c1 100644 --- a/boards/sofle/sofleV2/kb.py +++ b/boards/sofle/sofleV2/kb.py @@ -10,8 +10,9 @@ class KMKKeyboard(_KMKKeyboard): diode_orientation = DiodeOrientation.COL2ROW encoder_pin_0 = board.A2 encoder_pin_1 = board.A3 - # NOQA + # flake8: noqa + # fmt: off coord_mapping = [ 0, 1, 2, 3, 4, 5, 35, 34, 33, 32, 31, 30, 6, 7, 8, 9, 10, 11, 41, 40, 39, 38, 37, 36, @@ -19,3 +20,4 @@ class KMKKeyboard(_KMKKeyboard): 18, 19, 20, 21, 22, 23, 53, 52, 51, 50, 49, 48, 24, 25, 26, 27, 28, 29, 59, 58, 57, 56, 55, 54 ] + # fmt: on diff --git a/boards/sofle/sofleV2/main.py b/boards/sofle/sofleV2/main.py index ac1b93790..bf7524061 100644 --- a/boards/sofle/sofleV2/main.py +++ b/boards/sofle/sofleV2/main.py @@ -1,5 +1,4 @@ import board - from kb import KMKKeyboard from kmk.keys import KC @@ -36,6 +35,8 @@ LOWER = KC.MO(1) RAISE = KC.MO(2) +# flake8: noqa +# fmt: off keyboard.keymap = [ [ # QWERTY # HERE----# HERE----# HERE----# HERE----# HERE----# HERE----# HERE----#ENCODER--#ENCODER--# HERE----# HERE----# HERE----# HERE----# HERE----# HERE----# HERE---- @@ -62,6 +63,7 @@ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, ] ] +# fmt: on encoder_handler = EncoderHandler() encoder_handler.pins = ((keyboard.encoder_pin_1, keyboard.encoder_pin_0, None, False),) @@ -73,5 +75,5 @@ keyboard.modules.append(encoder_handler) -if __name__ == '__main__': +if __name__ == "__main__": keyboard.go() diff --git a/boards/tg4x/main.py b/boards/tg4x/main.py index 96dc9061f..0aced49a8 100644 --- a/boards/tg4x/main.py +++ b/boards/tg4x/main.py @@ -11,13 +11,22 @@ XXXXXXX = KC.NO # Adding extensions -rgb = RGB(pixel_pin=keyboard.rgb_pixel_pin, num_pixels=keyboard.rgb_num_pixels, val_limit=100, hue_default=190, sat_default=100, val_default=5) +rgb = RGB( + pixel_pin=keyboard.rgb_pixel_pin, + num_pixels=keyboard.rgb_num_pixels, + val_limit=100, + hue_default=190, + sat_default=100, + val_default=5, +) layers_ext = Layers() keyboard.modules = [layers_ext] keyboard.extensions = [rgb] +# flake8: noqa +# fmt: off keyboard.keymap = [ [ #QWERTY KC.ESC, KC.Q, KC.W, KC.E, KC.R, KC.T, KC.Y, KC.U, KC.I, KC.O, KC.P, KC.MINS, KC.DEL,\ @@ -32,6 +41,7 @@ _______, _______, _______, _______, _______, _______, _______, _______, _______ ], ] +# fmt: on -if __name__ == '__main__': +if __name__ == "__main__": keyboard.go() diff --git a/kmk/extensions/__init__.py b/kmk/extensions/__init__.py index 1eba5e519..d115e22f8 100644 --- a/kmk/extensions/__init__.py +++ b/kmk/extensions/__init__.py @@ -27,15 +27,15 @@ def during_bootup(self, keyboard): raise NotImplementedError def before_matrix_scan(self, keyboard): - ''' + """ Return value will be injected as an extra matrix update - ''' + """ raise NotImplementedError def after_matrix_scan(self, keyboard): - ''' + """ Return value will be replace matrix update if supplied - ''' + """ raise NotImplementedError def before_hid_send(self, keyboard): diff --git a/kmk/extensions/international.py b/kmk/extensions/international.py index eab8087f7..1778728b7 100644 --- a/kmk/extensions/international.py +++ b/kmk/extensions/international.py @@ -1,35 +1,35 @@ -'''Adds international keys''' +"""Adds international keys""" from kmk.extensions import Extension from kmk.keys import make_key class International(Extension): - '''Adds international keys''' + """Adds international keys""" def __init__(self): # International - make_key(code=50, names=('NONUS_HASH', 'NUHS')) - make_key(code=100, names=('NONUS_BSLASH', 'NUBS')) - make_key(code=101, names=('APP', 'APPLICATION', 'SEL', 'WINMENU')) - - make_key(code=135, names=('INT1', 'RO')) - make_key(code=136, names=('INT2', 'KANA')) - make_key(code=137, names=('INT3', 'JYEN')) - make_key(code=138, names=('INT4', 'HENK')) - make_key(code=139, names=('INT5', 'MHEN')) - make_key(code=140, names=('INT6',)) - make_key(code=141, names=('INT7',)) - make_key(code=142, names=('INT8',)) - make_key(code=143, names=('INT9',)) - make_key(code=144, names=('LANG1', 'HAEN')) - make_key(code=145, names=('LANG2', 'HAEJ')) - make_key(code=146, names=('LANG3',)) - make_key(code=147, names=('LANG4',)) - make_key(code=148, names=('LANG5',)) - make_key(code=149, names=('LANG6',)) - make_key(code=150, names=('LANG7',)) - make_key(code=151, names=('LANG8',)) - make_key(code=152, names=('LANG9',)) + make_key(code=50, names=("NONUS_HASH", "NUHS")) + make_key(code=100, names=("NONUS_BSLASH", "NUBS")) + make_key(code=101, names=("APP", "APPLICATION", "SEL", "WINMENU")) + + make_key(code=135, names=("INT1", "RO")) + make_key(code=136, names=("INT2", "KANA")) + make_key(code=137, names=("INT3", "JYEN")) + make_key(code=138, names=("INT4", "HENK")) + make_key(code=139, names=("INT5", "MHEN")) + make_key(code=140, names=("INT6",)) + make_key(code=141, names=("INT7",)) + make_key(code=142, names=("INT8",)) + make_key(code=143, names=("INT9",)) + make_key(code=144, names=("LANG1", "HAEN")) + make_key(code=145, names=("LANG2", "HAEJ")) + make_key(code=146, names=("LANG3",)) + make_key(code=147, names=("LANG4",)) + make_key(code=148, names=("LANG5",)) + make_key(code=149, names=("LANG6",)) + make_key(code=150, names=("LANG7",)) + make_key(code=151, names=("LANG8",)) + make_key(code=152, names=("LANG9",)) def on_runtime_enable(self, sandbox): return diff --git a/kmk/extensions/led.py b/kmk/extensions/led.py index 4cd8b2c46..a072c83e2 100644 --- a/kmk/extensions/led.py +++ b/kmk/extensions/led.py @@ -1,6 +1,7 @@ -import pwmio from math import e, exp, pi, sin +import pwmio + from kmk.extensions import Extension, InvalidExtensionEnvironment from kmk.keys import make_argumented_key, make_key from kmk.utils import clamp @@ -43,7 +44,7 @@ def __init__( except Exception as e: print(e) raise InvalidExtensionEnvironment( - 'Unable to create pwmio.PWMOut() instance with provided led_pin' + "Unable to create pwmio.PWMOut() instance with provided led_pin" ) self._brightness = brightness @@ -62,47 +63,47 @@ def __init__( self.user_animation = user_animation make_argumented_key( - names=('LED_TOG',), + names=("LED_TOG",), validator=self._led_key_validator, on_press=self._key_led_tog, ) make_argumented_key( - names=('LED_INC',), + names=("LED_INC",), validator=self._led_key_validator, on_press=self._key_led_inc, ) make_argumented_key( - names=('LED_DEC',), + names=("LED_DEC",), validator=self._led_key_validator, on_press=self._key_led_dec, ) make_argumented_key( - names=('LED_SET',), + names=("LED_SET",), validator=self._led_set_key_validator, on_press=self._key_led_set, ) - make_key(names=('LED_ANI',), on_press=self._key_led_ani) - make_key(names=('LED_AND',), on_press=self._key_led_and) + make_key(names=("LED_ANI",), on_press=self._key_led_ani) + make_key(names=("LED_AND",), on_press=self._key_led_and) make_key( - names=('LED_MODE_PLAIN', 'LED_M_P'), on_press=self._key_led_mode_static + names=("LED_MODE_PLAIN", "LED_M_P"), on_press=self._key_led_mode_static ) make_key( - names=('LED_MODE_BREATHE', 'LED_M_B'), on_press=self._key_led_mode_breathe + names=("LED_MODE_BREATHE", "LED_M_B"), on_press=self._key_led_mode_breathe ) def __repr__(self): - return f'LED({self._to_dict()})' + return f"LED({self._to_dict()})" def _to_dict(self): return { - '_brightness': self._brightness, - '_pos': self._pos, - 'brightness_step': self.brightness_step, - 'brightness_limit': self.brightness_limit, - 'animation_mode': self.animation_mode, - 'animation_speed': self.animation_speed, - 'breathe_center': self.breathe_center, - 'val': self.val, + "_brightness": self._brightness, + "_pos": self._pos, + "brightness_step": self.brightness_step, + "brightness_limit": self.brightness_limit, + "animation_mode": self.animation_mode, + "animation_speed": self.animation_speed, + "breathe_center": self.breathe_center, + "val": self.val, } def on_runtime_enable(self, sandbox): @@ -164,20 +165,20 @@ def off(self): self.set_brightness(0) def increase_ani(self): - ''' + """ Increases animation speed by 1 amount stopping at 10 :param step: - ''' + """ if (self.animation_speed + 1) >= 10: self.animation_speed = 10 else: self.val += 1 def decrease_ani(self): - ''' + """ Decreases animation speed by 1 amount stopping at 0 :param step: - ''' + """ if (self.val - 1) <= 0: self.val = 0 else: @@ -200,10 +201,10 @@ def effect_static(self): self.animation_mode = None def animate(self): - ''' + """ Activates a "step" in the animation based on the active mode :return: Returns the new state in animation - ''' + """ if self._effect_init: self._init_effect() if self._enabled: diff --git a/kmk/extensions/lock_status.py b/kmk/extensions/lock_status.py index d081ddc6c..be645623b 100644 --- a/kmk/extensions/lock_status.py +++ b/kmk/extensions/lock_status.py @@ -23,7 +23,7 @@ def __init__(self): self.hid = device def __repr__(self): - return f'LockStatus(report={self.report})' + return f"LockStatus(report={self.report})" def during_bootup(self, sandbox): return diff --git a/kmk/extensions/media_keys.py b/kmk/extensions/media_keys.py index 309a00a20..811b5daad 100644 --- a/kmk/extensions/media_keys.py +++ b/kmk/extensions/media_keys.py @@ -9,25 +9,25 @@ def __init__(self): # incorrect, conflicting with each other, or otherwise 'weird'. We'll add them # back in piecemeal as needed. PRs welcome. # - # A super useful reference for these is http://www.freebsddiary.org/APC/usb_hid_usages.php + # Ref: http://www.freebsddiary.org/APC/usb_hid_usages.php # Note that currently we only have the PC codes. Recent MacOS versions seem to # support PC media keys, so I don't know how much value we would get out of # adding the old Apple-specific consumer codes, but again, PRs welcome if the # lack of them impacts you. - make_consumer_key(code=226, names=('AUDIO_MUTE', 'MUTE')) # 0xE2 - make_consumer_key(code=233, names=('AUDIO_VOL_UP', 'VOLU')) # 0xE9 - make_consumer_key(code=234, names=('AUDIO_VOL_DOWN', 'VOLD')) # 0xEA - make_consumer_key(code=111, names=('BRIGHTNESS_UP', 'BRIU')) # 0x6F - make_consumer_key(code=112, names=('BRIGHTNESS_DOWN', 'BRID')) # 0x70 - make_consumer_key(code=181, names=('MEDIA_NEXT_TRACK', 'MNXT')) # 0xB5 - make_consumer_key(code=182, names=('MEDIA_PREV_TRACK', 'MPRV')) # 0xB6 - make_consumer_key(code=183, names=('MEDIA_STOP', 'MSTP')) # 0xB7 + make_consumer_key(code=226, names=("AUDIO_MUTE", "MUTE")) # 0xE2 + make_consumer_key(code=233, names=("AUDIO_VOL_UP", "VOLU")) # 0xE9 + make_consumer_key(code=234, names=("AUDIO_VOL_DOWN", "VOLD")) # 0xEA + make_consumer_key(code=111, names=("BRIGHTNESS_UP", "BRIU")) # 0x6F + make_consumer_key(code=112, names=("BRIGHTNESS_DOWN", "BRID")) # 0x70 + make_consumer_key(code=181, names=("MEDIA_NEXT_TRACK", "MNXT")) # 0xB5 + make_consumer_key(code=182, names=("MEDIA_PREV_TRACK", "MPRV")) # 0xB6 + make_consumer_key(code=183, names=("MEDIA_STOP", "MSTP")) # 0xB7 make_consumer_key( - code=205, names=('MEDIA_PLAY_PAUSE', 'MPLY') + code=205, names=("MEDIA_PLAY_PAUSE", "MPLY") ) # 0xCD (this may not be right) - make_consumer_key(code=184, names=('MEDIA_EJECT', 'EJCT')) # 0xB8 - make_consumer_key(code=179, names=('MEDIA_FAST_FORWARD', 'MFFD')) # 0xB3 - make_consumer_key(code=180, names=('MEDIA_REWIND', 'MRWD')) # 0xB4 + make_consumer_key(code=184, names=("MEDIA_EJECT", "EJCT")) # 0xB8 + make_consumer_key(code=179, names=("MEDIA_FAST_FORWARD", "MFFD")) # 0xB3 + make_consumer_key(code=180, names=("MEDIA_REWIND", "MRWD")) # 0xB4 def on_runtime_enable(self, sandbox): return diff --git a/kmk/extensions/peg_oled_display.py b/kmk/extensions/peg_oled_display.py index 389ae4df1..f15315c2b 100644 --- a/kmk/extensions/peg_oled_display.py +++ b/kmk/extensions/peg_oled_display.py @@ -1,7 +1,7 @@ -import busio import gc import adafruit_displayio_ssd1306 +import busio import displayio import terminalio from adafruit_display_text import label @@ -53,7 +53,8 @@ def __init__( gc.collect() def returnCurrectRenderText(self, layer, singleView): - # for now we only have static things and react to layers. But when we react to battery % and wpm we can handle the logic here + # for now we only have static things and react to layers. But when we react to \ + # battery % and wpm we can handle the logic here if singleView[0] == OledReactionType.STATIC: return singleView[1][0] if singleView[0] == OledReactionType.LAYER: @@ -104,7 +105,7 @@ def renderOledImgLayer(self, layer): splash = displayio.Group() self._display.show(splash) odb = displayio.OnDiskBitmap( - '/' + self.returnCurrectRenderText(layer, self._views[0]) + "/" + self.returnCurrectRenderText(layer, self._views[0]) ) image = displayio.TileGrid(odb, pixel_shader=odb.pixel_shader) splash.append(image) diff --git a/kmk/extensions/peg_rgb_matrix.py b/kmk/extensions/peg_rgb_matrix.py index 6bad5a02e..483cd70ee 100644 --- a/kmk/extensions/peg_rgb_matrix.py +++ b/kmk/extensions/peg_rgb_matrix.py @@ -1,5 +1,4 @@ import neopixel - from storage import getmount from kmk.extensions import Extension @@ -23,10 +22,10 @@ class Color: class Rgb_matrix_data: def __init__(self, keys=[], underglow=[]): if len(keys) == 0: - print('No colors passed for your keys') + print("No colors passed for your keys") return if len(underglow) == 0: - print('No colors passed for your underglow') + print("No colors passed for your underglow") return self.data = keys + underglow @@ -36,7 +35,7 @@ def generate_led_map( ): keys = [key_color] * number_of_keys underglow = [underglow_color] * number_of_underglow - print(f'Rgb_matrix_data(keys={keys},\nunderglow={underglow})') + print(f"Rgb_matrix_data(keys={keys},\nunderglow={underglow})") class Rgb_matrix(Extension): @@ -48,14 +47,14 @@ def __init__( split=False, rightSide=False, ): - name = str(getmount('/').label) + name = str(getmount("/").label) self.rgb_order = rgb_order self.disable_auto_write = disable_auto_write self.split = split self.rightSide = rightSide - if name.endswith('L'): + if name.endswith("L"): self.rightSide = False - elif name.endswith('R'): + elif name.endswith("R"): self.rightSide = True if type(ledDisplay) is Rgb_matrix_data: self.ledDisplay = ledDisplay.data @@ -63,7 +62,7 @@ def __init__( self.ledDisplay = ledDisplay make_key( - names=('RGB_TOG',), on_press=self._rgb_tog, on_release=handler_passthrough + names=("RGB_TOG",), on_press=self._rgb_tog, on_release=handler_passthrough ) def _rgb_tog(self, *args, **kwargs): diff --git a/kmk/extensions/rgb.py b/kmk/extensions/rgb.py index c45bffa02..89aeeb190 100644 --- a/kmk/extensions/rgb.py +++ b/kmk/extensions/rgb.py @@ -1,6 +1,7 @@ -from adafruit_pixelbuf import PixelBuf from math import e, exp, pi, sin +from adafruit_pixelbuf import PixelBuf + from kmk.extensions import Extension from kmk.handlers.stock import passthrough as handler_passthrough from kmk.keys import make_key @@ -11,13 +12,13 @@ def hsv_to_rgb(hue, sat, val): - ''' + """ Converts HSV values, and returns a tuple of RGB values :param hue: :param sat: :param val: :return: (r, g, b) - ''' + """ if sat == 0: return (val, val, val) @@ -58,13 +59,13 @@ def hsv_to_rgb(hue, sat, val): def hsv_to_rgbw(self, hue, sat, val): - ''' + """ Converts HSV values, and returns a tuple of RGBW values :param hue: :param sat: :param val: :return: (r, g, b, w) - ''' + """ rgb = hsv_to_rgb(hue, sat, val) return rgb[0], rgb[1], rgb[2], min(rgb) @@ -152,64 +153,64 @@ def __init__( self._substep = 0 make_key( - names=('RGB_TOG',), on_press=self._rgb_tog, on_release=handler_passthrough + names=("RGB_TOG",), on_press=self._rgb_tog, on_release=handler_passthrough ) make_key( - names=('RGB_HUI',), on_press=self._rgb_hui, on_release=handler_passthrough + names=("RGB_HUI",), on_press=self._rgb_hui, on_release=handler_passthrough ) make_key( - names=('RGB_HUD',), on_press=self._rgb_hud, on_release=handler_passthrough + names=("RGB_HUD",), on_press=self._rgb_hud, on_release=handler_passthrough ) make_key( - names=('RGB_SAI',), on_press=self._rgb_sai, on_release=handler_passthrough + names=("RGB_SAI",), on_press=self._rgb_sai, on_release=handler_passthrough ) make_key( - names=('RGB_SAD',), on_press=self._rgb_sad, on_release=handler_passthrough + names=("RGB_SAD",), on_press=self._rgb_sad, on_release=handler_passthrough ) make_key( - names=('RGB_VAI',), on_press=self._rgb_vai, on_release=handler_passthrough + names=("RGB_VAI",), on_press=self._rgb_vai, on_release=handler_passthrough ) make_key( - names=('RGB_VAD',), on_press=self._rgb_vad, on_release=handler_passthrough + names=("RGB_VAD",), on_press=self._rgb_vad, on_release=handler_passthrough ) make_key( - names=('RGB_ANI',), on_press=self._rgb_ani, on_release=handler_passthrough + names=("RGB_ANI",), on_press=self._rgb_ani, on_release=handler_passthrough ) make_key( - names=('RGB_AND',), on_press=self._rgb_and, on_release=handler_passthrough + names=("RGB_AND",), on_press=self._rgb_and, on_release=handler_passthrough ) make_key( - names=('RGB_MODE_PLAIN', 'RGB_M_P'), + names=("RGB_MODE_PLAIN", "RGB_M_P"), on_press=self._rgb_mode_static, on_release=handler_passthrough, ) make_key( - names=('RGB_MODE_BREATHE', 'RGB_M_B'), + names=("RGB_MODE_BREATHE", "RGB_M_B"), on_press=self._rgb_mode_breathe, on_release=handler_passthrough, ) make_key( - names=('RGB_MODE_RAINBOW', 'RGB_M_R'), + names=("RGB_MODE_RAINBOW", "RGB_M_R"), on_press=self._rgb_mode_rainbow, on_release=handler_passthrough, ) make_key( - names=('RGB_MODE_BREATHE_RAINBOW', 'RGB_M_BR'), + names=("RGB_MODE_BREATHE_RAINBOW", "RGB_M_BR"), on_press=self._rgb_mode_breathe_rainbow, on_release=handler_passthrough, ) make_key( - names=('RGB_MODE_SWIRL', 'RGB_M_S'), + names=("RGB_MODE_SWIRL", "RGB_M_S"), on_press=self._rgb_mode_swirl, on_release=handler_passthrough, ) make_key( - names=('RGB_MODE_KNIGHT', 'RGB_M_K'), + names=("RGB_MODE_KNIGHT", "RGB_M_K"), on_press=self._rgb_mode_knight, on_release=handler_passthrough, ) make_key( - names=('RGB_RESET', 'RGB_RST'), + names=("RGB_RESET", "RGB_RST"), on_press=self._rgb_reset, on_release=handler_passthrough, ) @@ -242,36 +243,36 @@ def on_powersave_disable(self, sandbox): self._do_update() def set_hsv(self, hue, sat, val, index): - ''' + """ Takes HSV values and displays it on a single LED/Neopixel :param hue: :param sat: :param val: :param index: Index of LED/Pixel - ''' + """ if self.rgbw: self.set_rgb(hsv_to_rgbw(hue, sat, val), index) else: self.set_rgb(hsv_to_rgb(hue, sat, val), index) def set_hsv_fill(self, hue, sat, val): - ''' + """ Takes HSV values and displays it on all LEDs/Neopixels :param hue: :param sat: :param val: - ''' + """ if self.rgbw: self.set_rgb_fill(hsv_to_rgbw(hue, sat, val)) else: self.set_rgb_fill(hsv_to_rgb(hue, sat, val)) def set_rgb(self, rgb, index): - ''' + """ Takes an RGB or RGBW and displays it on a single LED/Neopixel :param rgb: RGB or RGBW :param index: Index of LED/Pixel - ''' + """ if 0 <= index <= self.num_pixels - 1: for pixels in self.pixels: if index <= (len(pixels) - 1): @@ -283,20 +284,20 @@ def set_rgb(self, rgb, index): pixels.show() def set_rgb_fill(self, rgb): - ''' + """ Takes an RGB or RGBW and displays it on all LEDs/Neopixels :param rgb: RGB or RGBW - ''' + """ for pixels in self.pixels: pixels.fill(rgb) if not self.disable_auto_write: pixels.show() def increase_hue(self, step=None): - ''' + """ Increases hue by step amount rolling at 256 and returning to 0 :param step: - ''' + """ if step is None: step = self.hue_step @@ -306,10 +307,10 @@ def increase_hue(self, step=None): self._do_update() def decrease_hue(self, step=None): - ''' + """ Decreases hue by step amount rolling at 0 and returning to 256 :param step: - ''' + """ if step is None: step = self.hue_step @@ -322,10 +323,10 @@ def decrease_hue(self, step=None): self._do_update() def increase_sat(self, step=None): - ''' + """ Increases saturation by step amount stopping at 255 :param step: - ''' + """ if step is None: step = self.sat_step @@ -335,10 +336,10 @@ def increase_sat(self, step=None): self._do_update() def decrease_sat(self, step=None): - ''' + """ Decreases saturation by step amount stopping at 0 :param step: - ''' + """ if step is None: step = self.sat_step @@ -348,10 +349,10 @@ def decrease_sat(self, step=None): self._do_update() def increase_val(self, step=None): - ''' + """ Increases value by step amount stopping at 100 :param step: - ''' + """ if step is None: step = self.val_step @@ -361,10 +362,10 @@ def increase_val(self, step=None): self._do_update() def decrease_val(self, step=None): - ''' + """ Decreases value by step amount stopping at 0 :param step: - ''' + """ if step is None: step = self.val_step @@ -374,43 +375,43 @@ def decrease_val(self, step=None): self._do_update() def increase_ani(self): - ''' + """ Increases animation speed by 1 amount stopping at 10 :param step: - ''' + """ self.animation_speed = clamp(self.animation_speed + 1, 0, 10) if self._check_update(): self._do_update() def decrease_ani(self): - ''' + """ Decreases animation speed by 1 amount stopping at 0 :param step: - ''' + """ self.animation_speed = clamp(self.animation_speed - 1, 0, 10) if self._check_update(): self._do_update() def off(self): - ''' + """ Turns off all LEDs/Neopixels without changing stored values - ''' + """ self.set_hsv_fill(0, 0, 0) def show(self): - ''' + """ Turns on all LEDs/Neopixels without changing stored values - ''' + """ for pixels in self.pixels: pixels.show() def animate(self): - ''' + """ Activates a "step" in the animation based on the active mode :return: Returns the new state in animation - ''' + """ if self.effect_init: self._init_effect() diff --git a/kmk/extensions/statusled.py b/kmk/extensions/statusled.py index fa5e7936e..741b18f5c 100644 --- a/kmk/extensions/statusled.py +++ b/kmk/extensions/statusled.py @@ -1,8 +1,9 @@ # Use this extension for showing layer status with three leds -import pwmio import time +import pwmio + from kmk.extensions import Extension, InvalidExtensionEnvironment from kmk.keys import make_key @@ -22,7 +23,7 @@ def __init__( except Exception as e: print(e) raise InvalidExtensionEnvironment( - 'Unable to create pulseio.PWMOut() instance with provided led_pin' + "Unable to create pulseio.PWMOut() instance with provided led_pin" ) self._led_count = len(self._leds) @@ -32,11 +33,11 @@ def __init__( self.brightness_step = brightness_step self.brightness_limit = brightness_limit - make_key(names=('SLED_INC',), on_press=self._key_led_inc) - make_key(names=('SLED_DEC',), on_press=self._key_led_dec) + make_key(names=("SLED_INC",), on_press=self._key_led_inc) + make_key(names=("SLED_DEC",), on_press=self._key_led_dec) def _layer_indicator(self, layer_active, *args, **kwargs): - ''' + """ Indicates layer with leds For the time being just a simple consecutive single led @@ -44,7 +45,7 @@ def _layer_indicator(self, layer_active, *args, **kwargs): wraps around to the first led again. (Also works for a single led, which just lights when any layer is active) - ''' + """ if self._layer_last != layer_active: led_last = 0 if self._layer_last == 0 else 1 + (self._layer_last - 1) % 3 @@ -57,13 +58,13 @@ def _layer_indicator(self, layer_active, *args, **kwargs): self._layer_last = layer_active def __repr__(self): - return f'SLED({self._to_dict()})' + return f"SLED({self._to_dict()})" def _to_dict(self): return { - '_brightness': self.brightness, - 'brightness_step': self.brightness_step, - 'brightness_limit': self.brightness_limit, + "_brightness": self.brightness, + "brightness_step": self.brightness_step, + "brightness_limit": self.brightness_limit, } def on_runtime_enable(self, sandbox): @@ -73,7 +74,7 @@ def on_runtime_disable(self, sandbox): return def during_bootup(self, sandbox): - '''Light up every single led once for 200 ms''' + """Light up every single led once for 200 ms""" for i in range(self._led_count + 2): if i < self._led_count: self._leds[i].duty_cycle = int(self.brightness / 100 * 65535) diff --git a/kmk/handlers/sequences.py b/kmk/handlers/sequences.py index 936c17ef0..cec03c2fb 100644 --- a/kmk/handlers/sequences.py +++ b/kmk/handlers/sequences.py @@ -18,10 +18,10 @@ def sequence_press_handler(key, keyboard, KC, *args, **kwargs): keyboard.keys_pressed = set() for ikey in key.meta.seq: - if not getattr(ikey, 'no_press', None): + if not getattr(ikey, "no_press", None): keyboard.process_key(ikey, True) keyboard._send_hid() - if not getattr(ikey, 'no_release', None): + if not getattr(ikey, "no_release", None): keyboard.process_key(ikey, False) keyboard._send_hid() @@ -61,11 +61,11 @@ def send_string(message): def compile_unicode_string_sequences(string_table): - ''' + """ Destructively convert ("compile") unicode strings into key sequences. This will, for RAM saving reasons, empty the input dictionary and trigger garbage collection. - ''' + """ target = AttrDict() for k, v in string_table.items(): @@ -81,10 +81,10 @@ def compile_unicode_string_sequences(string_table): def unicode_string_sequence(unistring): - ''' + """ Allows sending things like (╯°□°)╯︵ ┻━┻ directly, without manual conversion to Unicode codepoints. - ''' + """ return unicode_codepoint_sequence([hex(get_wide_ordinal(s))[2:] for s in unistring]) @@ -142,12 +142,12 @@ def _ibus_unicode_sequence(kc_macros, keyboard): def _winc_unicode_sequence(kc_macros, keyboard): - ''' + """ Send unicode sequence using WinCompose: http://wincompose.info/ https://github.com/SamHocevar/wincompose - ''' + """ for kc_macro in kc_macros: yield RALT_KEY yield U_KEY diff --git a/kmk/handlers/stock.py b/kmk/handlers/stock.py index 124b48f12..fd0d32e39 100644 --- a/kmk/handlers/stock.py +++ b/kmk/handlers/stock.py @@ -41,9 +41,9 @@ def bootloader(*args, **kwargs): def debug_pressed(key, keyboard, KC, *args, **kwargs): if keyboard.debug_enabled: - print('DebugDisable()') + print("DebugDisable()") else: - print('DebugEnable()') + print("DebugEnable()") keyboard.debug_enabled = not keyboard.debug_enabled diff --git a/kmk/hid.py b/kmk/hid.py index 219d06f28..ceb7ea42c 100644 --- a/kmk/hid.py +++ b/kmk/hid.py @@ -1,7 +1,7 @@ -import supervisor -import usb_hid from micropython import const +import supervisor +import usb_hid from storage import getmount from kmk.keys import FIRST_KMK_INTERNAL_KEY, ConsumerKey, ModifierKey @@ -71,7 +71,7 @@ def __init__(self, **kwargs): self.post_init() def __repr__(self): - return f'{self.__class__.__name__}(REPORT_BYTES={self.REPORT_BYTES})' + return f"{self.__class__.__name__}(REPORT_BYTES={self.REPORT_BYTES})" def post_init(self): pass @@ -246,7 +246,7 @@ class BLEHID(AbstractHID): # Hardcoded in CPy MAX_CONNECTIONS = const(2) - def __init__(self, ble_name=str(getmount('/').label), **kwargs): + def __init__(self, ble_name=str(getmount("/").label), **kwargs): self.ble_name = ble_name super().__init__() @@ -266,15 +266,15 @@ def post_init(self): @property def devices(self): - '''Search through the provided list of devices to find the ones with the - send_report attribute.''' + """Search through the provided list of devices to find the ones with the + send_report attribute.""" if not self.ble.connected: return {} result = {} for device in self.hid.devices: - if not hasattr(device, 'send_report'): + if not hasattr(device, "send_report"): continue us = device.usage up = device.usage_page diff --git a/kmk/keys.py b/kmk/keys.py index c5bfeebf1..f35d071c7 100644 --- a/kmk/keys.py +++ b/kmk/keys.py @@ -13,10 +13,10 @@ KEY_MODIFIER = const(1) KEY_CONSUMER = const(2) -ALL_ALPHAS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' -ALL_NUMBERS = '1234567890' +ALL_ALPHAS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" +ALL_NUMBERS = "1234567890" # since KC.1 isn't valid Python, alias to KC.N1 -ALL_NUMBER_ALIASES = tuple(f'N{x}' for x in ALL_NUMBERS) +ALL_NUMBER_ALIASES = tuple(f"N{x}" for x in ALL_NUMBERS) debug = Debug(__name__) @@ -49,8 +49,8 @@ def maybe_make_no_key(candidate): # the state, but are tracked semantically separately, so create # two keys with the exact same functionality keys = ( - ('NO', 'XXXXXXX'), - ('TRANSPARENT', 'TRNS'), + ("NO", "XXXXXXX"), + ("TRANSPARENT", "TRNS"), ) for names in keys: @@ -91,16 +91,16 @@ def maybe_make_mod_key(candidate): # MEH = LCTL | LALT | LSFT # HYPR = LCTL | LALT | LSFT | LGUI mods = ( - (0x01, ('LEFT_CONTROL', 'LCTRL', 'LCTL')), - (0x02, ('LEFT_SHIFT', 'LSHIFT', 'LSFT')), - (0x04, ('LEFT_ALT', 'LALT', 'LOPT')), - (0x08, ('LEFT_SUPER', 'LGUI', 'LCMD', 'LWIN')), - (0x10, ('RIGHT_CONTROL', 'RCTRL', 'RCTL')), - (0x20, ('RIGHT_SHIFT', 'RSHIFT', 'RSFT')), - (0x40, ('RIGHT_ALT', 'RALT', 'ROPT')), - (0x80, ('RIGHT_SUPER', 'RGUI', 'RCMD', 'RWIN')), - (0x07, ('MEH',)), - (0x0F, ('HYPER', 'HYPR')), + (0x01, ("LEFT_CONTROL", "LCTRL", "LCTL")), + (0x02, ("LEFT_SHIFT", "LSHIFT", "LSFT")), + (0x04, ("LEFT_ALT", "LALT", "LOPT")), + (0x08, ("LEFT_SUPER", "LGUI", "LCMD", "LWIN")), + (0x10, ("RIGHT_CONTROL", "RCTRL", "RCTL")), + (0x20, ("RIGHT_SHIFT", "RSHIFT", "RSFT")), + (0x40, ("RIGHT_ALT", "RALT", "ROPT")), + (0x80, ("RIGHT_SUPER", "RGUI", "RCMD", "RWIN")), + (0x07, ("MEH",)), + (0x0F, ("HYPER", "HYPR")), ) for code, names in mods: @@ -110,22 +110,22 @@ def maybe_make_mod_key(candidate): def maybe_make_more_ascii(candidate): codes = ( - (40, ('ENTER', 'ENT', '\n')), - (41, ('ESCAPE', 'ESC')), - (42, ('BACKSPACE', 'BSPACE', 'BSPC', 'BKSP')), - (43, ('TAB', '\t')), - (44, ('SPACE', 'SPC', ' ')), - (45, ('MINUS', 'MINS', '-')), - (46, ('EQUAL', 'EQL', '=')), - (47, ('LBRACKET', 'LBRC', '[')), - (48, ('RBRACKET', 'RBRC', ']')), - (49, ('BACKSLASH', 'BSLASH', 'BSLS', '\\')), - (51, ('SEMICOLON', 'SCOLON', 'SCLN', ';')), - (52, ('QUOTE', 'QUOT', "'")), - (53, ('GRAVE', 'GRV', 'ZKHK', '`')), - (54, ('COMMA', 'COMM', ',')), - (55, ('DOT', '.')), - (56, ('SLASH', 'SLSH', '/')), + (40, ("ENTER", "ENT", "\n")), + (41, ("ESCAPE", "ESC")), + (42, ("BACKSPACE", "BSPACE", "BSPC", "BKSP")), + (43, ("TAB", "\t")), + (44, ("SPACE", "SPC", " ")), + (45, ("MINUS", "MINS", "-")), + (46, ("EQUAL", "EQL", "=")), + (47, ("LBRACKET", "LBRC", "[")), + (48, ("RBRACKET", "RBRC", "]")), + (49, ("BACKSLASH", "BSLASH", "BSLS", "\\")), + (51, ("SEMICOLON", "SCOLON", "SCLN", ";")), + (52, ("QUOTE", "QUOT", "'")), + (53, ("GRAVE", "GRV", "ZKHK", "`")), + (54, ("COMMA", "COMM", ",")), + (55, ("DOT", ".")), + (56, ("SLASH", "SLSH", "/")), ) for code, names in codes: @@ -135,30 +135,30 @@ def maybe_make_more_ascii(candidate): def maybe_make_fn_key(candidate): codes = ( - (58, ('F1',)), - (59, ('F2',)), - (60, ('F3',)), - (61, ('F4',)), - (62, ('F5',)), - (63, ('F6',)), - (64, ('F7',)), - (65, ('F8',)), - (66, ('F9',)), - (67, ('F10',)), - (68, ('F11',)), - (69, ('F12',)), - (104, ('F13',)), - (105, ('F14',)), - (106, ('F15',)), - (107, ('F16',)), - (108, ('F17',)), - (109, ('F18',)), - (110, ('F19',)), - (111, ('F20',)), - (112, ('F21',)), - (113, ('F22',)), - (114, ('F23',)), - (115, ('F24',)), + (58, ("F1",)), + (59, ("F2",)), + (60, ("F3",)), + (61, ("F4",)), + (62, ("F5",)), + (63, ("F6",)), + (64, ("F7",)), + (65, ("F8",)), + (66, ("F9",)), + (67, ("F10",)), + (68, ("F11",)), + (69, ("F12",)), + (104, ("F13",)), + (105, ("F14",)), + (106, ("F15",)), + (107, ("F16",)), + (108, ("F17",)), + (109, ("F18",)), + (110, ("F19",)), + (111, ("F20",)), + (112, ("F21",)), + (113, ("F22",)), + (114, ("F23",)), + (115, ("F24",)), ) for code, names in codes: @@ -168,26 +168,26 @@ def maybe_make_fn_key(candidate): def maybe_make_navlock_key(candidate): codes = ( - (57, ('CAPS_LOCK', 'CAPSLOCK', 'CLCK', 'CAPS')), + (57, ("CAPS_LOCK", "CAPSLOCK", "CLCK", "CAPS")), # FIXME: Investigate whether this key actually works, and # uncomment when/if it does. # (130, ('LOCKING_CAPS', 'LCAP')), - (70, ('PRINT_SCREEN', 'PSCREEN', 'PSCR')), - (71, ('SCROLL_LOCK', 'SCROLLLOCK', 'SLCK')), + (70, ("PRINT_SCREEN", "PSCREEN", "PSCR")), + (71, ("SCROLL_LOCK", "SCROLLLOCK", "SLCK")), # FIXME: Investigate whether this key actually works, and # uncomment when/if it does. # (132, ('LOCKING_SCROLL', 'LSCRL')), - (72, ('PAUSE', 'PAUS', 'BRK')), - (73, ('INSERT', 'INS')), - (74, ('HOME',)), - (75, ('PGUP',)), - (76, ('DELETE', 'DEL')), - (77, ('END',)), - (78, ('PGDOWN', 'PGDN')), - (79, ('RIGHT', 'RGHT')), - (80, ('LEFT',)), - (81, ('DOWN',)), - (82, ('UP',)), + (72, ("PAUSE", "PAUS", "BRK")), + (73, ("INSERT", "INS")), + (74, ("HOME",)), + (75, ("PGUP",)), + (76, ("DELETE", "DEL")), + (77, ("END",)), + (78, ("PGDOWN", "PGDN")), + (79, ("RIGHT", "RGHT")), + (80, ("LEFT",)), + (81, ("DOWN",)), + (82, ("UP",)), ) for code, names in codes: @@ -197,26 +197,26 @@ def maybe_make_navlock_key(candidate): def maybe_make_numpad_key(candidate): codes = ( - (83, ('NUM_LOCK', 'NUMLOCK', 'NLCK')), - (84, ('KP_SLASH', 'NUMPAD_SLASH', 'PSLS')), - (85, ('KP_ASTERISK', 'NUMPAD_ASTERISK', 'PAST')), - (86, ('KP_MINUS', 'NUMPAD_MINUS', 'PMNS')), - (87, ('KP_PLUS', 'NUMPAD_PLUS', 'PPLS')), - (88, ('KP_ENTER', 'NUMPAD_ENTER', 'PENT')), - (89, ('KP_1', 'P1', 'NUMPAD_1')), - (90, ('KP_2', 'P2', 'NUMPAD_2')), - (91, ('KP_3', 'P3', 'NUMPAD_3')), - (92, ('KP_4', 'P4', 'NUMPAD_4')), - (93, ('KP_5', 'P5', 'NUMPAD_5')), - (94, ('KP_6', 'P6', 'NUMPAD_6')), - (95, ('KP_7', 'P7', 'NUMPAD_7')), - (96, ('KP_8', 'P8', 'NUMPAD_8')), - (97, ('KP_9', 'P9', 'NUMPAD_9')), - (98, ('KP_0', 'P0', 'NUMPAD_0')), - (99, ('KP_DOT', 'PDOT', 'NUMPAD_DOT')), - (103, ('KP_EQUAL', 'PEQL', 'NUMPAD_EQUAL')), - (133, ('KP_COMMA', 'PCMM', 'NUMPAD_COMMA')), - (134, ('KP_EQUAL_AS400', 'NUMPAD_EQUAL_AS400')), + (83, ("NUM_LOCK", "NUMLOCK", "NLCK")), + (84, ("KP_SLASH", "NUMPAD_SLASH", "PSLS")), + (85, ("KP_ASTERISK", "NUMPAD_ASTERISK", "PAST")), + (86, ("KP_MINUS", "NUMPAD_MINUS", "PMNS")), + (87, ("KP_PLUS", "NUMPAD_PLUS", "PPLS")), + (88, ("KP_ENTER", "NUMPAD_ENTER", "PENT")), + (89, ("KP_1", "P1", "NUMPAD_1")), + (90, ("KP_2", "P2", "NUMPAD_2")), + (91, ("KP_3", "P3", "NUMPAD_3")), + (92, ("KP_4", "P4", "NUMPAD_4")), + (93, ("KP_5", "P5", "NUMPAD_5")), + (94, ("KP_6", "P6", "NUMPAD_6")), + (95, ("KP_7", "P7", "NUMPAD_7")), + (96, ("KP_8", "P8", "NUMPAD_8")), + (97, ("KP_9", "P9", "NUMPAD_9")), + (98, ("KP_0", "P0", "NUMPAD_0")), + (99, ("KP_DOT", "PDOT", "NUMPAD_DOT")), + (103, ("KP_EQUAL", "PEQL", "NUMPAD_EQUAL")), + (133, ("KP_COMMA", "PCMM", "NUMPAD_COMMA")), + (134, ("KP_EQUAL_AS400", "NUMPAD_EQUAL_AS400")), ) for code, names in codes: @@ -226,27 +226,27 @@ def maybe_make_numpad_key(candidate): def maybe_make_shifted_key(candidate): codes = ( - (30, ('EXCLAIM', 'EXLM', '!')), - (31, ('AT', '@')), - (32, ('HASH', 'POUND', '#')), - (33, ('DOLLAR', 'DLR', '$')), - (34, ('PERCENT', 'PERC', '%')), - (35, ('CIRCUMFLEX', 'CIRC', '^')), - (36, ('AMPERSAND', 'AMPR', '&')), - (37, ('ASTERISK', 'ASTR', '*')), - (38, ('LEFT_PAREN', 'LPRN', '(')), - (39, ('RIGHT_PAREN', 'RPRN', ')')), - (45, ('UNDERSCORE', 'UNDS', '_')), - (46, ('PLUS', '+')), - (47, ('LEFT_CURLY_BRACE', 'LCBR', '{')), - (48, ('RIGHT_CURLY_BRACE', 'RCBR', '}')), - (49, ('PIPE', '|')), - (51, ('COLON', 'COLN', ':')), - (52, ('DOUBLE_QUOTE', 'DQUO', 'DQT', '"')), - (53, ('TILDE', 'TILD', '~')), - (54, ('LEFT_ANGLE_BRACKET', 'LABK', '<')), - (55, ('RIGHT_ANGLE_BRACKET', 'RABK', '>')), - (56, ('QUESTION', 'QUES', '?')), + (30, ("EXCLAIM", "EXLM", "!")), + (31, ("AT", "@")), + (32, ("HASH", "POUND", "#")), + (33, ("DOLLAR", "DLR", "$")), + (34, ("PERCENT", "PERC", "%")), + (35, ("CIRCUMFLEX", "CIRC", "^")), + (36, ("AMPERSAND", "AMPR", "&")), + (37, ("ASTERISK", "ASTR", "*")), + (38, ("LEFT_PAREN", "LPRN", "(")), + (39, ("RIGHT_PAREN", "RPRN", ")")), + (45, ("UNDERSCORE", "UNDS", "_")), + (46, ("PLUS", "+")), + (47, ("LEFT_CURLY_BRACE", "LCBR", "{")), + (48, ("RIGHT_CURLY_BRACE", "RCBR", "}")), + (49, ("PIPE", "|")), + (51, ("COLON", "COLN", ":")), + (52, ("DOUBLE_QUOTE", "DQUO", "DQT", '"')), + (53, ("TILDE", "TILD", "~")), + (54, ("LEFT_ANGLE_BRACKET", "LABK", "<")), + (55, ("RIGHT_ANGLE_BRACKET", "RABK", ">")), + (56, ("QUESTION", "QUES", "?")), ) for code, names in codes: @@ -256,27 +256,27 @@ def maybe_make_shifted_key(candidate): def maybe_make_international_key(candidate): codes = ( - (50, ('NONUS_HASH', 'NUHS')), - (100, ('NONUS_BSLASH', 'NUBS')), - (101, ('APP', 'APPLICATION', 'SEL', 'WINMENU')), - (135, ('INT1', 'RO')), - (136, ('INT2', 'KANA')), - (137, ('INT3', 'JYEN')), - (138, ('INT4', 'HENK')), - (139, ('INT5', 'MHEN')), - (140, ('INT6',)), - (141, ('INT7',)), - (142, ('INT8',)), - (143, ('INT9',)), - (144, ('LANG1', 'HAEN')), - (145, ('LANG2', 'HAEJ')), - (146, ('LANG3',)), - (147, ('LANG4',)), - (148, ('LANG5',)), - (149, ('LANG6',)), - (150, ('LANG7',)), - (151, ('LANG8',)), - (152, ('LANG9',)), + (50, ("NONUS_HASH", "NUHS")), + (100, ("NONUS_BSLASH", "NUBS")), + (101, ("APP", "APPLICATION", "SEL", "WINMENU")), + (135, ("INT1", "RO")), + (136, ("INT2", "KANA")), + (137, ("INT3", "JYEN")), + (138, ("INT4", "HENK")), + (139, ("INT5", "MHEN")), + (140, ("INT6",)), + (141, ("INT7",)), + (142, ("INT8",)), + (143, ("INT9",)), + (144, ("LANG1", "HAEN")), + (145, ("LANG2", "HAEJ")), + (146, ("LANG3",)), + (147, ("LANG4",)), + (148, ("LANG5",)), + (149, ("LANG6",)), + (150, ("LANG7",)), + (151, ("LANG8",)), + (152, ("LANG9",)), ) for code, names in codes: @@ -287,22 +287,22 @@ def maybe_make_international_key(candidate): def maybe_make_unicode_key(candidate): keys = ( ( - ('UC_MODE_NOOP', 'UC_DISABLE'), + ("UC_MODE_NOOP", "UC_DISABLE"), handlers.uc_mode_pressed, UnicodeModeKeyMeta(UnicodeMode.NOOP), ), ( - ('UC_MODE_LINUX', 'UC_MODE_IBUS'), + ("UC_MODE_LINUX", "UC_MODE_IBUS"), handlers.uc_mode_pressed, UnicodeModeKeyMeta(UnicodeMode.IBUS), ), ( - ('UC_MODE_MACOS', 'UC_MODE_OSX', 'US_MODE_RALT'), + ("UC_MODE_MACOS", "UC_MODE_OSX", "US_MODE_RALT"), handlers.uc_mode_pressed, UnicodeModeKeyMeta(UnicodeMode.RALT), ), ( - ('UC_MODE_WINC',), + ("UC_MODE_WINC",), handlers.uc_mode_pressed, UnicodeModeKeyMeta(UnicodeMode.WINC), ), @@ -312,9 +312,9 @@ def maybe_make_unicode_key(candidate): if candidate in names: return make_key(names=names, on_press=handler, meta=meta) - if candidate in ('UC_MODE',): + if candidate in ("UC_MODE",): return make_argumented_key( - names=('UC_MODE',), + names=("UC_MODE",), validator=unicode_mode_key_validator, on_press=handlers.uc_mode_pressed, ) @@ -322,12 +322,12 @@ def maybe_make_unicode_key(candidate): def maybe_make_firmware_key(candidate): keys = ( - ((('BLE_REFRESH',), handlers.ble_refresh)), - ((('BOOTLOADER',), handlers.bootloader)), - ((('DEBUG', 'DBG'), handlers.debug_pressed)), - ((('HID_SWITCH', 'HID'), handlers.hid_switch)), - ((('RELOAD', 'RLD'), handlers.reload)), - ((('RESET',), handlers.reset)), + ((("BLE_REFRESH",), handlers.ble_refresh)), + ((("BOOTLOADER",), handlers.bootloader)), + ((("DEBUG", "DBG"), handlers.debug_pressed)), + ((("HID_SWITCH", "HID"), handlers.hid_switch)), + ((("RELOAD", "RLD"), handlers.reload)), + ((("RESET",), handlers.reset)), ) for names, handler in keys: @@ -342,13 +342,13 @@ def maybe_make_firmware_key(candidate): maybe_make_firmware_key, maybe_make_key( None, - ('BKDL',), + ("BKDL",), on_press=handlers.bkdl_pressed, on_release=handlers.bkdl_released, ), maybe_make_key( None, - ('GESC', 'GRAVE_ESC'), + ("GESC", "GRAVE_ESC"), on_press=handlers.gesc_pressed, on_release=handlers.gesc_released, ), @@ -356,7 +356,7 @@ def maybe_make_firmware_key(candidate): # simple sequence macro. maybe_make_argumented_key( key_seq_sleep_validator, - ('MACRO_SLEEP_MS', 'SLEEP_IN_SEQ'), + ("MACRO_SLEEP_MS", "SLEEP_IN_SEQ"), on_press=handlers.sleep_pressed, ), maybe_make_mod_key, @@ -414,10 +414,10 @@ def __getitem__(self, key): if maybe_key: break else: - raise ValueError(f'Invalid key: {key}') + raise ValueError(f"Invalid key: {key}") if debug.enabled: - debug(f'{key}: {maybe_key}') + debug(f"{key}: {maybe_key}") return self.__cache[key] @@ -463,42 +463,42 @@ def __call__(self, no_press=None, no_release=None): ) def __repr__(self): - return f'Key(code={self.code}, has_modifiers={self.has_modifiers})' + return f"Key(code={self.code}, has_modifiers={self.has_modifiers})" def on_press(self, state, coord_int=None): - if hasattr(self, '_pre_press_handlers'): + if hasattr(self, "_pre_press_handlers"): for fn in self._pre_press_handlers: if not fn(self, state, KC, coord_int): return None ret = self._handle_press(self, state, KC, coord_int) - if hasattr(self, '_post_press_handlers'): + if hasattr(self, "_post_press_handlers"): for fn in self._post_press_handlers: fn(self, state, KC, coord_int) return ret def on_release(self, state, coord_int=None): - if hasattr(self, '_pre_release_handlers'): + if hasattr(self, "_pre_release_handlers"): for fn in self._pre_release_handlers: if not fn(self, state, KC, coord_int): return None ret = self._handle_release(self, state, KC, coord_int) - if hasattr(self, '_post_release_handlers'): + if hasattr(self, "_post_release_handlers"): for fn in self._post_release_handlers: fn(self, state, KC, coord_int) return ret def clone(self): - ''' + """ Return a shallow clone of the current key without any pre/post press/release handlers attached. Almost exclusively useful for creating non-colliding keys to use such handlers. - ''' + """ return type(self)( code=self.code, @@ -511,7 +511,7 @@ def clone(self): ) def before_press_handler(self, fn): - ''' + """ Attach a callback to be run prior to the on_press handler for this key. Receives the following: @@ -528,15 +528,15 @@ def before_press_handler(self, fn): These handlers are run in attachment order: handlers provided by earlier calls of this method will be executed before those provided by later calls. - ''' + """ - if not hasattr(self, '_pre_press_handlers'): + if not hasattr(self, "_pre_press_handlers"): self._pre_press_handlers = [] self._pre_press_handlers.append(fn) return self def after_press_handler(self, fn): - ''' + """ Attach a callback to be run after the on_release handler for this key. Receives the following: @@ -552,15 +552,15 @@ def after_press_handler(self, fn): These handlers are run in attachment order: handlers provided by earlier calls of this method will be executed before those provided by later calls. - ''' + """ - if not hasattr(self, '_post_press_handlers'): + if not hasattr(self, "_post_press_handlers"): self._post_press_handlers = [] self._post_press_handlers.append(fn) return self def before_release_handler(self, fn): - ''' + """ Attach a callback to be run prior to the on_release handler for this key. Receives the following: @@ -577,15 +577,15 @@ def before_release_handler(self, fn): These handlers are run in attachment order: handlers provided by earlier calls of this method will be executed before those provided by later calls. - ''' + """ - if not hasattr(self, '_pre_release_handlers'): + if not hasattr(self, "_pre_release_handlers"): self._pre_release_handlers = [] self._pre_release_handlers.append(fn) return self def after_release_handler(self, fn): - ''' + """ Attach a callback to be run after the on_release handler for this key. Receives the following: @@ -601,9 +601,9 @@ def after_release_handler(self, fn): These handlers are run in attachment order: handlers provided by earlier calls of this method will be executed before those provided by later calls. - ''' + """ - if not hasattr(self, '_post_release_handlers'): + if not hasattr(self, "_post_release_handlers"): self._post_release_handlers = [] self._post_release_handlers.append(fn) return self @@ -642,7 +642,7 @@ def __call__(self, modified_key=None, no_press=None, no_release=None): ) def __repr__(self): - return f'ModifierKey(code={self.code}, has_modifiers={self.has_modifiers})' + return f"ModifierKey(code={self.code}, has_modifiers={self.has_modifiers})" class ConsumerKey(Key): @@ -650,7 +650,7 @@ class ConsumerKey(Key): def make_key(code=None, names=tuple(), type=KEY_SIMPLE, **kwargs): # NOQA - ''' + """ Create a new key, aliased by `names` in the KC lookup table. If a code is not specified, the key is assumed to be a custom @@ -664,7 +664,7 @@ def make_key(code=None, names=tuple(), type=KEY_SIMPLE, **kwargs): # NOQA Names are case sensitive. All **kwargs are passed to the Key constructor - ''' + """ global NEXT_AVAILABLE_KEY @@ -675,7 +675,7 @@ def make_key(code=None, names=tuple(), type=KEY_SIMPLE, **kwargs): # NOQA elif type == KEY_CONSUMER: constructor = ConsumerKey else: - raise ValueError('Unrecognized key type') + raise ValueError("Unrecognized key type") if code is None: code = NEXT_AVAILABLE_KEY @@ -732,9 +732,9 @@ def _argumented_key(*user_args, **user_kwargs): else: raise ValueError( - 'Argumented key validator failed for unknown reasons. ' + "Argumented key validator failed for unknown reasons. " "This may not be the keymap's fault, as a more specific error " - 'should have been raised.' + "should have been raised." ) for name in names: diff --git a/kmk/kmk_keyboard.py b/kmk/kmk_keyboard.py index 106277fa4..1d7233303 100644 --- a/kmk/kmk_keyboard.py +++ b/kmk/kmk_keyboard.py @@ -70,27 +70,27 @@ class KMKKeyboard: # real known fix yet other than turning off debug, but M4s have always been # tight on RAM so.... def __repr__(self): - return ''.join( + return "".join( [ - 'KMKKeyboard(\n', - f' debug_enabled={self.debug_enabled}, ', - f'diode_orientation={self.diode_orientation}, ', - f'matrix={self.matrix},\n', - f' unicode_mode={self.unicode_mode}, ', - f'_hid_helper={self._hid_helper},\n', - f' keys_pressed={self.keys_pressed},\n', - f' _coordkeys_pressed={self._coordkeys_pressed},\n', - f' hid_pending={self.hid_pending}, ', - f'active_layers={self.active_layers}, ', - f'_timeouts={self._timeouts}\n', - ')', + "KMKKeyboard(\n", + f" debug_enabled={self.debug_enabled}, ", + f"diode_orientation={self.diode_orientation}, ", + f"matrix={self.matrix},\n", + f" unicode_mode={self.unicode_mode}, ", + f"_hid_helper={self._hid_helper},\n", + f" keys_pressed={self.keys_pressed},\n", + f" _coordkeys_pressed={self._coordkeys_pressed},\n", + f" hid_pending={self.hid_pending}, ", + f"active_layers={self.active_layers}, ", + f"_timeouts={self._timeouts}\n", + ")", ] ) def _print_debug_cycle(self, init=False): if debug.enabled: - debug(f'coordkeys_pressed={self._coordkeys_pressed}') - debug(f'keys_pressed={self.keys_pressed}') + debug(f"coordkeys_pressed={self._coordkeys_pressed}") + debug(f"keys_pressed={self.keys_pressed}") def _send_hid(self): if self._hid_send_enabled: @@ -99,7 +99,7 @@ def _send_hid(self): hid_report.send() except KeyError as e: if debug.enabled: - debug(f'HidNotFound(HIDReportType={e})') + debug(f"HidNotFound(HIDReportType={e})") self.hid_pending = False def _handle_matrix_report(self, update=None): @@ -112,7 +112,7 @@ def _find_key_in_map(self, int_coord): idx = self.coord_mapping.index(int_coord) except ValueError: if debug.enabled: - debug(f'CoordMappingNotFound(ic={int_coord})') + debug(f"CoordMappingNotFound(ic={int_coord})") return None @@ -122,7 +122,7 @@ def _find_key_in_map(self, int_coord): except IndexError: layer_key = None if debug.enabled: - debug(f'KeymapIndexError(idx={idx}, layer={layer})') + debug(f"KeymapIndexError(idx={idx}, layer={layer})") if not layer_key or layer_key == KC.TRNS: continue @@ -133,7 +133,7 @@ def _on_matrix_changed(self, kevent): int_coord = kevent.key_number is_pressed = kevent.pressed if debug.enabled: - debug(f'MatrixChange(ic={int_coord}, pressed={is_pressed})') + debug(f"MatrixChange(ic={int_coord}, pressed={is_pressed})") key = None if not is_pressed: @@ -141,18 +141,18 @@ def _on_matrix_changed(self, kevent): key = self._coordkeys_pressed[int_coord] except KeyError: if debug.enabled: - debug(f'KeyNotPressed(ic={int_coord})') + debug(f"KeyNotPressed(ic={int_coord})") if key is None: key = self._find_key_in_map(int_coord) if key is None: if debug.enabled: - debug(f'MatrixUndefinedCoordinate(ic={int_coord})') + debug(f"MatrixUndefinedCoordinate(ic={int_coord})") return self if debug.enabled: - debug(f'KeyResolution(key={key})') + debug(f"KeyResolution(key={key})") self.pre_process_key(key, is_pressed, int_coord) @@ -172,7 +172,7 @@ def pre_process_key(self, key, is_pressed, int_coord=None, index=0): break except Exception as err: if debug.enabled: - debug(f'Error in {module}.process_key: {err}') + debug(f"Error in {module}.process_key: {err}") if int_coord is not None: if is_pressed: @@ -182,7 +182,7 @@ def pre_process_key(self, key, is_pressed, int_coord=None, index=0): del self._coordkeys_pressed[int_coord] except KeyError: if debug.enabled: - debug(f'ReleaseKeyError(ic={int_coord})') + debug(f"ReleaseKeyError(ic={int_coord})") if key: self.process_key(key, is_pressed, int_coord) @@ -223,7 +223,7 @@ def tap_key(self, keycode): return self def set_timeout(self, after_ticks, callback): - # We allow passing False as an implicit "run this on the next process timeouts cycle" + # We allow passing False as implicit "run on the next process timeouts cycle" if after_ticks is False: after_ticks = 0 @@ -245,7 +245,7 @@ def cancel_timeout(self, timeout_key): self._timeouts[timeout_key[0]][timeout_key[1]] = None except (KeyError, IndexError): if debug.enabled: - debug(f'no such timeout: {timeout_key}') + debug(f"no such timeout: {timeout_key}") def _process_timeouts(self): if not self._timeouts: @@ -263,7 +263,7 @@ def _process_timeouts(self): timeout_keys.append(k) if timeout_keys and debug.enabled: - debug('processing timeouts') + debug("processing timeouts") for k in sorted(timeout_keys): for callback in self._timeouts[k]: @@ -276,32 +276,32 @@ def _process_timeouts(self): return self def _init_sanity_check(self): - ''' + """ Ensure the provided configuration is *probably* bootable - ''' - assert self.keymap, 'must define a keymap with at least one row' + """ + assert self.keymap, "must define a keymap with at least one row" assert ( self.hid_type in HIDModes.ALL_MODES - ), 'hid_type must be a value from kmk.consts.HIDModes' + ), "hid_type must be a value from kmk.consts.HIDModes" if not self.matrix: - assert self.row_pins, 'no GPIO pins defined for matrix rows' - assert self.col_pins, 'no GPIO pins defined for matrix columns' + assert self.row_pins, "no GPIO pins defined for matrix rows" + assert self.col_pins, "no GPIO pins defined for matrix columns" assert ( self.diode_orientation is not None - ), 'diode orientation must be defined' + ), "diode orientation must be defined" return self def _init_coord_mapping(self): - ''' + """ Attempt to sanely guess a coord_mapping if one is not provided. No-op if `kmk.extensions.split.Split` is used, it provides equivalent functionality in `on_bootup` To save RAM on boards that don't use Split, we don't import Split and do an isinstance check, but instead do string detection - ''' - if any(x.__class__.__module__ == 'kmk.modules.split' for x in self.modules): + """ + if any(x.__class__.__module__ == "kmk.modules.split" for x in self.modules): return if not self.coord_mapping: @@ -325,7 +325,7 @@ def _init_hid(self): def _init_matrix(self): if self.matrix is None: if debug.enabled: - debug('Initialising default matrix scanner.') + debug("Initialising default matrix scanner.") self.matrix = MatrixScanner( column_pins=self.col_pins, row_pins=self.row_pins, @@ -349,14 +349,14 @@ def before_matrix_scan(self): module.before_matrix_scan(self) except Exception as err: if debug.enabled: - debug(f'Error in {module}.before_matrix_scan: {err}') + debug(f"Error in {module}.before_matrix_scan: {err}") for ext in self.extensions: try: ext.before_matrix_scan(self.sandbox) except Exception as err: if debug.enabled: - debug(f'Error in {ext}.before_matrix_scan: {err}') + debug(f"Error in {ext}.before_matrix_scan: {err}") def after_matrix_scan(self): for module in self.modules: @@ -364,14 +364,14 @@ def after_matrix_scan(self): module.after_matrix_scan(self) except Exception as err: if debug.enabled: - debug(f'Error in {module}.after_matrix_scan: {err}') + debug(f"Error in {module}.after_matrix_scan: {err}") for ext in self.extensions: try: ext.after_matrix_scan(self.sandbox) except Exception as err: if debug.enabled: - debug(f'Error in {ext}.after_matrix_scan: {err}') + debug(f"Error in {ext}.after_matrix_scan: {err}") def before_hid_send(self): for module in self.modules: @@ -379,7 +379,7 @@ def before_hid_send(self): module.before_hid_send(self) except Exception as err: if debug.enabled: - debug(f'Error in {module}.before_hid_send: {err}') + debug(f"Error in {module}.before_hid_send: {err}") for ext in self.extensions: try: @@ -387,7 +387,7 @@ def before_hid_send(self): except Exception as err: if debug.enabled: debug( - f'Error in {ext}.before_hid_send: {err}', + f"Error in {ext}.before_hid_send: {err}", ) def after_hid_send(self): @@ -396,14 +396,14 @@ def after_hid_send(self): module.after_hid_send(self) except Exception as err: if debug.enabled: - debug(f'Error in {module}.after_hid_send: {err}') + debug(f"Error in {module}.after_hid_send: {err}") for ext in self.extensions: try: ext.after_hid_send(self.sandbox) except Exception as err: if debug.enabled: - debug(f'Error in {ext}.after_hid_send: {err}') + debug(f"Error in {ext}.after_hid_send: {err}") def powersave_enable(self): for module in self.modules: @@ -411,14 +411,14 @@ def powersave_enable(self): module.on_powersave_enable(self) except Exception as err: if debug.enabled: - debug(f'Error in {module}.on_powersave: {err}') + debug(f"Error in {module}.on_powersave: {err}") for ext in self.extensions: try: ext.on_powersave_enable(self.sandbox) except Exception as err: if debug.enabled: - debug(f'Error in {ext}.powersave_enable: {err}') + debug(f"Error in {ext}.powersave_enable: {err}") def powersave_disable(self): for module in self.modules: @@ -426,13 +426,13 @@ def powersave_disable(self): module.on_powersave_disable(self) except Exception as err: if debug.enabled: - debug(f'Error in {module}.powersave_disable: {err}') + debug(f"Error in {module}.powersave_disable: {err}") for ext in self.extensions: try: ext.on_powersave_disable(self.sandbox) except Exception as err: if debug.enabled: - debug(f'Error in {ext}.powersave_disable: {err}') + debug(f"Error in {ext}.powersave_disable: {err}") def go(self, hid_type=HIDModes.USB, secondary_hid_type=None, **kwargs): self._init(hid_type=hid_type, secondary_hid_type=secondary_hid_type, **kwargs) @@ -454,16 +454,16 @@ def _init(self, hid_type=HIDModes.USB, secondary_hid_type=None, **kwargs): module.during_bootup(self) except Exception as err: if debug.enabled: - debug(f'Failed to load module {module}: {err}') + debug(f"Failed to load module {module}: {err}") for ext in self.extensions: try: ext.during_bootup(self) except Exception as err: if debug.enabled: - debug(f'Failed to load extensions {module}: {err}') + debug(f"Failed to load extensions {module}: {err}") if debug.enabled: - debug(f'init: {self}') + debug(f"init: {self}") def _main_loop(self): self.state_changed = False diff --git a/kmk/kmktime.py b/kmk/kmktime.py index 965de6576..331fa7a0e 100644 --- a/kmk/kmktime.py +++ b/kmk/kmktime.py @@ -1,4 +1,5 @@ from micropython import const + from supervisor import ticks_ms _TICKS_PERIOD = const(1 << 29) diff --git a/kmk/modules/__init__.py b/kmk/modules/__init__.py index b616f0759..6896330c8 100644 --- a/kmk/modules/__init__.py +++ b/kmk/modules/__init__.py @@ -3,12 +3,12 @@ class InvalidExtensionEnvironment(Exception): class Module: - ''' + """ Modules differ from extensions in that they not only can read the state, but are allowed to modify the state. The will be loaded on boot, and are not allowed to be unloaded as they are required to continue functioning in a consistant manner. - ''' + """ # The below methods should be implemented by subclasses @@ -16,15 +16,15 @@ def during_bootup(self, keyboard): raise NotImplementedError def before_matrix_scan(self, keyboard): - ''' + """ Return value will be injected as an extra matrix update - ''' + """ raise NotImplementedError def after_matrix_scan(self, keyboard): - ''' + """ Return value will be replace matrix update if supplied - ''' + """ raise NotImplementedError def process_key(self, keyboard, key, is_pressed, int_coord): diff --git a/kmk/modules/adns9800.py b/kmk/modules/adns9800.py index 00981c274..c8c607bc4 100644 --- a/kmk/modules/adns9800.py +++ b/kmk/modules/adns9800.py @@ -1,9 +1,9 @@ +import time + import busio import digitalio import microcontroller -import time - from kmk.modules import Module from kmk.modules.adns9800_firmware import firmware from kmk.modules.mouse_keys import PointingDevice @@ -179,16 +179,16 @@ def during_bootup(self, keyboard): microcontroller.delay_us(self.tsww) if keyboard.debug_enabled: - print('ADNS: Product ID ', hex(self.adns_read(REG.Product_ID))) + print("ADNS: Product ID ", hex(self.adns_read(REG.Product_ID))) microcontroller.delay_us(self.tsrr) - print('ADNS: Revision ID ', hex(self.adns_read(REG.Revision_ID))) + print("ADNS: Revision ID ", hex(self.adns_read(REG.Revision_ID))) microcontroller.delay_us(self.tsrr) - print('ADNS: SROM ID ', hex(self.adns_read(REG.SROM_ID))) + print("ADNS: SROM ID ", hex(self.adns_read(REG.SROM_ID))) microcontroller.delay_us(self.tsrr) if self.adns_read(REG.Observation) & 0x20: - print('ADNS: Sensor is running SROM') + print("ADNS: Sensor is running SROM") else: - print('ADNS: Error! Sensor is not runnin SROM!') + print("ADNS: Error! Sensor is not runnin SROM!") return @@ -214,7 +214,7 @@ def before_matrix_scan(self, keyboard): self.pointing_device.report_y[0] = delta_y & 0xFF if keyboard.debug_enabled: - print('Delta: ', delta_x, ' ', delta_y) + print("Delta: ", delta_x, " ", delta_y) self.pointing_device.hid_pending = True if self.pointing_device.hid_pending: diff --git a/kmk/modules/capsword.py b/kmk/modules/capsword.py index 0aa4eb1d9..3c8732081 100755 --- a/kmk/modules/capsword.py +++ b/kmk/modules/capsword.py @@ -18,8 +18,8 @@ def __init__(self, timeout=8000): self.timeout = timeout make_key( names=( - 'CAPSWORD', - 'CW', + "CAPSWORD", + "CW", ), on_press=self.cw_pressed, ) diff --git a/kmk/modules/cg_swap.py b/kmk/modules/cg_swap.py index 9dbfbc778..3cbcbb4d4 100755 --- a/kmk/modules/cg_swap.py +++ b/kmk/modules/cg_swap.py @@ -13,13 +13,13 @@ def __init__(self, cg_swap_enable=False): KC.RGUI: KC.RCTL, } make_key( - names=('CG_SWAP',), + names=("CG_SWAP",), ) make_key( - names=('CG_NORM',), + names=("CG_NORM",), ) make_key( - names=('CG_TOGG',), + names=("CG_TOGG",), ) def during_bootup(self, keyboard): diff --git a/kmk/modules/combos.py b/kmk/modules/combos.py index 01184a60a..17d6c2977 100644 --- a/kmk/modules/combos.py +++ b/kmk/modules/combos.py @@ -23,10 +23,10 @@ def __init__( per_key_timeout=None, timeout=None, ): - ''' + """ match: tuple of keys (KC.A, KC.B) result: key KC.C - ''' + """ self.match = match self.result = result if fast_reset is not None: @@ -37,7 +37,7 @@ def __init__( self.timeout = timeout def __repr__(self): - return f'{self.__class__.__name__}({[k.code for k in self.match]})' + return f"{self.__class__.__name__}({[k.code for k in self.match]})" def matches(self, key): raise NotImplementedError @@ -76,7 +76,7 @@ def __init__(self, combos=[]): self._key_buffer = [] make_key( - names=('LEADER', 'LDR'), + names=("LEADER", "LDR"), on_press=handlers.passthrough, on_release=handlers.passthrough, ) diff --git a/kmk/modules/dynamic_sequences.py b/kmk/modules/dynamic_sequences.py index e633da576..7690cd940 100755 --- a/kmk/modules/dynamic_sequences.py +++ b/kmk/modules/dynamic_sequences.py @@ -1,7 +1,7 @@ +from collections import namedtuple from micropython import const -from supervisor import ticks_ms -from collections import namedtuple +from supervisor import ticks_ms from kmk.keys import KC, make_argumented_key from kmk.kmktime import check_deadline, ticks_diff @@ -24,7 +24,7 @@ class SequenceStatus: # Keycodes for number keys _numbers = range(KC.N1.code, KC.N0.code + 1) -SequenceFrame = namedtuple('SequenceFrame', ['keys_pressed', 'timestamp']) +SequenceFrame = namedtuple("SequenceFrame", ["keys_pressed", "timestamp"]) class Sequence: @@ -53,31 +53,31 @@ def __init__( # Create keycodes make_argumented_key( - validator=DSMeta, names=('RECORD_SEQUENCE',), on_press=self._record_sequence + validator=DSMeta, names=("RECORD_SEQUENCE",), on_press=self._record_sequence ) make_argumented_key( - validator=DSMeta, names=('PLAY_SEQUENCE',), on_press=self._play_sequence + validator=DSMeta, names=("PLAY_SEQUENCE",), on_press=self._play_sequence ) make_argumented_key( validator=DSMeta, names=( - 'SET_SEQUENCE', - 'STOP_SEQUENCE', + "SET_SEQUENCE", + "STOP_SEQUENCE", ), on_press=self._stop_sequence, ) make_argumented_key( validator=DSMeta, - names=('SET_SEQUENCE_REPETITIONS',), + names=("SET_SEQUENCE_REPETITIONS",), on_press=self._set_sequence_repetitions, ) make_argumented_key( validator=DSMeta, - names=('SET_SEQUENCE_INTERVAL',), + names=("SET_SEQUENCE_INTERVAL",), on_press=self._set_sequence_interval, ) diff --git a/kmk/modules/easypoint.py b/kmk/modules/easypoint.py index 6a2f9d452..b79e5272e 100644 --- a/kmk/modules/easypoint.py +++ b/kmk/modules/easypoint.py @@ -1,6 +1,6 @@ -''' +""" Extension handles usage of AS5013 by AMS -''' +""" from supervisor import ticks_ms @@ -29,7 +29,7 @@ class Easypoint(Module): - '''Module handles usage of AS5013 by AMS''' + """Module handles usage of AS5013 by AMS""" def __init__( self, @@ -60,9 +60,9 @@ def during_bootup(self, keyboard): return def before_matrix_scan(self, keyboard): - ''' + """ Return value will be injected as an extra matrix update - ''' + """ now = ticks_ms() if now - self.last_tick < self.polling_interval: return @@ -115,19 +115,19 @@ def _clear_pending_hid(self): self.pointing_device.button_status[0] = 0 def _read_raw_state(self): - '''Read data from AS5013''' + """Read data from AS5013""" x, y = self._i2c_rdwr([X], length=2) return x, y def getSignedNumber(self, number, bitLength=8): - mask = (2 ** bitLength) - 1 + mask = (2**bitLength) - 1 if number & (1 << (bitLength - 1)): return number | ~mask else: return number & mask def _i2c_rdwr(self, data, length=1): - '''Write and optionally read I2C data.''' + """Write and optionally read I2C data.""" while not self._i2c_bus.try_lock(): pass diff --git a/kmk/modules/encoder.py b/kmk/modules/encoder.py index 6f67ae879..d6c52f115 100644 --- a/kmk/modules/encoder.py +++ b/kmk/modules/encoder.py @@ -35,10 +35,10 @@ def __init__(self, is_inverted=False, divisor=4): def get_state(self): return { - 'direction': self.is_inverted and -self._direction or self._direction, - 'position': self.is_inverted and -self._pos or self._pos, - 'is_pressed': not self._button_state, - 'velocity': self._velocity, + "direction": self.is_inverted and -self._direction or self._direction, + "position": self.is_inverted and -self._pos or self._pos, + "is_pressed": not self._button_state, + "velocity": self._velocity, } # Called in a loop to refresh encoder state @@ -102,7 +102,7 @@ def velocity_event(self): self._timestamp = new_timestamp def button_event(self): - raise NotImplementedError('subclasses must override button_event()!') + raise NotImplementedError("subclasses must override button_event()!") # return knob velocity as milliseconds between position changes (detents) # for backwards compatibility @@ -161,7 +161,7 @@ def __init__(self, i2c, address, is_inverted=False): try: from adafruit_seesaw import digitalio, neopixel, rotaryio, seesaw except ImportError: - print('seesaw missing') + print("seesaw missing") return super().__init__(is_inverted) @@ -172,7 +172,7 @@ def __init__(self, i2c, address, is_inverted=False): seesaw_product = (self.seesaw.get_version() >> 16) & 0xFFFF if seesaw_product != 4991: - print('Wrong firmware loaded? Expected 4991') + print("Wrong firmware loaded? Expected 4991") self.encoder = rotaryio.IncrementalEncoder(self.seesaw) self.seesaw.pin_mode(24, self.seesaw.INPUT_PULLUP) @@ -217,11 +217,11 @@ def button_event(self): def get_state(self): return { - 'direction': self.is_inverted and -self._direction or self._direction, - 'position': self._state, - 'is_pressed': not self.switch.value, - 'is_held': self._button_held, - 'velocity': self._velocity, + "direction": self.is_inverted and -self._direction or self._direction, + "position": self._state, + "is_pressed": not self.switch.value, + "is_held": self._button_held, + "velocity": self._velocity, } @@ -253,7 +253,7 @@ def during_bootup(self, keyboard): if new_encoder.divisor is None: new_encoder.divisor = self.divisor - # In our case, we need to define keybord and encoder_id for callbacks + # Here we need to define keybord and encoder_id for callbacks new_encoder.on_move_do = lambda x, bound_idx=idx: self.on_move_do( keyboard, bound_idx, x ) @@ -271,7 +271,7 @@ def on_move_do(self, keyboard, encoder_id, state): if self.map: layer_id = keyboard.active_layers[0] # if Left, key index 0 else key index 1 - if state['direction'] == -1: + if state["direction"] == -1: key_index = 0 else: key_index = 1 @@ -279,24 +279,24 @@ def on_move_do(self, keyboard, encoder_id, state): keyboard.tap_key(key) def on_button_do(self, keyboard, encoder_id, state): - if state['is_pressed'] is True: + if state["is_pressed"] is True: layer_id = keyboard.active_layers[0] key = self.map[layer_id][encoder_id][2] keyboard.tap_key(key) def before_matrix_scan(self, keyboard): - ''' + """ Return value will be injected as an extra matrix update - ''' + """ for encoder in self.encoders: encoder.update_state() return keyboard def after_matrix_scan(self, keyboard): - ''' + """ Return value will be replace matrix update if supplied - ''' + """ return def before_hid_send(self, keyboard): diff --git a/kmk/modules/holdtap.py b/kmk/modules/holdtap.py index 5df7e4117..73c5edc54 100644 --- a/kmk/modules/holdtap.py +++ b/kmk/modules/holdtap.py @@ -43,7 +43,7 @@ def __init__(self): self.key_states = {} make_argumented_key( validator=HoldTapKeyMeta, - names=('HT',), + names=("HT",), on_press=self.ht_pressed, on_release=self.ht_released, ) @@ -58,7 +58,7 @@ def after_matrix_scan(self, keyboard): return def process_key(self, keyboard, key, is_pressed, int_coord): - '''Handle holdtap being interrupted by another key press/release.''' + """Handle holdtap being interrupted by another key press/release.""" current_key = key send_buffer = False append_buffer = False @@ -117,7 +117,8 @@ def on_powersave_disable(self, keyboard): return def ht_pressed(self, key, keyboard, *args, **kwargs): - '''Do nothing yet, action resolves when key is released, timer expires or other key is pressed.''' + """Do nothing yet, action resolves when key is released, timer expires or \ + other key is pressed.""" if key.meta.tap_time is None: tap_time = self.tap_time else: @@ -130,7 +131,7 @@ def ht_pressed(self, key, keyboard, *args, **kwargs): return keyboard def ht_released(self, key, keyboard, *args, **kwargs): - '''On keyup, release mod or tap key.''' + """On keyup, release mod or tap key.""" if key not in self.key_states: return keyboard @@ -157,13 +158,13 @@ def ht_released(self, key, keyboard, *args, **kwargs): return keyboard def on_tap_time_expired(self, key, keyboard, *args, **kwargs): - '''When tap time expires activate hold if key is still being pressed. - Remove key if ActivationType is RELEASED.''' + """When tap time expires activate hold if key is still being pressed. + Remove key if ActivationType is RELEASED.""" try: state = self.key_states[key] except KeyError: if keyboard.debug_enabled: - print(f'HoldTap.on_tap_time_expired: no such key {key}') + print(f"HoldTap.on_tap_time_expired: no such key {key}") return if self.key_states[key].activated == ActivationType.PRESSED: diff --git a/kmk/modules/layers.py b/kmk/modules/layers.py index a3f5e074d..cff16f242 100644 --- a/kmk/modules/layers.py +++ b/kmk/modules/layers.py @@ -1,4 +1,4 @@ -'''One layer isn't enough. Adds keys to get to more of them''' +"""One layer isn't enough. Adds keys to get to more of them""" from kmk.keys import KC, make_argumented_key from kmk.modules.holdtap import ActivationType, HoldTap, HoldTapKeyMeta from kmk.utils import Debug @@ -7,13 +7,13 @@ def layer_key_validator(layer, kc=None): - ''' + """ Validates the syntax (but not semantics) of a layer key call. We won't have access to the keymap here, so we can't verify much of anything useful here (like whether the target layer actually exists). The spirit of this existing is mostly that Python will catch extraneous args/kwargs and error out. - ''' + """ return LayerKeyMeta(layer, kc) @@ -34,41 +34,41 @@ def __init__(self, layer, kc=None): class Layers(HoldTap): - '''Gives access to the keys used to enable the layer system''' + """Gives access to the keys used to enable the layer system""" def __init__(self): # Layers super().__init__() make_argumented_key( validator=layer_key_validator, - names=('MO',), + names=("MO",), on_press=self._mo_pressed, on_release=self._mo_released, ) make_argumented_key( - validator=layer_key_validator, names=('DF',), on_press=self._df_pressed + validator=layer_key_validator, names=("DF",), on_press=self._df_pressed ) make_argumented_key( validator=layer_key_validator, - names=('LM',), + names=("LM",), on_press=self._lm_pressed, on_release=self._lm_released, ) make_argumented_key( - validator=layer_key_validator, names=('TG',), on_press=self._tg_pressed + validator=layer_key_validator, names=("TG",), on_press=self._tg_pressed ) make_argumented_key( - validator=layer_key_validator, names=('TO',), on_press=self._to_pressed + validator=layer_key_validator, names=("TO",), on_press=self._to_pressed ) make_argumented_key( validator=layer_key_validator_lt, - names=('LT',), + names=("LT",), on_press=self.ht_pressed, on_release=self.ht_released, ) make_argumented_key( validator=layer_key_validator_tt, - names=('TT',), + names=("TT",), on_press=self.ht_pressed, on_release=self.ht_released, ) @@ -88,16 +88,16 @@ def process_key(self, keyboard, key, is_pressed, int_coord): return current_key def _df_pressed(self, key, keyboard, *args, **kwargs): - ''' + """ Switches the default layer - ''' + """ keyboard.active_layers[-1] = key.meta.layer self._print_debug(keyboard) def _mo_pressed(self, key, keyboard, *args, **kwargs): - ''' + """ Momentarily activates layer, switches off when you let go - ''' + """ keyboard.active_layers.insert(0, key.meta.layer) self._print_debug(keyboard) @@ -119,26 +119,26 @@ def _mo_released(key, keyboard, *args, **kwargs): __class__._print_debug(__class__, keyboard) def _lm_pressed(self, key, keyboard, *args, **kwargs): - ''' + """ As MO(layer) but with mod active - ''' + """ keyboard.hid_pending = True # Sets the timer start and acts like MO otherwise keyboard.keys_pressed.add(key.meta.kc) self._mo_pressed(key, keyboard, *args, **kwargs) def _lm_released(self, key, keyboard, *args, **kwargs): - ''' + """ As MO(layer) but with mod active - ''' + """ keyboard.hid_pending = True keyboard.keys_pressed.discard(key.meta.kc) self._mo_released(key, keyboard, *args, **kwargs) def _tg_pressed(self, key, keyboard, *args, **kwargs): - ''' + """ Toggles the layer (enables it if not active, and vise versa) - ''' + """ # See mo_released for implementation details around this try: del_idx = keyboard.active_layers.index(key.meta.layer) @@ -147,13 +147,13 @@ def _tg_pressed(self, key, keyboard, *args, **kwargs): keyboard.active_layers.insert(0, key.meta.layer) def _to_pressed(self, key, keyboard, *args, **kwargs): - ''' + """ Activates layer and deactivates all other layers - ''' + """ keyboard.active_layers.clear() keyboard.active_layers.insert(0, key.meta.layer) def _print_debug(self, keyboard): # debug(f'__getitem__ {key}') if debug.enabled: - debug(f'active_layers={keyboard.active_layers}') + debug(f"active_layers={keyboard.active_layers}") diff --git a/kmk/modules/midi.py b/kmk/modules/midi.py index d32ce6440..f456e51ce 100644 --- a/kmk/modules/midi.py +++ b/kmk/modules/midi.py @@ -22,38 +22,38 @@ def __init__(self, note=69, velocity=64, channel=None): class MidiKeys(Module): def __init__(self): make_argumented_key( - names=('MIDI_CC',), + names=("MIDI_CC",), validator=ControlChange, on_press=self.on_press, ) make_argumented_key( - names=('MIDI_NOTE',), + names=("MIDI_NOTE",), validator=midiNoteValidator, on_press=self.note_on, on_release=self.note_off, ) make_argumented_key( - names=('MIDI_PB',), + names=("MIDI_PB",), validator=PitchBend, on_press=self.on_press, ) make_argumented_key( - names=('MIDI_PC',), + names=("MIDI_PC",), validator=ProgramChange, on_press=self.on_press, ) make_argumented_key( - names=('MIDI_START',), + names=("MIDI_START",), validator=Start, on_press=self.on_press, ) make_argumented_key( - names=('MIDI_STOP',), + names=("MIDI_STOP",), validator=Stop, on_press=self.on_press, ) @@ -63,7 +63,7 @@ def __init__(self): except IndexError: self.midi = None # if debug_enabled: - print('No midi device found.') + print("No midi device found.") def during_bootup(self, keyboard): return None diff --git a/kmk/modules/modtap.py b/kmk/modules/modtap.py index e591c3ea3..2ae936446 100644 --- a/kmk/modules/modtap.py +++ b/kmk/modules/modtap.py @@ -6,9 +6,9 @@ def mod_tap_validator( kc, mods=None, prefer_hold=True, tap_interrupted=False, tap_time=None ): - ''' + """ Validates that mod tap keys are correctly used - ''' + """ return ModTapKeyMeta( kc=kc, mods=mods, @@ -28,7 +28,7 @@ def __init__(self): super().__init__() make_argumented_key( validator=mod_tap_validator, - names=('MT',), + names=("MT",), on_press=self.ht_pressed, on_release=self.ht_released, ) diff --git a/kmk/modules/mouse_keys.py b/kmk/modules/mouse_keys.py index 5a4e1418d..d0d51d7ea 100644 --- a/kmk/modules/mouse_keys.py +++ b/kmk/modules/mouse_keys.py @@ -36,58 +36,58 @@ def __init__(self): self.move_step = 1 make_key( - names=('MB_LMB',), + names=("MB_LMB",), on_press=self._mb_lmb_press, on_release=self._mb_lmb_release, ) make_key( - names=('MB_MMB',), + names=("MB_MMB",), on_press=self._mb_mmb_press, on_release=self._mb_mmb_release, ) make_key( - names=('MB_RMB',), + names=("MB_RMB",), on_press=self._mb_rmb_press, on_release=self._mb_rmb_release, ) make_key( - names=('MW_UP',), + names=("MW_UP",), on_press=self._mw_up_press, on_release=self._mw_up_release, ) make_key( names=( - 'MW_DOWN', - 'MW_DN', + "MW_DOWN", + "MW_DN", ), on_press=self._mw_down_press, on_release=self._mw_down_release, ) make_key( - names=('MS_UP',), + names=("MS_UP",), on_press=self._ms_up_press, on_release=self._ms_up_release, ) make_key( names=( - 'MS_DOWN', - 'MS_DN', + "MS_DOWN", + "MS_DN", ), on_press=self._ms_down_press, on_release=self._ms_down_release, ) make_key( names=( - 'MS_LEFT', - 'MS_LT', + "MS_LEFT", + "MS_LT", ), on_press=self._ms_left_press, on_release=self._ms_left_release, ) make_key( names=( - 'MS_RIGHT', - 'MS_RT', + "MS_RIGHT", + "MS_RT", ), on_press=self._ms_right_press, on_release=self._ms_right_release, diff --git a/kmk/modules/oneshot.py b/kmk/modules/oneshot.py index a95a82562..df50ea6b0 100644 --- a/kmk/modules/oneshot.py +++ b/kmk/modules/oneshot.py @@ -13,13 +13,13 @@ def __init__(self): super().__init__() make_argumented_key( validator=oneshot_validator, - names=('OS', 'ONESHOT'), + names=("OS", "ONESHOT"), on_press=self.osk_pressed, on_release=self.osk_released, ) def process_key(self, keyboard, current_key, is_pressed, int_coord): - '''Release os key after interrupting keyup.''' + """Release os key after interrupting keyup.""" for key, state in self.key_states.items(): if key == current_key: continue @@ -34,18 +34,18 @@ def process_key(self, keyboard, current_key, is_pressed, int_coord): return current_key def osk_pressed(self, key, keyboard, *args, **kwargs): - '''Register HoldTap mechanism and activate os key.''' + """Register HoldTap mechanism and activate os key.""" self.ht_pressed(key, keyboard, *args, **kwargs) self.ht_activate_tap(key, keyboard, *args, **kwargs) return keyboard def osk_released(self, key, keyboard, *args, **kwargs): - '''On keyup, mark os key as released or handle HoldTap.''' + """On keyup, mark os key as released or handle HoldTap.""" try: state = self.key_states[key] except KeyError: if keyboard.debug_enabled: - print(f'OneShot.osk_released: no such key {key}') + print(f"OneShot.osk_released: no such key {key}") return keyboard if state.activated == ActivationType.PRESSED: diff --git a/kmk/modules/pimoroni_trackball.py b/kmk/modules/pimoroni_trackball.py index c3144d05e..13d4a76a9 100644 --- a/kmk/modules/pimoroni_trackball.py +++ b/kmk/modules/pimoroni_trackball.py @@ -1,11 +1,10 @@ -''' +""" Extension handles usage of Trackball Breakout by Pimoroni Product page: https://shop.pimoroni.com/products/trackball-breakout -''' -from micropython import const - +""" import math import struct +from micropython import const from kmk.keys import make_argumented_key, make_key from kmk.kmktime import PeriodicTimer @@ -58,14 +57,14 @@ def layer_key_validator(handler): class TrackballMode: - '''Behaviour mode of trackball: mouse movement or vertical scroll''' + """Behaviour mode of trackball: mouse movement or vertical scroll""" MOUSE_MODE = const(0) SCROLL_MODE = const(1) class ScrollDirection: - '''Behaviour mode of scrolling: natural or reverse scrolling''' + """Behaviour mode of scrolling: natural or reverse scrolling""" NATURAL = const(0) REVERSE = const(1) @@ -167,7 +166,7 @@ def handle(self, keyboard, trackball, x, y, switch, state): class Trackball(Module): - '''Module handles usage of Trackball Breakout by Pimoroni''' + """Module handles usage of Trackball Breakout by Pimoroni""" def __init__( self, @@ -192,20 +191,20 @@ def __init__( self.current_handler = self.handlers[0] self.polling_interval = 20 - chip_id = struct.unpack(' PotentiometerState: ) def get_pos(self): - ''' + """ Read from the analog pin assingned, truncate to 7 bits, average over 10 readings, and return a value 0-127 - ''' + """ return int(sum([(self.read_pin.value >> 9) for i in range(10)]) / 10) def update_state(self): @@ -67,18 +67,18 @@ def during_bootup(self, keyboard): return def before_matrix_scan(self, keyboard): - ''' + """ Return value will be injected as an extra matrix update - ''' + """ for potentiometer in self.potentiometers: potentiometer.update_state() return keyboard def after_matrix_scan(self, keyboard): - ''' + """ Return value will be replace matrix update if supplied - ''' + """ return def before_hid_send(self, keyboard): diff --git a/kmk/modules/power.py b/kmk/modules/power.py index aa72eb13a..7e60d93bc 100644 --- a/kmk/modules/power.py +++ b/kmk/modules/power.py @@ -1,9 +1,9 @@ +from time import sleep + import board import digitalio from supervisor import ticks_ms -from time import sleep - from kmk.handlers.stock import passthrough as handler_passthrough from kmk.keys import make_key from kmk.kmktime import check_deadline @@ -21,25 +21,25 @@ def __init__(self, powersave_pin=None): self._loopcounter = 0 make_key( - names=('PS_TOG',), on_press=self._ps_tog, on_release=handler_passthrough + names=("PS_TOG",), on_press=self._ps_tog, on_release=handler_passthrough ) make_key( - names=('PS_ON',), on_press=self._ps_enable, on_release=handler_passthrough + names=("PS_ON",), on_press=self._ps_enable, on_release=handler_passthrough ) make_key( - names=('PS_OFF',), on_press=self._ps_disable, on_release=handler_passthrough + names=("PS_OFF",), on_press=self._ps_disable, on_release=handler_passthrough ) def __repr__(self): - return f'Power({self._to_dict()})' + return f"Power({self._to_dict()})" def _to_dict(self): return { - 'enable': self.enable, - 'powersave_pin': self.powersave_pin, - '_powersave_start': self._powersave_start, - '_usb_last_scan': self._usb_last_scan, - '_psp': self._psp, + "enable": self.enable, + "powersave_pin": self.powersave_pin, + "_powersave_start": self._powersave_start, + "_usb_last_scan": self._usb_last_scan, + "_psp": self._psp, } def during_bootup(self, keyboard): @@ -60,7 +60,7 @@ def after_hid_send(self, keyboard): self.psleep() def on_powersave_enable(self, keyboard): - '''Gives 10 cycles to allow other extensions to clean up before powersave''' + """Gives 10 cycles to allow other extensions to clean up before powersave""" if self._loopcounter > 10: self.enable_powersave(keyboard) self._loopcounter = 0 @@ -73,7 +73,7 @@ def on_powersave_disable(self, keyboard): return def enable_powersave(self, keyboard): - '''Enables power saving features''' + """Enables power saving features""" if keyboard.i2c_deinit_count >= self._i2c and self.powersave_pin: # Allows power save to prevent RGB drain. # Example here https://docs.nicekeyboards.com/#/nice!nano/pinout_schematic @@ -89,7 +89,7 @@ def enable_powersave(self, keyboard): return def disable_powersave(self, keyboard): - '''Disables power saving features''' + """Disables power saving features""" if self._psp: self._psp.value = False # Allows power save to prevent RGB drain. @@ -100,9 +100,9 @@ def disable_powersave(self, keyboard): return def psleep(self): - ''' + """ Sleeps longer and longer to save power the more time in between updates. - ''' + """ if check_deadline(ticks_ms(), self._powersave_start) <= 60000: sleep(8 / 1000) elif check_deadline(ticks_ms(), self._powersave_start) >= 240000: diff --git a/kmk/modules/rapidfire.py b/kmk/modules/rapidfire.py index 50720eaeb..adc403bbb 100644 --- a/kmk/modules/rapidfire.py +++ b/kmk/modules/rapidfire.py @@ -30,7 +30,7 @@ class RapidFire(Module): def __init__(self): make_argumented_key( validator=RapidFireMeta, - names=('RF',), + names=("RF",), on_press=self._rf_pressed, on_release=self._rf_released, ) diff --git a/kmk/modules/serialace.py b/kmk/modules/serialace.py index 2cbdcc2ff..acab9d88f 100644 --- a/kmk/modules/serialace.py +++ b/kmk/modules/serialace.py @@ -34,7 +34,7 @@ def before_hid_send(self, keyboard): return self.buffer.extend(data.read()) - idx = self.buffer.find(b'\n') + idx = self.buffer.find(b"\n") # No full command yet. if idx == -1: @@ -46,12 +46,12 @@ def before_hid_send(self, keyboard): try: if debug.enabled: - debug(f'eval({line})') - ret = eval(line, {'keyboard': keyboard}) - data.write(bytearray(str(ret) + '\n')) + debug(f"eval({line})") + ret = eval(line, {"keyboard": keyboard}) + data.write(bytearray(str(ret) + "\n")) except Exception as err: if debug.enabled: - debug(f'error: {err}') + debug(f"error: {err}") def after_hid_send(self, keyboard): pass diff --git a/kmk/modules/split.py b/kmk/modules/split.py index 2d5b4a0d7..18b51339d 100644 --- a/kmk/modules/split.py +++ b/kmk/modules/split.py @@ -1,10 +1,10 @@ -'''Enables splitting keyboards wirelessly or wired''' -import busio +"""Enables splitting keyboards wirelessly or wired""" from micropython import const -from supervisor import runtime, ticks_ms +import busio from keypad import Event as KeyEvent from storage import getmount +from supervisor import runtime, ticks_ms from kmk.hid import HIDModes from kmk.kmktime import check_deadline @@ -24,7 +24,7 @@ class SplitType: class Split(Module): - '''Enables splitting keyboards wirelessly, or wired''' + """Enables splitting keyboards wirelessly, or wired""" def __init__( self, @@ -67,7 +67,7 @@ def __init__( self.ProvideServicesAdvertisement = ProvideServicesAdvertisement self.UARTService = UARTService except ImportError: - print('BLE Import error') + print("BLE Import error") return # BLE isn't supported on this platform self._ble_last_scan = ticks_ms() - 5000 self._connection_count = 0 @@ -84,7 +84,7 @@ def __init__( def during_bootup(self, keyboard): # Set up name for target side detection and BLE advertisment - name = str(getmount('/').label) + name = str(getmount("/").label) if self.split_type == SplitType.BLE: if keyboard.hid_type == HIDModes.BLE: self._ble = keyboard._hid_helper.ble @@ -109,11 +109,11 @@ def during_bootup(self, keyboard): ): self._is_target = runtime.usb_connected elif self.split_type == SplitType.BLE: - self._is_target = name.endswith('L') == self.split_target_left + self._is_target = name.endswith("L") == self.split_target_left - if name.endswith('L'): + if name.endswith("L"): self.split_side = SplitSide.LEFT - elif name.endswith('R'): + elif name.endswith("R"): self.split_side = SplitSide.RIGHT if not self._is_target: @@ -187,7 +187,7 @@ def after_matrix_scan(self, keyboard): elif self.split_type == SplitType.ONEWIRE: pass # Protocol needs written else: - print('Unexpected case in after_matrix_scan') + print("Unexpected case in after_matrix_scan") return @@ -213,7 +213,7 @@ def on_powersave_disable(self, keyboard): self._psave_enable = False def _check_all_connections(self, keyboard): - '''Validates the correct number of BLE connections''' + """Validates the correct number of BLE connections""" self._previous_connection_count = self._connection_count self._connection_count = len(self._ble.connections) if self._is_target: @@ -226,7 +226,7 @@ def _check_all_connections(self, keyboard): self._initiator_scan() def _check_if_split_connected(self): - # I'm looking for a way how to recognize which connection is on and which one off + # Looking for a way how to recognize which connection is on and which one off # For now, I found that service name relation to having other CP device if self._connection_count == 0: return False @@ -247,7 +247,7 @@ def _check_if_split_connected(self): return False def _initiator_scan(self): - '''Scans for target device''' + """Scans for target device""" self._uart = None self._uart_connection = None # See if any existing connections are providing UARTService. @@ -262,30 +262,30 @@ def _initiator_scan(self): if not self._uart: if self._debug_enabled: - print('Scanning') + print("Scanning") self._ble.stop_scan() for adv in self._ble.start_scan( self.ProvideServicesAdvertisement, timeout=20 ): if self._debug_enabled: - print('Scanning') + print("Scanning") if self.UARTService in adv.services and adv.rssi > -70: self._uart_connection = self._ble.connect(adv) self._uart_connection.connection_interval = 11.25 self._uart = self._uart_connection[self.UARTService] self._ble.stop_scan() if self._debug_enabled: - print('Scan complete') + print("Scan complete") break self._ble.stop_scan() def _target_advertise(self): - '''Advertises the target for the initiator to find''' + """Advertises the target for the initiator to find""" # Give previous advertising some time to complete if self._advertising: if self._check_if_split_connected(): if self._debug_enabled: - print('Advertising complete') + print("Advertising complete") self._ble.stop_advertising() self._advertising = False return @@ -294,11 +294,11 @@ def _target_advertise(self): return if self._debug_enabled: - print('Advertising not answered') + print("Advertising not answered") self._ble.stop_advertising() if self._debug_enabled: - print('Advertising') + print("Advertising") # Uart must not change on this connection if reconnecting if not self._uart: self._uart = self.UARTService() @@ -309,11 +309,11 @@ def _target_advertise(self): self.ble_time_reset() def ble_rescan_timer(self): - '''If true, the rescan timer is up''' + """If true, the rescan timer is up""" return not bool(check_deadline(ticks_ms(), self._ble_last_scan, 5000)) def ble_time_reset(self): - '''Resets the rescan timer''' + """Resets the rescan timer""" self._ble_last_scan = ticks_ms() def _serialize_update(self, update): @@ -335,10 +335,10 @@ def _send_ble(self, update): self._uart.disconnect() except: # noqa: E722 if self._debug_enabled: - print('UART disconnect failed') + print("UART disconnect failed") if self._debug_enabled: - print('Connection error') + print("Connection error") self._uart_connection = None self._uart = None diff --git a/kmk/modules/sticky_mod.py b/kmk/modules/sticky_mod.py index 73ad569df..b942bd7d1 100644 --- a/kmk/modules/sticky_mod.py +++ b/kmk/modules/sticky_mod.py @@ -13,7 +13,7 @@ def __init__(self): self._active = False self._active_key = None make_argumented_key( - names=('SM',), + names=("SM",), validator=StickyModMeta, on_press=self.sm_pressed, on_release=self.sm_released, diff --git a/kmk/modules/string_substitution.py b/kmk/modules/string_substitution.py index 1ccd48f8e..d55599de3 100644 --- a/kmk/modules/string_substitution.py +++ b/kmk/modules/string_substitution.py @@ -17,7 +17,7 @@ class State: class Character: - '''Helper class for making a left-shifted key identical to a right-shifted key''' + """Helper class for making a left-shifted key identical to a right-shifted key""" is_shifted: bool = False @@ -36,7 +36,8 @@ def __eq__(self, other: any) -> bool: # type: ignore class Phrase: - '''Manages a collection of characters and keeps an index of them so that potential matches can be tracked''' + """Manages a collection of characters and keeps an index of them so that potential \ + matches can be tracked""" def __init__(self, string: str) -> None: self._characters: list[Character] = [] @@ -47,43 +48,44 @@ def __init__(self, string: str) -> None: shifted = char.isupper() or key_code.has_modifiers == {2} self._characters.append(Character(key_code, shifted)) except ValueError: - raise ValueError(f'Invalid character in dictionary: {char}') + raise ValueError(f"Invalid character in dictionary: {char}") def next_character(self) -> None: - '''Increment the current index for this phrase''' + """Increment the current index for this phrase""" if not self.index_at_end(): self._index += 1 def get_character_at_index(self, index: int) -> Character: - '''Returns the character at the given index''' + """Returns the character at the given index""" return self._characters[index] def get_character_at_current_index(self) -> Character: - '''Returns the character at the current index for this phrase''' + """Returns the character at the current index for this phrase""" return self._characters[self._index] def reset_index(self) -> None: - '''Reset the index to the start of the phrase''' + """Reset the index to the start of the phrase""" self._index = 0 def index_at_end(self) -> bool: - '''Returns True if the index is at the end of the phrase''' + """Returns True if the index is at the end of the phrase""" return self._index == len(self._characters) def character_is_at_current_index(self, character) -> bool: - '''Returns True if the given character is the next character in the phrase''' + """Returns True if the given character is the next character in the phrase""" return self.get_character_at_current_index() == character class Rule: - '''Represents the relationship between a phrase to be substituted and its substitution''' + """Represents the relationship between a phrase to be substituted and its \ + substitution""" def __init__(self, to_substitute: Phrase, substitution: Phrase) -> None: self.to_substitute: Phrase = to_substitute self.substitution: Phrase = substitution def restart(self) -> None: - '''Resets this rule's to_substitute and substitution phrases''' + """Resets this rule's to_substitute and substitution phrases""" self.to_substitute.reset_index() self.substitution.reset_index() @@ -129,7 +131,8 @@ def process_key(self, keyboard, key, is_pressed, int_coord): if is_pressed: character = Character(key, self._shifted) - # run through the dictionary to check for a possible match on each new keypress + # run through the dictionary to check for a possible match on each new + # keypress for rule in self._rules: if rule.to_substitute.character_is_at_current_index(character): rule.to_substitute.next_character() @@ -158,7 +161,8 @@ def process_key(self, keyboard, key, is_pressed, int_coord): break self._matched_rule = rule self._state = State.DELETING - # if we have a match there's no reason to continue the full key processing, so return out + # if we have a match there's no reason to continue the full key + # processing, so return out return return key @@ -174,10 +178,11 @@ def before_hid_send(self, keyboard): return if self._state == State.DELETING: - # force-release modifiers so sending the replacement text doesn't interact with them - # it should not be possible for any modifiers other than shift to be held upon rule activation - # as a modified key won't send a keycode that is matched against the user's dictionary, - # but, just in case, we'll release those too + # force-release modifiers so sending the replacement text doesn't interact + # with them it should not be possible for any modifiers other than shift to + # be held upon rule activation as a modified key won't send a keycode that + # is matched against the user's dictionary, but, just in case, we'll + # release those too. modifiers_to_release = [ KC.LSFT, KC.RSFT, @@ -191,7 +196,7 @@ def before_hid_send(self, keyboard): for modifier in modifiers_to_release: keyboard.remove_key(modifier) - # send backspace taps equivalent to the length of the phrase to be substituted + # send backspace taps equivalent to length of phrase to be substituted to_substitute: Phrase = self._matched_rule.to_substitute # type: ignore to_substitute.next_character() if not to_substitute.index_at_end(): diff --git a/kmk/modules/tapdance.py b/kmk/modules/tapdance.py index 8843fcd25..10f6ef7ac 100644 --- a/kmk/modules/tapdance.py +++ b/kmk/modules/tapdance.py @@ -4,11 +4,11 @@ class TapDanceKeyMeta: def __init__(self, *keys, tap_time=None): - ''' + """ Any key in the tapdance sequence that is not already a holdtap key gets converted to a holdtap key with identical tap and hold meta attributes. - ''' + """ self.tap_time = tap_time self.keys = [] @@ -32,7 +32,7 @@ def __init__(self): super().__init__() make_argumented_key( validator=TapDanceKeyMeta, - names=('TD',), + names=("TD",), on_press=self.td_pressed, on_release=self.td_released, ) diff --git a/kmk/scanners/__init__.py b/kmk/scanners/__init__.py index e3815be4e..891fdd2b9 100644 --- a/kmk/scanners/__init__.py +++ b/kmk/scanners/__init__.py @@ -3,13 +3,13 @@ def intify_coordinate(row, col, len_cols): class DiodeOrientation: - ''' + """ Orientation of diodes on handwired boards. You can think of: COLUMNS = vertical ROWS = horizontal COL2ROW and ROW2COL are equivalent to their meanings in QMK. - ''' + """ COLUMNS = 0 ROWS = 1 @@ -18,9 +18,9 @@ class DiodeOrientation: class Scanner: - ''' + """ Base class for scanners. - ''' + """ # for split keyboards, the offset value will be assigned in Split module offset = 0 @@ -34,9 +34,10 @@ def key_count(self): raise NotImplementedError def scan_for_changes(self): - ''' + """ Scan for key events and return a key report if an event exists. - The key report is a byte array with contents [row, col, True if pressed else False] - ''' + The key report is a byte array with contents: + [row, col, True if pressed else False] + """ raise NotImplementedError diff --git a/kmk/scanners/digitalio.py b/kmk/scanners/digitalio.py index 39a88b6f3..854933259 100644 --- a/kmk/scanners/digitalio.py +++ b/kmk/scanners/digitalio.py @@ -1,5 +1,4 @@ import digitalio - from keypad import Event as KeyEvent from kmk.scanners import DiodeOrientation, Scanner @@ -25,7 +24,7 @@ def __init__( unique_pins = {repr(c) for c in cols} | {repr(r) for r in rows} assert ( len(unique_pins) == self.len_cols + self.len_rows - ), 'Cannot use a pin as both a column and row' + ), "Cannot use a pin as both a column and row" del unique_pins self.diode_orientation = diode_orientation @@ -37,13 +36,13 @@ def __init__( if self.diode_orientation == DiodeOrientation.COLUMNS: self.outputs = [ x - if x.__class__.__name__ == 'DigitalInOut' + if x.__class__.__name__ == "DigitalInOut" else digitalio.DigitalInOut(x) for x in cols ] self.inputs = [ x - if x.__class__.__name__ == 'DigitalInOut' + if x.__class__.__name__ == "DigitalInOut" else digitalio.DigitalInOut(x) for x in rows ] @@ -51,19 +50,19 @@ def __init__( elif self.diode_orientation == DiodeOrientation.ROWS: self.outputs = [ x - if x.__class__.__name__ == 'DigitalInOut' + if x.__class__.__name__ == "DigitalInOut" else digitalio.DigitalInOut(x) for x in rows ] self.inputs = [ x - if x.__class__.__name__ == 'DigitalInOut' + if x.__class__.__name__ == "DigitalInOut" else digitalio.DigitalInOut(x) for x in cols ] self.translate_coords = False else: - raise ValueError(f'Invalid DiodeOrientation: {self.diode_orienttaion}') + raise ValueError(f"Invalid DiodeOrientation: {self.diode_orienttaion}") for pin in self.outputs: pin.switch_to_output() @@ -83,12 +82,12 @@ def key_count(self): return self._key_count def scan_for_changes(self): - ''' + """ Poll the matrix for changes and return either None (if nothing updated) or a bytearray (reused in later runs so copy this if you need the raw array itself for some crazy reason) consisting of (row, col, pressed) which are (int, int, bool) - ''' + """ ba_idx = 0 any_changed = False diff --git a/kmk/scanners/keypad.py b/kmk/scanners/keypad.py index c6b007aea..79330777c 100644 --- a/kmk/scanners/keypad.py +++ b/kmk/scanners/keypad.py @@ -4,23 +4,24 @@ class KeypadScanner(Scanner): - ''' + """ Translation layer around a CircuitPython 7 keypad scanner. :param pin_map: A sequence of (row, column) tuples for each key. :param kp: An instance of the keypad class. - ''' + """ @property def key_count(self): return self.keypad.key_count def scan_for_changes(self): - ''' + """ Scan for key events and return a key report if an event exists. - The key report is a byte array with contents [row, col, True if pressed else False] - ''' + The key report is a byte array with contents: + [row, col, True if pressed else False] + """ ev = self.keypad.events.get() if ev and self.offset: return keypad.Event(ev.key_number + self.offset, ev.pressed) @@ -28,13 +29,13 @@ def scan_for_changes(self): class MatrixScanner(KeypadScanner): - ''' + """ Row/Column matrix using the CircuitPython 7 keypad scanner. :param row_pins: A sequence of pins used for rows. :param col_pins: A sequence of pins used for columns. :param direction: The diode orientation of the matrix. - ''' + """ def __init__( self, @@ -56,11 +57,12 @@ def __init__( class KeysScanner(KeypadScanner): - ''' + """ GPIO-per-key 'matrix' using the native CircuitPython 7 keypad scanner. - :param pins: An array of arrays of CircuitPython Pin objects, such that pins[r][c] is the pin for row r, column c. - ''' + :param pins: An array of arrays of CircuitPython Pin objects, such that pins[r][c] + is the pin for row r, column c. + """ def __init__( self, diff --git a/kmk/transports/pio_uart.py b/kmk/transports/pio_uart.py index 0b30df6b6..a8ad9096d 100644 --- a/kmk/transports/pio_uart.py +++ b/kmk/transports/pio_uart.py @@ -1,11 +1,13 @@ -''' +""" Circuit Python wrapper around PIO implementation of UART -Original source of these examples: https://github.com/adafruit/Adafruit_CircuitPython_PIOASM/tree/main/examples (MIT) -''' -import rp2pio +Original source of these examples: +https://github.com/adafruit/Adafruit_CircuitPython_PIOASM/tree/main/examples (MIT) +""" from array import array -''' +import rp2pio + +""" .program uart_tx .side_set 1 opt ; An 8n1 UART transmit program. @@ -17,11 +19,11 @@ jmp x-- bitloop [6] ; Each loop iteration is 8 cycles. ; compiles to: -''' -tx_code = array('H', [40864, 63271, 24577, 1602]) +""" +tx_code = array("H", [40864, 63271, 24577, 1602]) -''' +""" .program uart_rx_mini ; Minimum viable 8n1 UART receiver. Wait for the start bit, then sample 8 bits @@ -36,8 +38,8 @@ jmp x-- bitloop [6] ; Each iteration is 8 cycles ; compiles to: -''' -rx_code = array('H', [8224, 59943, 16385, 1602]) +""" +rx_code = array("H", [8224, 59943, 16385, 1602]) class PIO_UART: diff --git a/kmk/types.py b/kmk/types.py index 4d05158fa..5078d6687 100644 --- a/kmk/types.py +++ b/kmk/types.py @@ -1,11 +1,11 @@ class AttrDict(dict): - ''' + """ Primitive support for accessing dictionary entries in dot notation. Mostly for user-facing stuff (allows for `k.KC_ESC` rather than `k['KC_ESC']`, which gets a bit obnoxious). This is read-only on purpose. - ''' + """ def __getattr__(self, key): return self[key] diff --git a/kmk/utils.py b/kmk/utils.py index a82c16a79..e623ad5ca 100644 --- a/kmk/utils.py +++ b/kmk/utils.py @@ -9,15 +9,15 @@ def clamp(x, bottom=0, top=100): class Debug: - '''default usage: + """default usage: debug = Debug(__name__) - ''' + """ def __init__(self, name=__name__): self.name = name def __call__(self, message): - print(f'{ticks_ms()} {self.name}: {message}') + print(f"{ticks_ms()} {self.name}: {message}") @property def enabled(self): diff --git a/pyproject.toml b/pyproject.toml index e4957af61..0dea16435 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,24 +1,28 @@ [tool.black] -# since black refuses to allow single-quotes... see locked conversation at -# https://github.com/psf/black/issues/594 -skip-string-normalization = true -target = "py36" -# explicitly exclude user_keymaps from black formatting rules -# because a visually-appealing keymap list will be flattened -# by black into a much harder to understand format -exclude = ''' -/( - \.git - | \.mypy_cache - | \.tox - | \.venv - | \.pytest_cache - | \.compiled - | dist - | boards - | build - | docs - | user_keymaps - | mnt -)/ -''' +target = ["py39"] + +[tool.isort] +profile = "black" + +# Ref: https://docs.circuitpython.org/en/latest/docs/library/index.html +extra_standard_library = [ + "array", + "btree", + "binascii", + "builtins", + "collections", + "errno", + "framebuf", + "gc", + "hashlib", + "heapq", + "io", + "json", + "micropython", + "re", + "select", + "sys", + "uasyncio", + "uctypes", + "zlib", +] \ No newline at end of file diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index f01079a5f..000000000 --- a/setup.cfg +++ /dev/null @@ -1,58 +0,0 @@ -[flake8] -exclude = .git,__pycache__,vendor,.venv,build,dist,.compiled,mnt -# match black expectations -max_line_length = 88 - -# enforce single quotes -docstring-quotes = ''' -multiline-quotes = ''' - -extend-ignore = - X100, E262, - # See https://github.com/PyCQA/pycodestyle/issues/373 - E203, - # comply with black - # it will handle line lengths automatically - E501, - # it also controls trailing commas in general - C812, C813, C815, - -per-file-ignores = -# Allow misaligned array entries, crazy line lengths, unused variables, -# multiple spaces after commas in lists (for grid alignment), and put -# your imports in whatever order you want - user_keymaps/**/*.py: E131,F401,E501,E241,E131,BLK100,I003 - boards/**/main.py: E131,F401,E501,E241,E131,BLK100,I003 - tests/test_data/keymaps/**/*.py: F401,E501 - -[isort] -known_standard_library = - analogio, - bitbangio, - bleio, - board, - busio, - digitalio, - framebuf, - gamepad, - gc, - machine, - microcontroller, - micropython, - neopixel, - pulseio, - pyb, - pyb, - pydux, - supervisor, - ubluepy, - uio, - uos, - usb_hid, - -# black compat -multi_line_output=3 -include_trailing_comma=True -force_grid_wrap=0 -use_parentheses=True -line_length=88 diff --git a/tests/keyboard_test.py b/tests/keyboard_test.py index 2e23d0478..176d970c6 100644 --- a/tests/keyboard_test.py +++ b/tests/keyboard_test.py @@ -53,7 +53,7 @@ def __init__( self.keyboard._init(hid_type=HIDModes.NOOP) - @patch('kmk.hid.AbstractHID.hid_send') + @patch("kmk.hid.AbstractHID.hid_send") def test(self, testname, key_events, assert_reports, hid_send): if self.debug_enabled: print(testname) @@ -111,9 +111,9 @@ def test(self, testname, key_events, assert_reports, hid_send): report_keys_names = {code2name(c) for c in report_keys} assert_keys_names = {code2name(c) for c in assert_keys} print( - f'assert ' - f'mods: {report_mods} == {assert_mods} ' - f'keys: {report_keys_names} == {assert_keys_names} ' + f"assert " + f"mods: {report_mods} == {assert_mods} " + f"keys: {report_keys_names} == {assert_keys_names} " ) assert matching, "reports don't match up" diff --git a/tests/mocks.py b/tests/mocks.py index 669977f94..4279026cd 100644 --- a/tests/mocks.py +++ b/tests/mocks.py @@ -10,20 +10,20 @@ def __init__(self, key_number, pressed): def init_circuit_python_modules_mocks(): - sys.modules['usb_hid'] = Mock() - sys.modules['digitalio'] = Mock() - sys.modules['neopixel'] = Mock() - sys.modules['pulseio'] = Mock() - sys.modules['busio'] = Mock() - sys.modules['microcontroller'] = Mock() - sys.modules['board'] = Mock() - sys.modules['storage'] = Mock() + sys.modules["usb_hid"] = Mock() + sys.modules["digitalio"] = Mock() + sys.modules["neopixel"] = Mock() + sys.modules["pulseio"] = Mock() + sys.modules["busio"] = Mock() + sys.modules["microcontroller"] = Mock() + sys.modules["board"] = Mock() + sys.modules["storage"] = Mock() - sys.modules['keypad'] = Mock() - sys.modules['keypad'].Event = KeyEvent + sys.modules["keypad"] = Mock() + sys.modules["keypad"].Event = KeyEvent - sys.modules['micropython'] = Mock() - sys.modules['micropython'].const = lambda x: x + sys.modules["micropython"] = Mock() + sys.modules["micropython"].const = lambda x: x - sys.modules['supervisor'] = Mock() - sys.modules['supervisor'].ticks_ms = lambda: time.time_ns() // 1_000_000 + sys.modules["supervisor"] = Mock() + sys.modules["supervisor"].ticks_ms = lambda: time.time_ns() // 1_000_000 diff --git a/tests/test_combos.py b/tests/test_combos.py index 3a2bc32cf..2b34a47e5 100644 --- a/tests/test_combos.py +++ b/tests/test_combos.py @@ -42,13 +42,13 @@ def test_chord(self): t_after = self.t_after keyboard.test( - 'match: 2 combo, within timeout', + "match: 2 combo, within timeout", [(0, True), t_within, (1, True), (0, False), (1, False), t_after], [{KC.X}, {}], ) keyboard.test( - 'match: 3 combo, within timeout, shuffled', + "match: 3 combo, within timeout, shuffled", [ (0, True), (2, True), @@ -62,7 +62,7 @@ def test_chord(self): ) keyboard.test( - 'match: 2 combo + overlap, after timeout', + "match: 2 combo + overlap, after timeout", [ (0, True), (1, True), @@ -77,7 +77,7 @@ def test_chord(self): ) keyboard.test( - 'match: 2 combo + overlap, interleaved, after timeout', + "match: 2 combo + overlap, interleaved, after timeout", [ (0, True), (1, True), @@ -93,7 +93,7 @@ def test_chord(self): ) keyboard.test( - 'match: 2 combo hold + other, interleaved, after timeout', + "match: 2 combo hold + other, interleaved, after timeout", [ (0, True), (1, True), @@ -108,7 +108,7 @@ def test_chord(self): ) keyboard.test( - 'match: 2 combo hold + overlap, interleaved, after timeout', + "match: 2 combo hold + overlap, interleaved, after timeout", [ (0, True), (1, True), @@ -124,7 +124,7 @@ def test_chord(self): ) keyboard.test( - 'match: other + 2 combo, after timeout', + "match: other + 2 combo, after timeout", [ (4, True), t_after, @@ -140,7 +140,7 @@ def test_chord(self): ) keyboard.test( - 'match: 2 combo + other, after timeout', + "match: 2 combo + other, after timeout", [ (0, True), (1, True), @@ -155,7 +155,7 @@ def test_chord(self): ) keyboard.test( - 'match: 2 combo, partial release and repeat', + "match: 2 combo, partial release and repeat", [ (0, True), (1, True), @@ -171,7 +171,7 @@ def test_chord(self): ) keyboard.test( - 'match: 2 combo, partial release and repeat', + "match: 2 combo, partial release and repeat", [ (0, True), (2, True), @@ -191,7 +191,7 @@ def test_chord(self): ) keyboard.test( - 'match: 2 combo + 2 combo, after timeout', + "match: 2 combo + 2 combo, after timeout", [ (0, True), (1, True), @@ -208,7 +208,7 @@ def test_chord(self): ) keyboard.test( - 'match: 2 combo hold + 2 combo, after timeout', + "match: 2 combo hold + 2 combo, after timeout", [ (0, True), (1, True), @@ -226,13 +226,13 @@ def test_chord(self): ) keyboard.test( - 'no match: partial combo, after timeout', + "no match: partial combo, after timeout", [(0, True), (0, False), t_after], [{KC.A}, {}], ) keyboard.test( - 'no match: partial combo, repeated', + "no match: partial combo, repeated", [ (0, True), (0, False), @@ -248,7 +248,7 @@ def test_chord(self): ) keyboard.test( - 'no match: partial combo, repeated', + "no match: partial combo, repeated", [ (0, True), (0, False), @@ -263,7 +263,7 @@ def test_chord(self): ) keyboard.test( - 'no match: 3 combo after timout', + "no match: 3 combo after timout", [ (0, True), (2, True), @@ -279,7 +279,7 @@ def test_chord(self): ) keyboard.test( - 'no match: other + 2 combo within timeout', + "no match: other + 2 combo within timeout", [ (4, True), t_within, @@ -295,7 +295,7 @@ def test_chord(self): ) keyboard.test( - 'no match: 2 combo + other within timeout', + "no match: 2 combo + other within timeout", [ (0, True), t_within, @@ -311,13 +311,13 @@ def test_chord(self): ) keyboard.test( - 'no match: 2 combo after timeout', + "no match: 2 combo after timeout", [(0, True), (0, False), t_after, (1, True), (1, False), t_after], [{KC.A}, {}, {KC.B}, {}], ) keyboard.test( - 'no match: Combo + other, within timeout', + "no match: Combo + other, within timeout", [ (0, True), (1, True), @@ -331,7 +331,7 @@ def test_chord(self): ) keyboard.test( - 'no match: Combo + other, within timeout', + "no match: Combo + other, within timeout", [ (0, True), (4, True), @@ -346,7 +346,7 @@ def test_chord(self): # test combos with layer switch keyboard.test( - 'match: Combo containing layer switch, within timeout', + "match: Combo containing layer switch, within timeout", [ (5, True), (2, True), @@ -358,7 +358,7 @@ def test_chord(self): ) keyboard.test( - 'no match: Combo containing layer switch + other, within timeout', + "no match: Combo containing layer switch + other, within timeout", [ (5, True), (0, True), @@ -370,7 +370,10 @@ def test_chord(self): ) keyboard.test( - 'match: Other pressed and released before combo, delay after other press but within the combo timeout', + """ + match: Other pressed and released before combo, delay after other press but + within the combo timeout. + """, [ (1, True), t_within, @@ -386,7 +389,10 @@ def test_chord(self): ) keyboard.test( - 'match: Other pressed and released before combo, delay after other release but within the combo timeout', + """ + match: Other pressed and released before combo, delay after other release + but within the combo timeout. + """, [ (1, True), (1, False), @@ -401,7 +407,10 @@ def test_chord(self): [{KC.B}, {}, {KC.Z}, {}], ) keyboard.test( - 'match: Other pressed and released before combo, delay after other pressed but within the combo timeout, other is part of another combo', + """ + match: Other pressed and released before combo, delay after other pressed + but within the combo timeout, other is part of another combo + """, [ (0, True), t_within, @@ -416,7 +425,10 @@ def test_chord(self): [{KC.A}, {}, {KC.Z}, {}], ) keyboard.test( - 'match: Other pressed and released before combo, delay after other release but within the combo timeout, other is part of another combo', + """ + match: Other pressed and released before combo, delay after other release + but within the combo timeout, other is part of another combo. + """, [ (0, True), (0, False), @@ -439,25 +451,25 @@ def test_sequence(self): keyboard.keyboard.active_layers = [1] keyboard.test( - 'match: leader sequence, within timeout', + "match: leader sequence, within timeout", [(5, True), (5, False), t_within, (0, True), (0, False), t_after], [{KC.V}, {}], ) keyboard.test( - 'match: 2 sequence, within timeout', + "match: 2 sequence, within timeout", [(0, True), (0, False), t_within, (1, True), (1, False), t_after], [{KC.X}, {}], ) keyboard.test( - 'match: 2 sequence, within long timeout', + "match: 2 sequence, within long timeout", [(2, True), (2, False), 2 * t_within, (3, True), (3, False), 2 * t_after], [{KC.Z}, {}], ) keyboard.test( - 'match: 3 sequence, within timeout', + "match: 3 sequence, within timeout", [ (0, True), (0, False), @@ -473,7 +485,7 @@ def test_sequence(self): ) keyboard.test( - 'match: 3 sequence, same key, within timeout', + "match: 3 sequence, same key, within timeout", [ (0, True), (0, False), @@ -489,7 +501,7 @@ def test_sequence(self): ) keyboard.test( - 'match: 3 sequence hold + other, within timeout', + "match: 3 sequence hold + other, within timeout", [ (0, True), (0, False), @@ -506,7 +518,7 @@ def test_sequence(self): ) keyboard.test( - 'match: 3 sequence, partial release and repeat', + "match: 3 sequence, partial release and repeat", [ (2, True), (1, True), @@ -524,17 +536,17 @@ def test_sequence(self): ) keyboard.test( - 'no match: 2 sequence, after timeout', + "no match: 2 sequence, after timeout", [(0, True), (0, False), t_after, (1, True), (1, False), t_after], [{KC.N1}, {}, {KC.N2}, {}], ) keyboard.test( - 'no match: 2 sequence, out of order', + "no match: 2 sequence, out of order", [(1, True), (1, False), t_within, (0, True), (0, False), t_after], [{KC.N2}, {}, {KC.N1}, {}], ) -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/tests/test_hold_tap.py b/tests/test_hold_tap.py index dcee4b854..03cbcf274 100644 --- a/tests/test_hold_tap.py +++ b/tests/test_hold_tap.py @@ -18,90 +18,90 @@ def test_holdtap(self): debug_enabled=False, ) - keyboard.test('MT tap behaviour', [(0, True), 100, (0, False)], [{KC.A}, {}]) + keyboard.test("MT tap behaviour", [(0, True), 100, (0, False)], [{KC.A}, {}]) keyboard.test( - 'MT hold behaviour', [(0, True), 350, (0, False)], [{KC.LCTL}, {}] + "MT hold behaviour", [(0, True), 350, (0, False)], [{KC.LCTL}, {}] ) # TODO test multiple mods being held # MT keyboard.test( - 'MT within tap time sequential -> tap behavior', + "MT within tap time sequential -> tap behavior", [(0, True), 100, (0, False), (3, True), (3, False)], [{KC.A}, {}, {KC.D}, {}], ) keyboard.test( - 'MT within tap time rolling -> hold behavior', + "MT within tap time rolling -> hold behavior", [(0, True), 100, (3, True), 250, (0, False), (3, False)], [{KC.LCTL}, {KC.LCTL, KC.D}, {KC.D}, {}], ) keyboard.test( - 'MT within tap time nested -> hold behavior', + "MT within tap time nested -> hold behavior", [(0, True), 100, (3, True), (3, False), 250, (0, False)], [{KC.LCTL}, {KC.LCTL, KC.D}, {KC.LCTL}, {}], ) keyboard.test( - 'MT after tap time sequential -> hold behavior', + "MT after tap time sequential -> hold behavior", [(0, True), 350, (0, False), (3, True), (3, False)], [{KC.LCTL}, {}, {KC.D}, {}], ) keyboard.test( - 'MT after tap time rolling -> hold behavior', + "MT after tap time rolling -> hold behavior", [(0, True), 350, (3, True), (0, False), (3, False)], [{KC.LCTL}, {KC.LCTL, KC.D}, {KC.D}, {}], ) keyboard.test( - 'MT after tap time nested -> hold behavior', + "MT after tap time nested -> hold behavior", [(0, True), 350, (3, True), (3, False), (0, False)], [{KC.LCTL}, {KC.LCTL, KC.D}, {KC.LCTL}, {}], ) # LT keyboard.test( - 'LT within tap time sequential -> tap behavior', + "LT within tap time sequential -> tap behavior", [(1, True), 100, (1, False), (3, True), (3, False)], [{KC.B}, {}, {KC.D}, {}], ) keyboard.test( - 'LT within tap time rolling -> tap behavior', + "LT within tap time rolling -> tap behavior", [(1, True), 100, (3, True), 250, (1, False), (3, False)], [{KC.B}, {KC.B, KC.D}, {KC.D}, {}], ) keyboard.test( - 'LT within tap time nested -> tap behavior', + "LT within tap time nested -> tap behavior", [(1, True), 100, (3, True), (3, False), 250, (1, False)], [{KC.B}, {KC.B, KC.D}, {KC.B}, {}], ) keyboard.test( - 'LT after tap time sequential -> hold behavior', + "LT after tap time sequential -> hold behavior", [(1, True), 350, (1, False), (3, True), (3, False)], [{KC.D}, {}], ) keyboard.test( - 'LT after tap time rolling -> hold behavior', + "LT after tap time rolling -> hold behavior", [(1, True), 350, (3, True), (1, False), (3, False)], [{KC.N4}, {}], ) keyboard.test( - 'LT after tap time nested -> hold behavior', + "LT after tap time nested -> hold behavior", [(1, True), 350, (3, True), (3, False), (1, False)], [{KC.N4}, {}], ) keyboard.test( - 'LT after tap time nested -> hold behavior', + "LT after tap time nested -> hold behavior", [ (0, True), 350, @@ -138,7 +138,7 @@ def test_holdtap_chain(self): t_after = 60 keyboard.test( - 'chained 0', + "chained 0", [(1, True), (2, True), (0, True), (0, False), (2, False), (1, False)], [ {KC.LCTL}, @@ -151,7 +151,7 @@ def test_holdtap_chain(self): ) keyboard.test( - 'chained 1', + "chained 1", [(2, True), (1, True), (0, True), (0, False), (1, False), (2, False)], [ {KC.LCTL}, @@ -164,7 +164,7 @@ def test_holdtap_chain(self): ) keyboard.test( - 'chained 2', + "chained 2", [(1, True), (2, True), (0, True), (1, False), (2, False), (0, False)], [ {KC.LCTL}, @@ -177,7 +177,7 @@ def test_holdtap_chain(self): ) keyboard.test( - 'chained 3', + "chained 3", [(1, True), (3, True), (0, True), (0, False), (1, False), (3, False)], [ {KC.LCTL}, @@ -190,13 +190,13 @@ def test_holdtap_chain(self): ) keyboard.test( - 'chained 4', + "chained 4", [(1, True), (3, True), (0, True), (3, False), (1, False), (0, False)], [{KC.LCTL}, {KC.LCTL, KC.N3, KC.N0}, {KC.LCTL, KC.N0}, {KC.N0}, {}], ) keyboard.test( - 'chained 5', + "chained 5", [(3, True), (1, True), (0, True), (0, False), (1, False), (3, False)], [ {KC.LCTL}, @@ -209,7 +209,7 @@ def test_holdtap_chain(self): ) keyboard.test( - 'chained 6', + "chained 6", [ (3, True), (1, True), @@ -230,7 +230,7 @@ def test_holdtap_chain(self): ) keyboard.test( - 'chained 7', + "chained 7", [ (1, True), (3, True), @@ -251,7 +251,7 @@ def test_holdtap_chain(self): ) keyboard.test( - 'chained 8', + "chained 8", [(2, True), (3, True), (0, True), (0, False), (2, False), (3, False)], [ {KC.LSFT}, @@ -285,43 +285,43 @@ def test_oneshot(self): # OS keyboard.test( - 'OS timed out', + "OS timed out", [(4, True), (4, False), t_after], [{KC.E}, {}], ) keyboard.test( - 'OS interrupt within tap time', + "OS interrupt within tap time", [(4, True), (4, False), t_within, (3, True), (3, False)], [{KC.E}, {KC.D, KC.E}, {}], ) keyboard.test( - 'OS interrupt, multiple within tap time', + "OS interrupt, multiple within tap time", [(4, True), (4, False), (3, True), (3, False), (2, True), (2, False)], [{KC.E}, {KC.D, KC.E}, {}, {KC.C}, {}], ) keyboard.test( - 'OS interrupt, multiple interleaved', + "OS interrupt, multiple interleaved", [(4, True), (4, False), (3, True), (2, True), (2, False), (3, False)], [{KC.E}, {KC.D, KC.E}, {KC.C, KC.D}, {KC.D}, {}], ) keyboard.test( - 'OS interrupt, multiple interleaved', + "OS interrupt, multiple interleaved", [(4, True), (4, False), (3, True), (2, True), (3, False), (2, False)], [{KC.E}, {KC.D, KC.E}, {KC.C, KC.D}, {KC.C}, {}], ) keyboard.test( - 'OS interrupt within tap time, hold', + "OS interrupt within tap time, hold", [(4, True), (3, True), (4, False), t_after, (3, False)], [{KC.E}, {KC.D, KC.E}, {KC.D}, {}], ) keyboard.test( - 'OS hold with multiple interrupt keys', + "OS hold with multiple interrupt keys", [ (4, True), t_within, @@ -335,5 +335,5 @@ def test_oneshot(self): ) -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/tests/test_kmk_extension_stringy_keymaps.py b/tests/test_kmk_extension_stringy_keymaps.py index 125b68caa..f7f44b746 100644 --- a/tests/test_kmk_extension_stringy_keymaps.py +++ b/tests/test_kmk_extension_stringy_keymaps.py @@ -8,18 +8,18 @@ class Test_extension_stringy_keymaps(unittest.TestCase): def test_basic_kmk_keyboard_replace_string_primary_name(self): keyboard = KeyboardTest( - [], [['1', '2', '3', '4']], extensions={StringyKeymaps()} + [], [["1", "2", "3", "4"]], extensions={StringyKeymaps()} ) - keyboard.test('Simple key press', [(0, True), (0, False)], [{KC.N1}, {}]) + keyboard.test("Simple key press", [(0, True), (0, False)], [{KC.N1}, {}]) def test_basic_kmk_keyboard_replace_string_secondary_name(self): keyboard = KeyboardTest( - [], [['N1', 'N2', 'N3', 'N4']], extensions={StringyKeymaps()} + [], [["N1", "N2", "N3", "N4"]], extensions={StringyKeymaps()} ) - keyboard.test('Simple key press', [(0, True), (0, False)], [{KC.N1}, {}]) + keyboard.test("Simple key press", [(0, True), (0, False)], [{KC.N1}, {}]) -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/tests/test_kmk_keyboard.py b/tests/test_kmk_keyboard.py index 237e5f3db..276aa6a7b 100644 --- a/tests/test_kmk_keyboard.py +++ b/tests/test_kmk_keyboard.py @@ -8,8 +8,8 @@ class TestKmkKeyboard(unittest.TestCase): def test_basic_kmk_keyboard(self): keyboard = KeyboardTest([], [[KC.N1, KC.N2, KC.N3, KC.N4]]) - keyboard.test('Simple key press', [(0, True), (0, False)], [{KC.N1}, {}]) + keyboard.test("Simple key press", [(0, True), (0, False)], [{KC.N1}, {}]) -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/tests/test_kmk_keys.py b/tests/test_kmk_keys.py index a06b14b4b..ef98019d6 100644 --- a/tests/test_kmk_keys.py +++ b/tests/test_kmk_keys.py @@ -14,14 +14,15 @@ def test_basic_kmk_keyboard(self): KC.RALT(KC.HASH), KC.RALT(KC.LSFT(KC.N3)), KC.RALT(KC.LSFT), - # Note: this is correct, if unusual, syntax. It's a useful test because it failed silently on previous builds. + # Note: this is correct, if unusual, syntax. It's a useful test + # because it failed silently on previous builds. KC.RALT(KC.LSFT)(KC.N3), KC.RALT, ] ], ) keyboard.test( - 'Shifted key', + "Shifted key", [(0, True), (0, False)], [ { @@ -32,7 +33,7 @@ def test_basic_kmk_keyboard(self): ], ) keyboard.test( - 'AltGr+Shifted key', + "AltGr+Shifted key", [(1, True), (1, False)], [ { @@ -44,7 +45,7 @@ def test_basic_kmk_keyboard(self): ], ) keyboard.test( - 'AltGr+Shift+key', + "AltGr+Shift+key", [(2, True), (2, False)], [ { @@ -56,7 +57,7 @@ def test_basic_kmk_keyboard(self): ], ) keyboard.test( - 'Shift+AltGr', + "Shift+AltGr", [(3, True), (3, False)], [ { @@ -67,7 +68,7 @@ def test_basic_kmk_keyboard(self): ], ) keyboard.test( - 'AltGr+Shift+key, alternate chaining', + "AltGr+Shift+key, alternate chaining", [(4, True), (4, False)], [ { @@ -79,7 +80,7 @@ def test_basic_kmk_keyboard(self): ], ) keyboard.test( - 'AltGr', + "AltGr", [(5, True), (5, False)], [ { @@ -134,17 +135,17 @@ def test_custom_key(self): created = make_key( KC.N2.code, names=( - 'EURO', - '€', + "EURO", + "€", ), has_modifiers={KC.LSFT.code, KC.ROPT.code}, ) - assert created is KC.get('EURO') - assert created is KC.get('€') + assert created is KC.get("EURO") + assert created is KC.get("€") def test_match_exactly_case(self): - created = make_key(names=('ThIs_Is_A_StRaNgE_kEy',)) - assert created is KC.get('ThIs_Is_A_StRaNgE_kEy') + created = make_key(names=("ThIs_Is_A_StRaNgE_kEy",)) + assert created is KC.get("ThIs_Is_A_StRaNgE_kEy") class TestKeys_index(unittest.TestCase): @@ -152,44 +153,44 @@ def setUp(self): KC.clear() def test_expected_code_uppercase(self): - assert 4 == KC['A'].code + assert 4 == KC["A"].code def test_expected_code_lowercase(self): - assert 4 == KC['a'].code + assert 4 == KC["a"].code def test_case_ignored_alpha(self): - upper_key = KC['A'] - lower_key = KC['a'] + upper_key = KC["A"] + lower_key = KC["a"] assert upper_key is lower_key def test_case_requested_order_irrelevant(self): - lower_key = KC['a'] - upper_key = KC['A'] + lower_key = KC["a"] + upper_key = KC["A"] assert upper_key is lower_key def test_invalid_key_upper(self): with self.assertRaises(ValueError): - KC['NOT_A_VALID_KEY'] + KC["NOT_A_VALID_KEY"] def test_invalid_key_lower(self): with self.assertRaises(ValueError): - KC['not_a_valid_key'] + KC["not_a_valid_key"] def test_custom_key(self): created = make_key( - KC['N2'].code, + KC["N2"].code, names=( - 'EURO', - '€', + "EURO", + "€", ), - has_modifiers={KC['LSFT'].code, KC['ROPT'].code}, + has_modifiers={KC["LSFT"].code, KC["ROPT"].code}, ) - assert created is KC['EURO'] - assert created is KC['€'] + assert created is KC["EURO"] + assert created is KC["€"] def test_match_exactly_case(self): - created = make_key(names=('ThIs_Is_A_StRaNgE_kEy',)) - assert created is KC['ThIs_Is_A_StRaNgE_kEy'] + created = make_key(names=("ThIs_Is_A_StRaNgE_kEy",)) + assert created is KC["ThIs_Is_A_StRaNgE_kEy"] class TestKeys_get(unittest.TestCase): @@ -197,19 +198,19 @@ def setUp(self): KC.clear() def test_expected_code_uppercase(self): - assert 4 == KC.get('A').code + assert 4 == KC.get("A").code def test_expected_code_lowercase(self): - assert 4 == KC.get('a').code + assert 4 == KC.get("a").code def test_case_ignored_alpha(self): - upper_key = KC.get('A') - lower_key = KC.get('a') + upper_key = KC.get("A") + lower_key = KC.get("a") assert upper_key is lower_key def test_case_requested_order_irrelevant(self): - lower_key = KC.get('a') - upper_key = KC.get('A') + lower_key = KC.get("a") + upper_key = KC.get("A") assert upper_key is lower_key def test_secondary_name(self): @@ -218,29 +219,29 @@ def test_secondary_name(self): assert primary_key is secondary_key def test_invalid_key_upper(self): - assert KC.get('INVALID_KEY') is None + assert KC.get("INVALID_KEY") is None def test_invalid_key_lower(self): - assert KC.get('not_a_valid_key') is None + assert KC.get("not_a_valid_key") is None def test_custom_key(self): created = make_key( - KC.get('N2').code, + KC.get("N2").code, names=( - 'EURO', - '€', + "EURO", + "€", ), - has_modifiers={KC.get('LSFT').code, KC.get('ROPT').code}, + has_modifiers={KC.get("LSFT").code, KC.get("ROPT").code}, ) - assert created is KC.get('EURO') - assert created is KC.get('€') + assert created is KC.get("EURO") + assert created is KC.get("€") def test_match_exactly_case(self): - created = make_key(names=('ThIs_Is_A_StRaNgE_kEy',)) - assert created is KC.get('ThIs_Is_A_StRaNgE_kEy') + created = make_key(names=("ThIs_Is_A_StRaNgE_kEy",)) + assert created is KC.get("ThIs_Is_A_StRaNgE_kEy") def test_underscore(self): - assert KC.get('_') + assert KC.get("_") # Some of these test appear silly, but they're testing we get the @@ -257,32 +258,32 @@ def test_make_key_new_instance(self): assert key1.code == key2.code def test_index_is_index(self): - assert KC['A'] is KC['A'] + assert KC["A"] is KC["A"] def test_index_is_dot(self): - assert KC['A'] is KC.A + assert KC["A"] is KC.A def test_index_is_get(self): - assert KC['A'] is KC.get('A') + assert KC["A"] is KC.get("A") def test_dot_is_dot(self): assert KC.A is KC.A def test_dot_is_index(self): - assert KC.A is KC['A'] + assert KC.A is KC["A"] def test_dot_is_get(self): - assert KC.A is KC.get('A') + assert KC.A is KC.get("A") def test_get_is_get(self): - assert KC.get('A') is KC.get('A') + assert KC.get("A") is KC.get("A") def test_get_is_index(self): - assert KC.get('A') is KC['A'] + assert KC.get("A") is KC["A"] def test_get_is_dot(self): - assert KC.get('A') is KC.A + assert KC.get("A") is KC.A -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/tests/test_layers.py b/tests/test_layers.py index 2a830d677..9682a3c87 100644 --- a/tests/test_layers.py +++ b/tests/test_layers.py @@ -18,11 +18,11 @@ def setUp(self): def test_layermod(self): self.kb.test( - 'Layer + Mod', + "Layer + Mod", [(1, True), (0, True), (1, False), (0, False)], [{KC.LCTL}, {KC.LCTL, KC.A}, {KC.A}, {}], ) -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/tests/test_sticky_mod.py b/tests/test_sticky_mod.py index 92c13eb73..bc328da83 100644 --- a/tests/test_sticky_mod.py +++ b/tests/test_sticky_mod.py @@ -33,7 +33,7 @@ def test_basic_kmk_keyboard(self): ) keyboard.test( - 'basic test', + "basic test", [ (4, True), (4, False), @@ -56,7 +56,7 @@ def test_basic_kmk_keyboard(self): ) keyboard.test( - 'basic test with MO', + "basic test with MO", [ (1, True), (1, False), @@ -109,5 +109,5 @@ def test_basic_kmk_keyboard(self): ) -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/tests/test_string_substitution.py b/tests/test_string_substitution.py index ae49d923f..dca11dd39 100644 --- a/tests/test_string_substitution.py +++ b/tests/test_string_substitution.py @@ -7,18 +7,18 @@ class TestStringSubstitution(unittest.TestCase): def setUp(self) -> None: - self.symbols = '`-=[]\\;\',./~!@#$%^&*()_+{}|:\"<>?' + self.symbols = "`-=[]\\;',./~!@#$%^&*()_+{}|:\"<>?" self.everything = ALL_NUMBERS + ALL_ALPHAS + ALL_ALPHAS.lower() + self.symbols self.test_dictionary = { - 'aa': 'b', - 'b': 'aa', - '!': '@', - 'dccc': 'dcbb', - 'dadadada': 'dabaaaab', - 'ccc': 'z', - 'cccc': 'y', - 'AAA': 'BBB', - 'B': 'A', + "aa": "b", + "b": "aa", + "!": "@", + "dccc": "dcbb", + "dadadada": "dabaaaab", + "ccc": "z", + "cccc": "y", + "AAA": "BBB", + "B": "A", } self.string_substitution = StringSubstitution(self.test_dictionary) self.keyboard = KeyboardTest( @@ -45,26 +45,29 @@ def test_keyboard_events_are_correct(self): # backspace doesn't have to fire for the final key pressed # that results in a corresponding match, as that key is never sent self.keyboard.test( - 'multi-character key, single-character value', + "multi-character key, single-character value", [(0, True), (0, False), (0, True), (0, False), 50], [{KC.A}, {}, {KC.BACKSPACE}, {}, {KC.B}, {}], ) # note: the pressed key is never sent here, as the event is # intercepted and the replacement is sent instead self.keyboard.test( - 'multi-character value, single-character key', + "multi-character value, single-character key", [(1, True), (1, False), 50], [{KC.A}, {}, {KC.A}, {}], ) # modifiers are force-released if there's a match, # so the keyup event for them isn't sent self.keyboard.test( - 'shifted alphanumeric or symbol in key and/or value', + "shifted alphanumeric or symbol in key and/or value", [(3, True), (2, True), (2, False), (3, False), 50], [{KC.LSHIFT}, {KC.LSHIFT, KC.N2}, {}], ) self.keyboard.test( - 'backspace is only tapped as many times as necessary to delete the difference between the key and value', + """ + backspace is only tapped as many times as necessary to delete the difference + between the key and value. + """, [ (6, True), (6, False), @@ -92,7 +95,7 @@ def test_keyboard_events_are_correct(self): ], ) self.keyboard.test( - 'the presence of non-shift modifiers prevents a multi-character match', + "the presence of non-shift modifiers prevents a multi-character match", [(4, True), (0, True), (0, False), (0, True), (0, False), (4, False), 50], [ {KC.LCTRL}, @@ -104,7 +107,7 @@ def test_keyboard_events_are_correct(self): ], ) self.keyboard.test( - 'the presence of non-shift modifiers prevents a single-character match', + "the presence of non-shift modifiers prevents a single-character match", [(4, True), (1, True), (1, False), (4, False), 50], [ {KC.LCTRL}, @@ -114,7 +117,7 @@ def test_keyboard_events_are_correct(self): ], ) self.keyboard.test( - 'the presence of non-shift modifiers resets current potential matches', + "the presence of non-shift modifiers resets current potential matches", [(0, True), (0, False), (4, True), (0, True), (0, False), (4, False), 50], [ {KC.A}, @@ -127,7 +130,7 @@ def test_keyboard_events_are_correct(self): ) self.keyboard.test( - 'match found and replaced when there are preceding characters', + "match found and replaced when there are preceding characters", [(5, True), (5, False), (0, True), (0, False), (0, True), (0, False), 50], [ {KC.C}, @@ -141,7 +144,10 @@ def test_keyboard_events_are_correct(self): ], ) self.keyboard.test( - 'match found and replaced when there are trailing characters, and the trailing characters are sent', + """ + match found and replaced when there are trailing characters, and the + trailing characters are sent. + """, [(0, True), (0, False), (0, True), (0, False), (5, True), (5, False), 50], [ {KC.A}, @@ -155,7 +161,7 @@ def test_keyboard_events_are_correct(self): ], ) self.keyboard.test( - 'no match', + "no match", [(0, True), (0, False), (2, True), (2, False), 50], [ {KC.A}, @@ -165,7 +171,7 @@ def test_keyboard_events_are_correct(self): ], ) self.keyboard.test( - 'multiple backspaces', + "multiple backspaces", [ (6, True), (6, False), @@ -228,7 +234,7 @@ def test_keyboard_events_are_correct(self): # also covers the case where the next character the user types after a match # would lead to a different match that should be unreachable self.keyboard.test( - 'with multiple potential matches, only the first one is used', + "with multiple potential matches, only the first one is used", [ (5, True), (5, False), @@ -262,7 +268,7 @@ def test_keyboard_events_are_correct(self): # when the state changes to State.DELETING - so no modified backspace, # and no RSHIFT keyup event self.keyboard.test( - 'right shift acts as left shift', + "right shift acts as left shift", [ (7, True), (0, True), @@ -293,7 +299,7 @@ def test_keyboard_events_are_correct(self): ], ) self.keyboard.test( - 'multiple modifiers should not result in a match', + "multiple modifiers should not result in a match", [ (8, True), (4, True), @@ -317,7 +323,7 @@ def test_keyboard_events_are_correct(self): ], ) self.keyboard.test( - 'modifier + shift should not result in a match', + "modifier + shift should not result in a match", [ (8, True), (3, True), @@ -339,14 +345,14 @@ def test_keyboard_events_are_correct(self): def test_invalid_character_in_dictionary_throws_error(self): dict = { - 'illegal_character_in_key': {'é': 'a'}, - 'illegal_character_in_value': {'a': 'é'}, + "illegal_character_in_key": {"é": "a"}, + "illegal_character_in_value": {"a": "é"}, } self.assertRaises( - ValueError, StringSubstitution, dict['illegal_character_in_key'] + ValueError, StringSubstitution, dict["illegal_character_in_key"] ) self.assertRaises( - ValueError, StringSubstitution, dict['illegal_character_in_value'] + ValueError, StringSubstitution, dict["illegal_character_in_value"] ) def test_character_constructs_properly(self): @@ -356,17 +362,17 @@ def test_character_constructs_properly(self): self.assertEqual( unshifted_character.key_code, KC.A, - 'unshifted character key code is correct', + "unshifted character key code is correct", ) self.assertEqual( shifted_letter.key_code.__dict__, KC.LSHIFT(KC.A).__dict__, - 'shifted letter key code is correct', + "shifted letter key code is correct", ) self.assertEqual( shifted_symbol.key_code.__dict__, KC.LSHIFT(KC.N1).__dict__, - 'shifted symbol key code is correct', + "shifted symbol key code is correct", ) def test_phrase_constructs_properly(self): @@ -380,7 +386,7 @@ def test_phrase_constructs_properly(self): self.assertEqual( phrase.get_character_at_index(0).key_code, KC[letter], - f'Test failed when constructing phrase with lower-case letter {letter}', + f"Test failed when constructing phrase with lower-case letter {letter}", ) # upper case for letter in ALL_ALPHAS: @@ -388,7 +394,7 @@ def test_phrase_constructs_properly(self): self.assertEqual( phrase.get_character_at_index(0).key_code.__dict__, KC.LSHIFT(KC[letter]).__dict__, - f'Test failed when constructing phrase with upper-case letter {letter}', + f"Test failed when constructing phrase with upper-case letter {letter}", ) # numbers for letter in ALL_NUMBERS: @@ -396,7 +402,7 @@ def test_phrase_constructs_properly(self): self.assertEqual( phrase.get_character_at_index(0).key_code, KC[letter], - f'Test failed when constructing phrase with number {letter}', + f"Test failed when constructing phrase with number {letter}", ) # multi-character phrase for i, character in enumerate(combination): @@ -405,7 +411,7 @@ def test_phrase_constructs_properly(self): KC.LSHIFT(KC[character]).__dict__ if combination[i].isupper() else KC[character].__dict__, - f'Test failed when constructing phrase with character {character}', + f"Test failed when constructing phrase with character {character}", ) def test_phrase_with_symbols_constructs_properly(self): @@ -414,7 +420,7 @@ def test_phrase_with_symbols_constructs_properly(self): self.assertEqual( phrase.get_character_at_index(i).key_code.__dict__, KC[symbol].__dict__, - 'Test failed for symbol {}'.format(symbol), + "Test failed for symbol {}".format(symbol), ) def test_phrase_indexes_correctly(self): @@ -423,27 +429,30 @@ def test_phrase_indexes_correctly(self): while not phrase.index_at_end(): self.assertTrue( phrase.character_is_at_current_index(phrase.get_character_at_index(i)), - 'Current character in the phrase is not the expected one', + "Current character in the phrase is not the expected one", ) self.assertEqual( phrase.get_character_at_index(i).key_code.__dict__, KC[ALL_ALPHAS[i]].__dict__, - f'Character at index {i} is not {ALL_ALPHAS[i]}', + f"Character at index {i} is not {ALL_ALPHAS[i]}", ) phrase.next_character() i += 1 self.assertLess( - i, len(ALL_ALPHAS) + 1, 'While loop checking phrase index ran too long' + i, len(ALL_ALPHAS) + 1, "While loop checking phrase index ran too long" ) phrase.reset_index() self.assertEqual( phrase.get_character_at_current_index().key_code, KC[ALL_ALPHAS[0]], - 'Phrase did not reset its index to 0', + "Phrase did not reset its index to 0", ) def test_sanity_check(self): - '''Test character/phrase construction with every letter, number, and symbol, shifted and unshifted''' + """ + Test character/phrase construction with every letter, number, and symbol, + shifted and unshifted. + """ phrase = Phrase(self.everything) for i, character in enumerate(self.everything): self.assertEqual( @@ -451,7 +460,7 @@ def test_sanity_check(self): KC.LSHIFT(KC[character]).__dict__ if self.everything[i].isupper() else KC[character].__dict__, - f'Test failed when constructing phrase with character {character}', + f"Test failed when constructing phrase with character {character}", ) def test_rule(self): @@ -470,14 +479,14 @@ def test_rule(self): self.assertEqual( rule.to_substitute.get_character_at_index(0).key_code, KC[self.everything[0]], - 'Rule did not call to_substitute.reset_index() when rule.restart() was called', + "Rule not called to_substitute.reset_index() when rule.restart() called", ) self.assertEqual( rule.substitution.get_character_at_index(0).key_code, KC[self.everything[0]], - 'Rule did not call substitution.reset_index() when rule.restart() was called', + "Rule not called substitution.reset_index() when rule.restart() called", ) -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/tests/test_tapdance.py b/tests/test_tapdance.py index cea5bc563..c499f2ec2 100644 --- a/tests/test_tapdance.py +++ b/tests/test_tapdance.py @@ -34,16 +34,16 @@ def test_normal_key(self): t_within = self.t_within t_after = self.t_after - keyboard.test('Tap x1', [(0, True), (0, False), t_after], [{KC.N0}, {}]) + keyboard.test("Tap x1", [(0, True), (0, False), t_after], [{KC.N0}, {}]) keyboard.test( - 'Tap x2', + "Tap x2", [(0, True), (0, False), t_within, (0, True), (0, False), t_after], [{KC.N1}, {}], ) keyboard.test( - 'Tap x3', + "Tap x3", [ (0, True), (0, False), @@ -57,25 +57,25 @@ def test_normal_key(self): ) keyboard.test( - 'Tap x1 interrupted', + "Tap x1 interrupted", [(0, True), (4, True), (4, False), (0, False)], [{KC.N0}, {KC.N0, KC.N4}, {KC.N0}, {}], ) keyboard.test( - 'Tap x1 interrupted', + "Tap x1 interrupted", [(0, True), (4, True), (0, False), (4, False)], [{KC.N0}, {KC.N0, KC.N4}, {KC.N4}, {}], ) keyboard.test( - 'Tap x1 interrupted', + "Tap x1 interrupted", [(0, True), (0, False), (4, True), (4, False)], [{KC.N0}, {KC.N4}, {}], ) keyboard.test( - 'Tap x2, interrupted', + "Tap x2, interrupted", [ (0, True), (0, False), @@ -93,24 +93,24 @@ def test_modtap(self): t_within = self.t_within t_after = self.t_after - keyboard.test('Tap x1', [(1, True), (1, False), t_after], [{KC.N1}, {}]) + keyboard.test("Tap x1", [(1, True), (1, False), t_after], [{KC.N1}, {}]) keyboard.test( - 'Tap x2', + "Tap x2", [(1, True), (1, False), t_within, (1, True), (1, False), 2 * t_after], [{KC.N2}, {}], ) - keyboard.test('Hold', [(1, True), t_after, (1, False)], [{KC.A}, {}]) + keyboard.test("Hold", [(1, True), t_after, (1, False)], [{KC.A}, {}]) keyboard.test( - 'Tap-Hold', + "Tap-Hold", [(1, True), (1, False), t_within, (1, True), 2 * t_after, (1, False)], [{KC.B}, {}], ) keyboard.test( - 'Tap-Hold interrupted', + "Tap-Hold interrupted", [ (1, True), (1, False), @@ -130,13 +130,13 @@ def test_multi_tapdance(self): t_after = self.t_after keyboard.test( - '', + "", [(0, True), (0, False), t_within, (1, True), (1, False), t_after], [{KC.N0}, {}, {KC.N1}, {}], ) keyboard.test( - '', + "", [ (0, True), (0, False), @@ -151,7 +151,7 @@ def test_multi_tapdance(self): ) keyboard.test( - '', + "", [ (2, True), (2, False), @@ -171,21 +171,21 @@ def test_layer(self): t_after = self.t_after keyboard.test( - '', + "", [(3, True), (3, False), t_within, (1, True), (1, False), t_after], [{KC.N3}, {}, {KC.N1}, {}], ) keyboard.test( - '', [(3, True), t_after, (1, True), (1, False), (3, False)], [{KC.N8}, {}] + "", [(3, True), t_after, (1, True), (1, False), (3, False)], [{KC.N8}, {}] ) keyboard.test( - '', [(3, True), t_after, (1, True), (3, False), (1, False)], [{KC.N8}, {}] + "", [(3, True), t_after, (1, True), (3, False), (1, False)], [{KC.N8}, {}] ) keyboard.test( - '', + "", [ (1, True), (3, True), @@ -204,7 +204,7 @@ def test_modtap_repeat(self): t_after = self.t_after keyboard.test( - 'ModTap repeat', + "ModTap repeat", [ (2, True), (2, False), @@ -218,5 +218,5 @@ def test_modtap_repeat(self): ) -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/user_keymaps/.git-blame-ignore-revs b/user_keymaps/.git-blame-ignore-revs new file mode 100644 index 000000000..89e58a766 --- /dev/null +++ b/user_keymaps/.git-blame-ignore-revs @@ -0,0 +1,2 @@ +# Ignore commit that changed from single to double quotes, in line with `black` +44b9b82be90196c8024fd8ea0a1a4658484447ee \ No newline at end of file diff --git a/user_keymaps/TellNoLies/lily58.py b/user_keymaps/TellNoLies/lily58.py index faa82e234..f05983c1c 100644 --- a/user_keymaps/TellNoLies/lily58.py +++ b/user_keymaps/TellNoLies/lily58.py @@ -1,9 +1,8 @@ -from kb import KMKKeyboard, data_pin +from kb import KMKKeyboard -from kmk.extensions.ble_split import BLE_Split from kmk.extensions.layers import Layers from kmk.keys import KC -from kmk.modules.split import Split, SplitSide, SplitType +from kmk.modules.split import Split, SplitSide keyboard = KMKKeyboard() @@ -35,6 +34,8 @@ extensions = [layers_ext, split] +# flake8: noqa +# fmt: off keyboard.keymap = [ [ #COLMAK_DH KC.ESC, KC.N1, KC.N2, KC.N3, KC.N4, KC.N5, KC.N6, KC.N7, KC.N8, KC.N9, KC.N0, KC.TILD,\ @@ -65,6 +66,7 @@ KC.LALT, KC.LGUI, KC.LSFT, ADJUST, ADJUST, RAISE, KC.VOLD, KC.VOLU, ] ] +# fmt: on -if __name__ == '__main__': +if __name__ == "__main__": keyboard.go() diff --git a/user_keymaps/ZFR_KBD/RP2.65-F.py b/user_keymaps/ZFR_KBD/RP2.65-F.py index bf22fe85a..145bed137 100644 --- a/user_keymaps/ZFR_KBD/RP2.65-F.py +++ b/user_keymaps/ZFR_KBD/RP2.65-F.py @@ -1,7 +1,6 @@ import board -import usb_hid - import ulab.numpy as np +import usb_hid from kb import KMKKeyboard from kmk.extensions.media_keys import MediaKeys @@ -183,6 +182,8 @@ def MN(note: str): return midi_keypress +# flake8: noqa +# fmt: off keyboard.keymap = [ [ # Base Layer KC.ESC, KC.GRAVE, KC.N1, KC.N2, KC.N3, KC.N4, KC.N5, KC.N6, KC.N7, KC.N8, KC.N9, KC.N0, KC.BSLS, KC.DEL, KC.MINS, KC.EQUAL, @@ -224,7 +225,7 @@ def MN(note: str): XXXXXXX, _______, _______, _______, _______, _______, _______, XXXXXXX, _______, _______, _______, ], ] +# fmt: on - -if __name__ == '__main__': +if __name__ == "__main__": keyboard.go() diff --git a/user_keymaps/dgriswo/pyKey60.py b/user_keymaps/dgriswo/pyKey60.py index 0ddbfba06..4ca38ea29 100755 --- a/user_keymaps/dgriswo/pyKey60.py +++ b/user_keymaps/dgriswo/pyKey60.py @@ -19,8 +19,20 @@ keyboard.extensions.append(rgb_ext) keyboard.col_pins = ( - board.COL1, board.COL2, board.COL3, board.COL4, board.COL5, board.COL6, board.COL7, - board.COL8, board.COL9, board.COL10, board.COL11, board.COL12, board.COL13, board.COL14, + board.COL1, + board.COL2, + board.COL3, + board.COL4, + board.COL5, + board.COL6, + board.COL7, + board.COL8, + board.COL9, + board.COL10, + board.COL11, + board.COL12, + board.COL13, + board.COL14, ) keyboard.row_pins = (board.ROW1, board.ROW2, board.ROW3, board.ROW4, board.ROW5) keyboard.diode_orientation = DiodeOrientation.COL2ROW @@ -28,6 +40,8 @@ FN = KC.MO(1) XXXXXXX = KC.TRNS +# flake8: noqa +# fmt: off keyboard.keymap = [ # Qwerty # ,-------------------------------------------------------------------------------------------------. @@ -68,6 +82,7 @@ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC.APP, XXXXXXX, XXXXXXX, XXXXXXX, ], ] +# fmt: on -if __name__ == '__main__': +if __name__ == "__main__": keyboard.go() diff --git a/user_keymaps/dzervas/lab68.py b/user_keymaps/dzervas/lab68.py index a92f99402..285fbf0a5 100644 --- a/user_keymaps/dzervas/lab68.py +++ b/user_keymaps/dzervas/lab68.py @@ -1,8 +1,7 @@ import board import busio -from digitalio import DigitalInOut, Direction, Pull - from adafruit_mcp230xx.mcp23017 import MCP23017 +from digitalio import DigitalInOut, Direction, Pull from kmk.hid import HIDModes from kmk.keys import KC @@ -25,10 +24,28 @@ keyboard.debug_enabled = True -keyboard.col_pins = (mcp.get_pin(8), mcp.get_pin(9), mcp.get_pin(10), mcp.get_pin(11), mcp.get_pin(12), mcp.get_pin(13), mcp.get_pin(14), mcp.get_pin(15), mcp.get_pin(4), mcp.get_pin(5), mcp.get_pin(6), mcp.get_pin(7), mcp.get_pin(3), mcp.get_pin(2), mcp.get_pin(1)) +keyboard.col_pins = ( + mcp.get_pin(8), + mcp.get_pin(9), + mcp.get_pin(10), + mcp.get_pin(11), + mcp.get_pin(12), + mcp.get_pin(13), + mcp.get_pin(14), + mcp.get_pin(15), + mcp.get_pin(4), + mcp.get_pin(5), + mcp.get_pin(6), + mcp.get_pin(7), + mcp.get_pin(3), + mcp.get_pin(2), + mcp.get_pin(1), +) keyboard.row_pins = (board.D7, board.D6, board.D5, board.D3, board.D2) keyboard.diode_orientation = DiodeOrientation.COLUMNS +# flake8: noqa +# fmt: off keyboard.keymap = [ # Qwerty # ,--------------------------------------------------------------------------------------------------------. @@ -72,7 +89,7 @@ KC.LCTL, KC.LGUI, KC.LALT, XXXXXXX, XXXXXXX, KC.SPC, XXXXXXX, XXXXXXX, FN, KC.RALT, KC.RCTL, KC.BT_PRV, XXXXXXX, _______, KC.BT_NXT, ], ] - -if __name__ == '__main__': - keyboard.go(hid_type=HIDModes.BLE, ble_name='Lab68') +# fmt: on +if __name__ == "__main__": + keyboard.go(hid_type=HIDModes.BLE, ble_name="Lab68") # keyboard.go(hid_type=HIDModes.USB) diff --git a/user_keymaps/jpconstantineau/batreus44_colemak_dh.py b/user_keymaps/jpconstantineau/batreus44_colemak_dh.py index 1a19cafa0..b3df74ae0 100644 --- a/user_keymaps/jpconstantineau/batreus44_colemak_dh.py +++ b/user_keymaps/jpconstantineau/batreus44_colemak_dh.py @@ -16,6 +16,8 @@ UPPER = KC.MO(2) XXXXXXX = KC.TRNS +# flake8: noqa +# fmt: off keyboard.keymap = [ # Colemak Mod-DH See https://colemakmods.github.io/mod-dh/keyboards.html [ @@ -37,7 +39,8 @@ UPPER, KC.VOLD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC.PSCR, KC.SLCK, KC.PAUS, ], ] +# fmt: on -if __name__ == '__main__': +if __name__ == "__main__": # keyboard.go(hid_type=HIDModes.BLE, ble_name='Batreus44') keyboard.go(hid_type=HIDModes.USB) diff --git a/user_keymaps/jpconstantineau/gridmx47.py b/user_keymaps/jpconstantineau/gridmx47.py index 2c4e70a6f..16a39afc5 100644 --- a/user_keymaps/jpconstantineau/gridmx47.py +++ b/user_keymaps/jpconstantineau/gridmx47.py @@ -12,7 +12,11 @@ keyboard = KMKKeyboard() keyboard.modules.append(Layers()) -rgb_ext = RGB(pixel_pin=keyboard.rgb_pixel_pin, num_pixels=keyboard.rgb_num_pixels, animation_mode=AnimationModes.STATIC) +rgb_ext = RGB( + pixel_pin=keyboard.rgb_pixel_pin, + num_pixels=keyboard.rgb_num_pixels, + animation_mode=AnimationModes.STATIC, +) keyboard.extensions.append(rgb_ext) FUN = KC.MO(1) @@ -25,6 +29,8 @@ RGB_R = KC.RGB_MODE_RAINBOW RGB_K = KC.RGB_MODE_KNIGHT +# flake8: noqa +# fmt: off keyboard.keymap = [ # Qwerty [ @@ -52,6 +58,7 @@ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX ], ] +# fmt: on -if __name__ == '__main__': +if __name__ == "__main__": keyboard.go() diff --git a/user_keymaps/jpconstantineau/offsetmx43.py b/user_keymaps/jpconstantineau/offsetmx43.py index 1749229f1..b2b8143f7 100644 --- a/user_keymaps/jpconstantineau/offsetmx43.py +++ b/user_keymaps/jpconstantineau/offsetmx43.py @@ -12,7 +12,11 @@ keyboard = KMKKeyboard() keyboard.modules.append(Layers()) -rgb_ext = RGB(pixel_pin=keyboard.rgb_pixel_pin, num_pixels=keyboard.rgb_num_pixels, animation_mode=AnimationModes.STATIC) +rgb_ext = RGB( + pixel_pin=keyboard.rgb_pixel_pin, + num_pixels=keyboard.rgb_num_pixels, + animation_mode=AnimationModes.STATIC, +) keyboard.extensions.append(rgb_ext) FUN = KC.MO(1) @@ -24,6 +28,8 @@ RGB_R = KC.RGB_MODE_RAINBOW RGB_K = KC.RGB_MODE_KNIGHT +# flake8: noqa +# fmt: off keyboard.keymap = [ # Qwerty [ @@ -45,6 +51,7 @@ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC.RGB_TOG, KC.RGB_MODE_PLAIN, KC.RGB_MODE_BREATHE, KC.RGB_MODE_RAINBOW ], ] +# fmt: on -if __name__ == '__main__': +if __name__ == "__main__": keyboard.go() diff --git a/user_keymaps/jpconstantineau/pyKey60.py b/user_keymaps/jpconstantineau/pyKey60.py index 9dcaf67f9..855369adf 100644 --- a/user_keymaps/jpconstantineau/pyKey60.py +++ b/user_keymaps/jpconstantineau/pyKey60.py @@ -11,13 +11,19 @@ keyboard = KMKKeyboard() keyboard.modules.append(Layers()) -rgb_ext = RGB(pixel_pin=keyboard.rgb_pixel_pin, num_pixels=keyboard.rgb_num_pixels, animation_mode=AnimationModes.STATIC) +rgb_ext = RGB( + pixel_pin=keyboard.rgb_pixel_pin, + num_pixels=keyboard.rgb_num_pixels, + animation_mode=AnimationModes.STATIC, +) keyboard.extensions.append(rgb_ext) FN = KC.MO(1) FN2 = KC.MO(2) XXXXXXX = KC.TRNS +# flake8: noqa +# fmt: off keyboard.keymap = [ # Qwerty # ,-------------------------------------------------------------------------------------------------. @@ -77,6 +83,7 @@ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC.LEFT, KC.DOWN, XXXXXXX, KC.RIGHT ], ] +# fmt: on -if __name__ == '__main__': +if __name__ == "__main__": keyboard.go() diff --git a/user_keymaps/jpconstantineau/vcolchoc44_colemak_dh.py b/user_keymaps/jpconstantineau/vcolchoc44_colemak_dh.py index 43c423958..29510cd12 100644 --- a/user_keymaps/jpconstantineau/vcolchoc44_colemak_dh.py +++ b/user_keymaps/jpconstantineau/vcolchoc44_colemak_dh.py @@ -12,7 +12,11 @@ keyboard = KMKKeyboard() keyboard.modules.append(Layers()) -rgb_ext = RGB(pixel_pin=keyboard.rgb_pixel_pin, num_pixels=keyboard.rgb_num_pixels, animation_mode=AnimationModes.STATIC) +rgb_ext = RGB( + pixel_pin=keyboard.rgb_pixel_pin, + num_pixels=keyboard.rgb_num_pixels, + animation_mode=AnimationModes.STATIC, +) keyboard.extensions.append(rgb_ext) FUN = KC.MO(1) @@ -24,6 +28,8 @@ RGB_R = KC.RGB_MODE_RAINBOW RGB_K = KC.RGB_MODE_KNIGHT +# flake8: noqa +# fmt: off keyboard.keymap = [ # Colemak Mod-DH See https://colemakmods.github.io/mod-dh/keyboards.html [ @@ -45,6 +51,7 @@ UPPER, KC.VOLD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC.PSCR, KC.SLCK, KC.PAUS, ], ] +# fmt: on -if __name__ == '__main__': +if __name__ == "__main__": keyboard.go() diff --git a/user_keymaps/jpconstantineau/vcolchoc44_qwerty.py b/user_keymaps/jpconstantineau/vcolchoc44_qwerty.py index 4549c913e..8fcc392e6 100644 --- a/user_keymaps/jpconstantineau/vcolchoc44_qwerty.py +++ b/user_keymaps/jpconstantineau/vcolchoc44_qwerty.py @@ -12,7 +12,11 @@ keyboard = KMKKeyboard() keyboard.modules.append(Layers()) -rgb_ext = RGB(pixel_pin=keyboard.rgb_pixel_pin, num_pixels=keyboard.rgb_num_pixels, animation_mode=AnimationModes.STATIC) +rgb_ext = RGB( + pixel_pin=keyboard.rgb_pixel_pin, + num_pixels=keyboard.rgb_num_pixels, + animation_mode=AnimationModes.STATIC, +) keyboard.extensions.append(rgb_ext) FUN = KC.MO(1) @@ -24,6 +28,8 @@ RGB_R = KC.RGB_MODE_RAINBOW RGB_K = KC.RGB_MODE_KNIGHT +# flake8: noqa +# fmt: off keyboard.keymap = [ # Qwerty [ @@ -45,6 +51,7 @@ UPPER, KC.VOLD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC.PSCR, KC.SLCK, KC.PAUS, ], ] +# fmt: on -if __name__ == '__main__': +if __name__ == "__main__": keyboard.go() diff --git a/user_keymaps/jpconstantineau/vcolmx44.py b/user_keymaps/jpconstantineau/vcolmx44.py index 8c9cb33a9..8bdb17cd4 100644 --- a/user_keymaps/jpconstantineau/vcolmx44.py +++ b/user_keymaps/jpconstantineau/vcolmx44.py @@ -12,7 +12,11 @@ keyboard = KMKKeyboard() keyboard.modules.append(Layers()) -rgb_ext = RGB(pixel_pin=keyboard.rgb_pixel_pin, num_pixels=keyboard.rgb_num_pixels, animation_mode=AnimationModes.STATIC) +rgb_ext = RGB( + pixel_pin=keyboard.rgb_pixel_pin, + num_pixels=keyboard.rgb_num_pixels, + animation_mode=AnimationModes.STATIC, +) keyboard.extensions.append(rgb_ext) FUN = KC.MO(1) @@ -24,6 +28,8 @@ RGB_R = KC.RGB_MODE_RAINBOW RGB_K = KC.RGB_MODE_KNIGHT +# flake8: noqa +# fmt: off keyboard.keymap = [ # Qwerty [ @@ -45,6 +51,7 @@ UPPER, KC.VOLD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC.PSCR, KC.SLCK, KC.PAUS, ], ] +# fmt: on -if __name__ == '__main__': +if __name__ == "__main__": keyboard.go() diff --git a/user_keymaps/kdb424/corne.py b/user_keymaps/kdb424/corne.py index 75adef986..a94563632 100644 --- a/user_keymaps/kdb424/corne.py +++ b/user_keymaps/kdb424/corne.py @@ -31,6 +31,8 @@ TAB_SB = KC.LT(5, KC.TAB) SUPER_L = KC.LM(4, KC.LGUI) +# flake8: noqa +# fmt: off keyboard.keymap = [ # DVORAK # ,-----------------------------------------. ,-----------------------------------------. @@ -149,8 +151,8 @@ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ _______, _______, _______, _______, _______, _______, ] - ] +# fmt: on -if __name__ == '__main__': +if __name__ == "__main__": keyboard.go(hid_type=HIDModes.USB) diff --git a/user_keymaps/kdb424/luddite.py b/user_keymaps/kdb424/luddite.py index 9738b02dd..7ab7e6ee6 100644 --- a/user_keymaps/kdb424/luddite.py +++ b/user_keymaps/kdb424/luddite.py @@ -36,9 +36,10 @@ SPC = KC.LT(FN1, KC.SPC) -# ---------------------- Keymap --------------------------------------------------------- - +# ---------------------- Keymap -------------------------------------------------------- +# flake8: noqa +# fmt: off keyboard.keymap = [ # df [ @@ -67,6 +68,7 @@ _______, _______, _______, _______, _______, _______, KC.DF(0), KC.DF(1), ], ] +# fmt: on -if __name__ == '__main__': +if __name__ == "__main__": keyboard.go() diff --git a/user_keymaps/kdb424/nyquist_r2.py b/user_keymaps/kdb424/nyquist_r2.py index 0d5b18d2a..c3609d0d1 100644 --- a/user_keymaps/kdb424/nyquist_r2.py +++ b/user_keymaps/kdb424/nyquist_r2.py @@ -35,6 +35,8 @@ # ---------------------- Keymap --------------------------------------------------------- +# flake8: noqa +# fmt: off keyboard.keymap = [ [ # df @@ -86,6 +88,7 @@ _______, _______, _______, KC.RGB_TOG, _______, _______, _______, _______, _______, _______, _______, _______ ], ] +# fmt: on if __name__ == '__main__': keyboard.go() diff --git a/user_keymaps/klardotsh/iris_r2.py b/user_keymaps/klardotsh/iris_r2.py index ae74e51b1..1a49ef6ee 100644 --- a/user_keymaps/klardotsh/iris_r2.py +++ b/user_keymaps/klardotsh/iris_r2.py @@ -16,49 +16,53 @@ keyboard.unicode_mode = UnicodeMode.LINUX keyboard.tap_time = 750 -emoticons = cuss({ - # Emojis - 'BEER': r'🍺', - 'BEER_TOAST': r'🍻', - 'FACE_CUTE_SMILE': r'😊', - 'FACE_HEART_EYES': r'😍', - 'FACE_JOY': r'😂', - 'FACE_SWEAT_SMILE': r'😅', - 'FACE_THINKING': r'🤔', - 'FIRE': r'🔥', - 'FLAG_CA': r'🇨🇦', - 'FLAG_US': r'🇺🇸', - 'HAND_CLAP': r'👏', - 'HAND_HORNS': r'🤘', - 'HAND_OK': r'👌', - 'HAND_THUMB_DOWN': r'👎', - 'HAND_THUMB_UP': r'👍', - 'HAND_WAVE': r'👋', - 'HEART': r'❤️', - 'MAPLE_LEAF': r'🍁', - 'POOP': r'💩', - 'TADA': r'🎉', - 'SHRUG_EMOJI': r'🤷', - - # Emoticons, but fancier - 'ANGRY_TABLE_FLIP': r'(ノಠ痊ಠ)ノ彡┻━┻', - 'CELEBRATORY_GLITTER': r'+。:.゚ヽ(´∀。)ノ゚.:。+゚゚+。:.゚ヽ(*´∀)ノ゚.:。+゚', - 'SHRUGGIE': r'¯\_(ツ)_/¯', - 'TABLE_FLIP': r'(╯°□°)╯︵ ┻━┻', -}) +emoticons = cuss( + { + # Emojis + "BEER": r"🍺", + "BEER_TOAST": r"🍻", + "FACE_CUTE_SMILE": r"😊", + "FACE_HEART_EYES": r"😍", + "FACE_JOY": r"😂", + "FACE_SWEAT_SMILE": r"😅", + "FACE_THINKING": r"🤔", + "FIRE": r"🔥", + "FLAG_CA": r"🇨🇦", + "FLAG_US": r"🇺🇸", + "HAND_CLAP": r"👏", + "HAND_HORNS": r"🤘", + "HAND_OK": r"👌", + "HAND_THUMB_DOWN": r"👎", + "HAND_THUMB_UP": r"👍", + "HAND_WAVE": r"👋", + "HEART": r"❤️", + "MAPLE_LEAF": r"🍁", + "POOP": r"💩", + "TADA": r"🎉", + "SHRUG_EMOJI": r"🤷", + # Emoticons, but fancier + "ANGRY_TABLE_FLIP": r"(ノಠ痊ಠ)ノ彡┻━┻", + "CELEBRATORY_GLITTER": r"+。:.゚ヽ(´∀。)ノ゚.:。+゚゚+。:.゚ヽ(*´∀)ノ゚.:。+゚", + "SHRUGGIE": r"¯\_(ツ)_/¯", + "TABLE_FLIP": r"(╯°□°)╯︵ ┻━┻", + } +) -WPM = send_string('Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Bibendum arcu vitae elementum curabitur vitae nunc sed. Facilisis sed odio morbi quis.') +WPM = send_string( + "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Bibendum arcu vitae elementum curabitur vitae nunc sed. Facilisis sed odio morbi quis." +) _______ = KC.TRNS xxxxxxx = KC.NO HELLA_TD = KC.TD( KC.A, KC.B, - send_string('macros in a tap dance? I think yes'), + send_string("macros in a tap dance? I think yes"), KC.TG(1), ) - +# flake8: noqa +# fmt: off keyboard.keymap = [ [ KC.GESC, KC.N1, KC.N2, KC.N3, KC.N4, KC.N5, KC.N6, KC.N7, KC.N8, KC.N9, KC.N0, KC.BSPC, @@ -82,6 +86,7 @@ KC.HOME, KC.END, _______, KC.VOLD, KC.PGUP, KC.PGDN, ], ] +# fmt: on -if __name__ == '__main__': +if __name__ == "__main__": keyboard.go() diff --git a/user_keymaps/klardotsh/iris_r2_nn.py b/user_keymaps/klardotsh/iris_r2_nn.py index d06877068..d61ff7fb1 100644 --- a/user_keymaps/klardotsh/iris_r2_nn.py +++ b/user_keymaps/klardotsh/iris_r2_nn.py @@ -16,40 +16,43 @@ keyboard.unicode_mode = UnicodeMode.LINUX keyboard.tap_time = 750 -emoticons = cuss({ - # Emojis - 'BEER': r'🍺', - 'BEER_TOAST': r'🍻', - 'FACE_CUTE_SMILE': r'😊', - 'FACE_HEART_EYES': r'😍', - 'FACE_JOY': r'😂', - 'FACE_SWEAT_SMILE': r'😅', - 'FACE_THINKING': r'🤔', - 'FIRE': r'🔥', - 'FLAG_CA': r'🇨🇦', - 'FLAG_US': r'🇺🇸', - 'HAND_CLAP': r'👏', - 'HAND_HORNS': r'🤘', - 'HAND_OK': r'👌', - 'HAND_THUMB_DOWN': r'👎', - 'HAND_THUMB_UP': r'👍', - 'HAND_WAVE': r'👋', - 'HEART': r'❤️', - 'MAPLE_LEAF': r'🍁', - 'POOP': r'💩', - 'TADA': r'🎉', - 'SHRUG_EMOJI': r'🤷', - - # Emoticons, but fancier - 'ANGRY_TABLE_FLIP': r'(ノಠ痊ಠ)ノ彡┻━┻', - 'CELEBRATORY_GLITTER': r'+。:.゚ヽ(´∀。)ノ゚.:。+゚゚+。:.゚ヽ(*´∀)ノ゚.:。+゚', - 'SHRUGGIE': r'¯\_(ツ)_/¯', - 'TABLE_FLIP': r'(╯°□°)╯︵ ┻━┻', -}) +emoticons = cuss( + { + # Emojis + "BEER": r"🍺", + "BEER_TOAST": r"🍻", + "FACE_CUTE_SMILE": r"😊", + "FACE_HEART_EYES": r"😍", + "FACE_JOY": r"😂", + "FACE_SWEAT_SMILE": r"😅", + "FACE_THINKING": r"🤔", + "FIRE": r"🔥", + "FLAG_CA": r"🇨🇦", + "FLAG_US": r"🇺🇸", + "HAND_CLAP": r"👏", + "HAND_HORNS": r"🤘", + "HAND_OK": r"👌", + "HAND_THUMB_DOWN": r"👎", + "HAND_THUMB_UP": r"👍", + "HAND_WAVE": r"👋", + "HEART": r"❤️", + "MAPLE_LEAF": r"🍁", + "POOP": r"💩", + "TADA": r"🎉", + "SHRUG_EMOJI": r"🤷", + # Emoticons, but fancier + "ANGRY_TABLE_FLIP": r"(ノಠ痊ಠ)ノ彡┻━┻", + "CELEBRATORY_GLITTER": r"+。:.゚ヽ(´∀。)ノ゚.:。+゚゚+。:.゚ヽ(*´∀)ノ゚.:。+゚", + "SHRUGGIE": r"¯\_(ツ)_/¯", + "TABLE_FLIP": r"(╯°□°)╯︵ ┻━┻", + } +) _______ = KC.TRNS xxxxxxx = KC.NO +# flake8: noqa +# fmt: off keyboard.keymap = [ [ KC.GESC, KC.N1, KC.N2, KC.N3, KC.N4, KC.N5, KC.N6, KC.N7, KC.N8, KC.N9, KC.N0, KC.BSPC, @@ -73,6 +76,7 @@ KC.HOME, KC.END, _______, KC.VOLD, KC.PGUP, KC.PGDN, ], ] +# fmt: on -if __name__ == '__main__': +if __name__ == "__main__": keyboard.go() diff --git a/user_keymaps/klardotsh/klarank_featherm4.py b/user_keymaps/klardotsh/klarank_featherm4.py index a3832ad79..84627ff91 100644 --- a/user_keymaps/klardotsh/klarank_featherm4.py +++ b/user_keymaps/klardotsh/klarank_featherm4.py @@ -14,68 +14,71 @@ keyboard.unicode_mode = UnicodeMode.LINUX keyboard.tap_time = 750 -emoticons = cuss({ - # Emojis - 'BEER': r'🍺', - 'BEER_TOAST': r'🍻', - 'FACE_CUTE_SMILE': r'😊', - 'FACE_HEART_EYES': r'😍', - 'FACE_JOY': r'😂', - 'FACE_SWEAT_SMILE': r'😅', - 'FACE_THINKING': r'🤔', - 'FIRE': r'🔥', - 'FLAG_CA': r'🇨🇦', - 'FLAG_US': r'🇺🇸', - 'HAND_CLAP': r'👏', - 'HAND_HORNS': r'🤘', - 'HAND_OK': r'👌', - 'HAND_THUMB_DOWN': r'👎', - 'HAND_THUMB_UP': r'👍', - 'HAND_WAVE': r'👋', - 'HEART': r'❤️', - 'MAPLE_LEAF': r'🍁', - 'POOP': r'💩', - 'TADA': r'🎉', - - # Emoticons, but fancier - 'ANGRY_TABLE_FLIP': r'(ノಠ痊ಠ)ノ彡┻━┻', - 'CELEBRATORY_GLITTER': r'+。:.゚ヽ(´∀。)ノ゚.:。+゚゚+。:.゚ヽ(*´∀)ノ゚.:。+゚', - 'SHRUGGIE': r'¯\_(ツ)_/¯', - 'TABLE_FLIP': r'(╯°□°)╯︵ ┻━┻', -}) - -WPM = send_string('Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Bibendum arcu vitae elementum curabitur vitae nunc sed. Facilisis sed odio morbi quis.') +emoticons = cuss( + { + # Emojis + "BEER": r"🍺", + "BEER_TOAST": r"🍻", + "FACE_CUTE_SMILE": r"😊", + "FACE_HEART_EYES": r"😍", + "FACE_JOY": r"😂", + "FACE_SWEAT_SMILE": r"😅", + "FACE_THINKING": r"🤔", + "FIRE": r"🔥", + "FLAG_CA": r"🇨🇦", + "FLAG_US": r"🇺🇸", + "HAND_CLAP": r"👏", + "HAND_HORNS": r"🤘", + "HAND_OK": r"👌", + "HAND_THUMB_DOWN": r"👎", + "HAND_THUMB_UP": r"👍", + "HAND_WAVE": r"👋", + "HEART": r"❤️", + "MAPLE_LEAF": r"🍁", + "POOP": r"💩", + "TADA": r"🎉", + # Emoticons, but fancier + "ANGRY_TABLE_FLIP": r"(ノಠ痊ಠ)ノ彡┻━┻", + "CELEBRATORY_GLITTER": r"+。:.゚ヽ(´∀。)ノ゚.:。+゚゚+。:.゚ヽ(*´∀)ノ゚.:。+゚", + "SHRUGGIE": r"¯\_(ツ)_/¯", + "TABLE_FLIP": r"(╯°□°)╯︵ ┻━┻", + } +) + +WPM = send_string( + "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Bibendum arcu vitae elementum curabitur vitae nunc sed. Facilisis sed odio morbi quis." +) _______ = KC.TRNS xxxxxxx = KC.NO HELLA_TD = KC.TD( KC.A, KC.B, - send_string('macros in a tap dance? I think yes'), + send_string("macros in a tap dance? I think yes"), KC.TG(1), ) def shrek_is_life(*args, **kwargs): - ''' + """ Proof macros are a thing and don't actually have to care about the state. At all. - ''' - - print('⢀⡴⠑⡄⠀⠀⠀⠀⠀⠀⠀⣀⣀⣤⣤⣤⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀') - print('⠸⡇⠀⠿⡀⠀⠀⠀⣀⡴⢿⣿⣿⣿⣿⣿⣿⣿⣷⣦⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀') - print('⠀⠀⠀⠀⠑⢄⣠⠾⠁⣀⣄⡈⠙⣿⣿⣿⣿⣿⣿⣿⣿⣆⠀⠀⠀⠀⠀⠀⠀⠀') - print('⠀⠀⠀⠀⢀⡀⠁⠀⠀⠈⠙⠛⠂⠈⣿⣿⣿⣿⣿⠿⡿⢿⣆⠀⠀⠀⠀⠀⠀⠀') - print('⠀⠀⠀⢀⡾⣁⣀⠀⠴⠂⠙⣗⡀⠀⢻⣿⣿⠭⢤⣴⣦⣤⣹⠀⠀⠀⢀⢴⣶⣆') - print('⠀⠀⢀⣾⣿⣿⣿⣷⣮⣽⣾⣿⣥⣴⣿⣿⡿⢂⠔⢚⡿⢿⣿⣦⣴⣾⠁⠸⣼⡿') - print('⠀⢀⡞⠁⠙⠻⠿⠟⠉⠀⠛⢹⣿⣿⣿⣿⣿⣌⢤⣼⣿⣾⣿⡟⠉⠀⠀⠀⠀⠀') - print('⠀⣾⣷⣶⠇⠀⠀⣤⣄⣀⡀⠈⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇⠀⠀⠀⠀⠀⠀') - print('⠀⠉⠈⠉⠀⠀⢦⡈⢻⣿⣿⣿⣶⣶⣶⣶⣤⣽⡹⣿⣿⣿⣿⡇⠀⠀⠀⠀⠀⠀') - print('⠀⠀⠀⠀⠀⠀⠀⠉⠲⣽⡻⢿⣿⣿⣿⣿⣿⣿⣷⣜⣿⣿⣿⡇⠀⠀⠀⠀⠀⠀') - print('⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⣷⣶⣮⣭⣽⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀') - print('⠀⠀⠀⠀⠀⠀⣀⣀⣈⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠇⠀⠀⠀⠀⠀⠀⠀') - print('⠀⠀⠀⠀⠀⠀⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠃⠀⠀⠀⠀⠀⠀⠀⠀') - print('⠀⠀⠀⠀⠀⠀⠀⠹⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠟⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀') - print('⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠛⠻⠿⠿⠿⠿⠛⠉') + """ + + print("⢀⡴⠑⡄⠀⠀⠀⠀⠀⠀⠀⣀⣀⣤⣤⣤⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀") + print("⠸⡇⠀⠿⡀⠀⠀⠀⣀⡴⢿⣿⣿⣿⣿⣿⣿⣿⣷⣦⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀") + print("⠀⠀⠀⠀⠑⢄⣠⠾⠁⣀⣄⡈⠙⣿⣿⣿⣿⣿⣿⣿⣿⣆⠀⠀⠀⠀⠀⠀⠀⠀") + print("⠀⠀⠀⠀⢀⡀⠁⠀⠀⠈⠙⠛⠂⠈⣿⣿⣿⣿⣿⠿⡿⢿⣆⠀⠀⠀⠀⠀⠀⠀") + print("⠀⠀⠀⢀⡾⣁⣀⠀⠴⠂⠙⣗⡀⠀⢻⣿⣿⠭⢤⣴⣦⣤⣹⠀⠀⠀⢀⢴⣶⣆") + print("⠀⠀⢀⣾⣿⣿⣿⣷⣮⣽⣾⣿⣥⣴⣿⣿⡿⢂⠔⢚⡿⢿⣿⣦⣴⣾⠁⠸⣼⡿") + print("⠀⢀⡞⠁⠙⠻⠿⠟⠉⠀⠛⢹⣿⣿⣿⣿⣿⣌⢤⣼⣿⣾⣿⡟⠉⠀⠀⠀⠀⠀") + print("⠀⣾⣷⣶⠇⠀⠀⣤⣄⣀⡀⠈⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇⠀⠀⠀⠀⠀⠀") + print("⠀⠉⠈⠉⠀⠀⢦⡈⢻⣿⣿⣿⣶⣶⣶⣶⣤⣽⡹⣿⣿⣿⣿⡇⠀⠀⠀⠀⠀⠀") + print("⠀⠀⠀⠀⠀⠀⠀⠉⠲⣽⡻⢿⣿⣿⣿⣿⣿⣿⣷⣜⣿⣿⣿⡇⠀⠀⠀⠀⠀⠀") + print("⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⣷⣶⣮⣭⣽⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀") + print("⠀⠀⠀⠀⠀⠀⣀⣀⣈⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠇⠀⠀⠀⠀⠀⠀⠀") + print("⠀⠀⠀⠀⠀⠀⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠃⠀⠀⠀⠀⠀⠀⠀⠀") + print("⠀⠀⠀⠀⠀⠀⠀⠹⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠟⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀") + print("⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠛⠻⠿⠿⠿⠿⠛⠉") # Spew shrek when hitting a fully custom key @@ -88,7 +91,8 @@ def shrek_is_life(*args, **kwargs): # But also give me a normal alt if I want it. Shrek isn't ALWAYS life. BORING_ALT = KC.LALT.clone() - +# flake8: noqa +# fmt: off keyboard.keymap = [ [ KC.GESC, KC.QUOT, KC.COMM, KC.DOT, KC.P, KC.Y, KC.F, KC.G, KC.C, KC.R, KC.L, KC.BSPC, @@ -118,6 +122,7 @@ def shrek_is_life(*args, **kwargs): KC.LCTL, KC.DBG, HELLA_TD, xxxxxxx, _______, _______, xxxxxxx, xxxxxxx, KC.MUTE, KC.VOLD, KC.VOLU, xxxxxxx, ], ] +# fmt: on -if __name__ == '__main__': +if __name__ == "__main__": keyboard.go() diff --git a/user_keymaps/klardotsh/lily58.py b/user_keymaps/klardotsh/lily58.py index 6440533d3..8886c9f24 100644 --- a/user_keymaps/klardotsh/lily58.py +++ b/user_keymaps/klardotsh/lily58.py @@ -17,6 +17,8 @@ _______ = KC.TRNS xxxxxxx = KC.NO +# flake8: noqa +# fmt: off keyboard.keymap = [ [ KC.GESC, KC.N1, KC.N2, KC.N3, KC.N4, KC.N5, KC.N6, KC.N7, KC.N8, KC.N9, KC.N0, KC.BSPC, @@ -40,6 +42,7 @@ KC.HOME, KC.END, _______, _______, KC.VOLU, KC.VOLD, KC.PGUP, KC.PGDN, ], ] +# fmt: on -if __name__ == '__main__': +if __name__ == "__main__": keyboard.go() diff --git a/user_keymaps/rk463345/levinson_r2.py b/user_keymaps/rk463345/levinson_r2.py index 65d821f47..a446a998d 100755 --- a/user_keymaps/rk463345/levinson_r2.py +++ b/user_keymaps/rk463345/levinson_r2.py @@ -12,7 +12,14 @@ layers = Layers() media_keys = MediaKeys() split = Split(split_type=SplitType.UART) -rgb_ext = RGB(pixel_pin=keyboard.rgb_pixel_pin, num_pixels=16, val_limit=150, hue_default=0, sat_default=100, val_default=20) +rgb_ext = RGB( + pixel_pin=keyboard.rgb_pixel_pin, + num_pixels=16, + val_limit=150, + hue_default=0, + sat_default=100, + val_default=20, +) keyboard.modules = [layers, media_keys, split] keyboard.extensions = [rgb_ext] @@ -30,6 +37,8 @@ # ---------------------- Keymap --------------------------------------------------------- +# flake8: noqa +# fmt: off keyboard.keymap = [ [ # Default @@ -68,6 +77,7 @@ KC.DF(0), KC.DF(1), KC.DF(2), _______, _______, _______, _______, _______, KC.HOME, KC.VOLD, KC.VOLU, KC.END, ], ] +# fmt: on -if __name__ == '__main__': +if __name__ == "__main__": keyboard.go() diff --git a/util/compile.py b/util/compile.py index 1f74f7de1..da705b7a4 100644 --- a/util/compile.py +++ b/util/compile.py @@ -3,8 +3,8 @@ from os import devnull, system from pathlib import Path -source_dir = Path('kmk') -build_dir = Path('build') +source_dir = Path("kmk") +build_dir = Path("build") def clean(): @@ -18,25 +18,25 @@ def clean(): def compile(): - shutil.copy2('boot.py', 'build/boot.py') + shutil.copy2("boot.py", "build/boot.py") # Make sure the full folder heirarchy exists - for d in source_dir.glob('**/'): + for d in source_dir.glob("**/"): if not build_dir.joinpath(d).exists(): Path.mkdir(build_dir.joinpath(d)) # Compile every python file - for x in source_dir.glob('**/*.py'): - out_path = str(build_dir.joinpath(x).with_suffix('.mpy')) - system(f'mpy-cross {x} -o {out_path}') + for x in source_dir.glob("**/*.py"): + out_path = str(build_dir.joinpath(x).with_suffix(".mpy")) + system(f"mpy-cross {x} -o {out_path}") -if __name__ == '__main__': +if __name__ == "__main__": try: - subprocess.run('mpy-cross', stdout=devnull, stderr=devnull) + subprocess.run("mpy-cross", stdout=devnull, stderr=devnull) except (FileNotFoundError): print() - print('`mpy-cross` not found. Ensure mpy-cross is working from a shell.') + print("`mpy-cross` not found. Ensure mpy-cross is working from a shell.") print() clean() compile()