Compare commits
922 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b6cf5962aa | |||
| d3084041a9 | |||
| c1e65bf0dc | |||
| 688381b106 | |||
| c3e3367264 | |||
| c3d51e29fc | |||
| cae2e6d92e | |||
| 347418bdc5 | |||
| 153fc8922e | |||
| cdbfaeb013 | |||
| 4062a6ebe4 | |||
| 46ef6b3938 | |||
| c1b9c0fb4a | |||
| 8ede2998fe | |||
| 41f974fe6e | |||
| e7af5ce322 | |||
| 7881294554 | |||
| b3fd122fcd | |||
| 1dd48899d7 | |||
| f357e97ce5 | |||
| 2d8ecd424a | |||
| affbbc822d | |||
| 43ea732c5f | |||
| 708918464f | |||
| ed2377c288 | |||
| b819eb439c | |||
| b3ed7101fc | |||
| a3504af376 | |||
| 81c2f1cba9 | |||
| bea5b22251 | |||
| e04d0beb68 | |||
| 08ba097aaa | |||
| ea968d94e4 | |||
| 8e12c72b07 | |||
| 8dee4d8f70 | |||
| 315b8e631a | |||
| cbb1860f25 | |||
| 9839bcaa14 | |||
| da54337221 | |||
| a6a1e764d1 | |||
| eb6aa08c10 | |||
| 14a190a67f | |||
| cf5ae89884 | |||
| 558dfb8ced | |||
| 2ec8fc22b3 | |||
| c94700495b | |||
| 69a3bc5e31 | |||
| d189f49418 | |||
| 60fb416b67 | |||
| 792429d19d | |||
| 106975015e | |||
| 1117735f2e | |||
| 0378f8944a | |||
| 75fde0f444 | |||
| 04f610c799 | |||
| 3178b59147 | |||
| 9c7008e179 | |||
| 7ff7dbc56b | |||
| 823d524a81 | |||
| 1b60debba7 | |||
| 3fc713cc8d | |||
| bb26c7e94d | |||
| 52404cf5d3 | |||
| 32223bcfc2 | |||
| 4e2bdb2b59 | |||
| d72514205c | |||
| 9b4afdbe18 | |||
| 6751541269 | |||
| fe9918af16 | |||
| d2c56f1a3f | |||
| 8624549aa6 | |||
| 9a6ce704b7 | |||
| 9af2a1962d | |||
| a8d4a7a362 | |||
| 943f5ad50b | |||
| 4cd8fea07a | |||
| 82b3a22ac8 | |||
| 2c6367a408 | |||
| af94a0c52d | |||
| 9c374f6bb2 | |||
| d0a19458c5 | |||
| 5d6e7677de | |||
| 01309e3124 | |||
| 083e1ce4a1 | |||
| 8c012e5902 | |||
| 5e6d17cc86 | |||
| c4a71de83f | |||
| 01bc746092 | |||
| 87d023ef7f | |||
| 119052f9a2 | |||
| 43710717c9 | |||
| 7bf5e25c5e | |||
| faa030df96 | |||
| b2efe285a9 | |||
| 9e28dce5ce | |||
| 8179508248 | |||
| 2c3664c1b9 | |||
| 269f083662 | |||
| 8b40c65661 | |||
| 7be3cf38dc | |||
| b18a7297a7 | |||
| 7f46fbe87a | |||
| e0ca7c2ae6 | |||
| 6389a940bc | |||
| 48d0daabf5 | |||
| 8fc3c04720 | |||
| 351f953fdb | |||
| e1560dfab5 | |||
| c9bc6a026a | |||
| 83f0e8bd42 | |||
| 7af83b49a5 | |||
| 59263ece6e | |||
| a507ed9f46 | |||
| 6b451142e2 | |||
| 12beea05a7 | |||
| 713fa5243c | |||
| d600852bec | |||
| c09f2f8e83 | |||
| 2fb515195c | |||
| 889f51f5c5 | |||
| 742ba8314a | |||
| b95d90a191 | |||
| 46fa49a102 | |||
| d5e89d6e2a | |||
| 086fc75fec | |||
| 05c33990bb | |||
| cbae40ef4d | |||
| 002ba6b4e0 | |||
| 85f75b4677 | |||
| 95d8df5bea | |||
| ac1cd9bdde | |||
| 2d9bb79af7 | |||
| 120c9e6800 | |||
| 6f3099a8db | |||
| e46711dc54 | |||
| 59920c59e0 | |||
| 604bb8f55c | |||
| 2f8dc63cdc | |||
| 4fbb3ec838 | |||
| 6818fe9a5c | |||
| 3854fa5aa6 | |||
| 1ca459e67a | |||
| fe8ffb2839 | |||
| 42fb88c35d | |||
| db7a0786a9 | |||
| f9f2612356 | |||
| df81bb599f | |||
| 6d2492c1cf | |||
| e244535557 | |||
| 5f10603fe5 | |||
| 6b8491eea2 | |||
| b63bf41294 | |||
| f6cc3a7ddf | |||
| d1c93abe2c | |||
| d6e3b37f7f | |||
| 9840779af4 | |||
| b893ec1fcf | |||
| d5e5bfe69d | |||
| 4afe5c4581 | |||
| e054ac364e | |||
| 68e01afb5b | |||
| 2e0a8bb1ff | |||
| b02aebef35 | |||
| 099a51ed93 | |||
| e4aedb354b | |||
| 301768b842 | |||
| 856960d799 | |||
| d0877a4ea6 | |||
| 3c20ab296a | |||
| 4dc7ee3314 | |||
| 05bd5e8593 | |||
| 2fe3912a07 | |||
| 2840628443 | |||
| f0f79e7e3b | |||
| e8ae635c88 | |||
| d8f7e03815 | |||
| ba1b5e49ae | |||
| 703a2c91b5 | |||
| 4a54bb62de | |||
| 9e84c8359b | |||
| 5139876d90 | |||
| 6aef49de40 | |||
| 186b336bf3 | |||
| 1bbec27d1a | |||
| f0a8d69e22 | |||
| 8bd237206c | |||
| 6bf7c3a2bc | |||
| 2e8be741cc | |||
| abd0352750 | |||
| 25d91b85f3 | |||
| f08eb42105 | |||
| f450102c93 | |||
| db28645e98 | |||
| 23efb776e7 | |||
| 7f621b282f | |||
| 5dc7fce1e7 | |||
| 879f59b0d5 | |||
| 511622820a | |||
| 0914f969e5 | |||
| c611045290 | |||
| 89ac9e90d6 | |||
| ae2a98b3bc | |||
| bd242baa0a | |||
| 8e4caeb2a8 | |||
| 3b55b3d5a5 | |||
| cc3b1afaa1 | |||
| a22b6fdbdb | |||
| e3041c4b5b | |||
| 8ad6d50a04 | |||
| 4db000f6d7 | |||
| 3821624c3b | |||
| 60a722b4ec | |||
| 65132aa107 | |||
| 48eac124a5 | |||
| be23b18d33 | |||
| 748cc66946 | |||
| 304b2e4255 | |||
| 9fa183f143 | |||
| 82df528395 | |||
| 49e3bddc91 | |||
| c52bf961e1 | |||
| df3f9f0306 | |||
| ef2d73aadc | |||
| 1ed721cccb | |||
| a724216563 | |||
| 2bcf4d7a97 | |||
| 2dfa2dd68f | |||
| e94ed0b7f0 | |||
| c7e2f8609c | |||
| 9d2321cc9c | |||
| 61d9912950 | |||
| f23d32a92a | |||
| dc489cbf7a | |||
| 41d24aae99 | |||
| 6b50bba139 | |||
| 139422fd32 | |||
| 409e11df42 | |||
| f3a11f9791 | |||
| 8dcc5b4011 | |||
| d0f65834f1 | |||
| 47ed0a705d | |||
| ae3192b63c | |||
| bb461f5fba | |||
| 52069b7bb3 | |||
| f0ed0bd2e1 | |||
| e868a120f0 | |||
| 70652aeb4c | |||
| 28adcc4e49 | |||
| affbb1ee7b | |||
| d8a4210c9b | |||
| b16d555e33 | |||
| 4380142ccd | |||
| 91f2d6cb21 | |||
| 249b071ee9 | |||
| 53fe437100 | |||
| fc63f3616e | |||
| a528511732 | |||
| dbe1d37046 | |||
| 988965ed52 | |||
| 3c5ca594d5 | |||
| 452b30c899 | |||
| 85c5b26fdf | |||
| 92ed684866 | |||
| 88e83db330 | |||
| 55609fc691 | |||
| e0d89f967f | |||
| b2ce8a6924 | |||
| 71efbd1b42 | |||
| e36939a108 | |||
| 721461fc1b | |||
| 72ee59b2b4 | |||
| 95159da0fc | |||
| 330d702347 | |||
| cbf669d3bd | |||
| 7498fe3255 | |||
| 880998e8ca | |||
| ecc9657eaa | |||
| 125f65cf1b | |||
| 1cd9c7d669 | |||
| 5165f31066 | |||
| 10d33e5d1d | |||
| fb35e8b8b2 | |||
| 4402bcce73 | |||
| 8839b26f00 | |||
| a79358725c | |||
| 2ab1576230 | |||
| c0be380f69 | |||
| c0ae0c8389 | |||
| 4a766e8284 | |||
| 2772ea8df2 | |||
| a604f0e821 | |||
| 6995b25518 | |||
| e4f843829f | |||
| 39b6ca790c | |||
| 4c8d7a8031 | |||
| 6d75bc433e | |||
| 8bb7fbd1c4 | |||
| ad03e655e9 | |||
| 61d3974a47 | |||
| 3d852c87e2 | |||
| 0e46528f32 | |||
| bb8fa1f6a8 | |||
| 9fdaa810c0 | |||
| 4083ac0c14 | |||
| b9e0b7ccd0 | |||
| 4b9e428abb | |||
| 63ad13e09a | |||
| cc06a308a1 | |||
| e9fdd20181 | |||
| 8692686cb5 | |||
| db29ad36fe | |||
| 0710b25317 | |||
| cbd2964f42 | |||
| f51118f13c | |||
| 323e363b42 | |||
| e8a4fe6142 | |||
| 587d9b359c | |||
| c2632253ac | |||
| 45be77dd10 | |||
| 78ffbcc33d | |||
| d83d1a244e | |||
| fa002a50ac | |||
| 32507afae9 | |||
| 6de3bbdaf4 | |||
| 6e50d0cb22 | |||
| 9e978f3ece | |||
| 32478926c8 | |||
| 2925788d01 | |||
| c0789cf4f7 | |||
| 89d591ce0a | |||
| 77c560b40c | |||
| dad4913bcd | |||
| 9b56650d4b | |||
| 9fca2018e5 | |||
| e5dd890931 | |||
| beadbf8e91 | |||
| ff5f9b833d | |||
| 162f06001a | |||
| 348fad24c7 | |||
| f9748cdb76 | |||
| 56380763a9 | |||
| 3a1630b687 | |||
| a593f34cde | |||
| 49cce5fa1a | |||
| df7bd06629 | |||
| e0da77fd4b | |||
| 833dd83008 | |||
| ce0ad4013f | |||
| 698f80adfe | |||
| d0b0f4bfcb | |||
| d23ea86ccf | |||
| 15d938b172 | |||
| 6c1d7a3b29 | |||
| c28f551682 | |||
| def92c78c8 | |||
| ddff9dec11 | |||
| 9e0e85d646 | |||
| b05ca7e980 | |||
| 8f8a9f7dd7 | |||
| df32978a31 | |||
| 79b51cf8c5 | |||
| a72dd0dc2e | |||
| d937c4c0e6 | |||
| 46cceb0910 | |||
| e74e39c189 | |||
| c2706c7737 | |||
| d0e66d24bd | |||
| c1a1849ad2 | |||
| 0675105731 | |||
| 7ee0b951a8 | |||
| d8168f024c | |||
| 2654dc7c69 | |||
| 4224960837 | |||
| 907c3a8fff | |||
| 28505479ba | |||
| 84d3abce3f | |||
| 9050dffc53 | |||
| e0f69c9bdf | |||
| bbd0a60f98 | |||
| e23f4187fe | |||
| 15f200df3a | |||
| a1a3ad6fb5 | |||
| d6677d53a3 | |||
| 07e43b50d1 | |||
| ac83555b24 | |||
| 1ab358059c | |||
| 5bf83c0d77 | |||
| 03ac00c6e3 | |||
| 0122d8fc78 | |||
| a66ce96dbf | |||
| 6da8e30446 | |||
| 539ed13be4 | |||
| 036a553f64 | |||
| 976a14584b | |||
| ed69f52927 | |||
| 98847495e6 | |||
| 40f132da33 | |||
| 5feb44595a | |||
| 48c6941f1a | |||
| a8756d493a | |||
| 9f4077a073 | |||
| 3e7a3d75c5 | |||
| 477d2d87d3 | |||
| 7a65dbe39b | |||
| f83755ac77 | |||
| a590cfd066 | |||
| f317035342 | |||
| 8900bdd446 | |||
| 35ecf158a2 | |||
| 353c1d30ec | |||
| 1c94fb5bd1 | |||
| cf305aeebb | |||
| 90e97433e0 | |||
| 125a85a0af | |||
| cfb8838c73 | |||
| 824d491ebc | |||
| d694c408c0 | |||
| d1bb266d49 | |||
| 419fcc3d29 | |||
| 24ab6a51c1 | |||
| dec4a45d98 | |||
| d11c56db03 | |||
| fc23315cc7 | |||
| 1f503fe20d | |||
| 4564f7ac0e | |||
| 7b823e1141 | |||
| dac3d9c6bb | |||
| ccca904cb8 | |||
| c66a81c0ec | |||
| fb810e2943 | |||
| 5cc663dedc | |||
| 593372699b | |||
| 1899cb5b86 | |||
| 0a285f2d28 | |||
| 94c82e6701 | |||
| 0d37c86061 | |||
| 6c8e9ccd89 | |||
| e7cf545502 | |||
| 44182eec86 | |||
| 0f5b1b7586 | |||
| 4fe073580a | |||
| 2fed654c16 | |||
| 8ebd4864d3 | |||
| a495532a4d | |||
| d87ce72f07 | |||
| 50201346e2 | |||
| 773b154371 | |||
| 5b59d1d384 | |||
| dcd8583183 | |||
| 97e52b39c0 | |||
| 581013b61a | |||
| fd68d25a1d | |||
| 588f93f7b1 | |||
| 96f402dcdd | |||
| c1b7fca8d5 | |||
| 2e4e7ccc57 | |||
| ada3d133df | |||
| 61e7b9d684 | |||
| 24172c658c | |||
| 62ac976b99 | |||
| 1f445a99b2 | |||
| 025286052b | |||
| 32a856f8e8 | |||
| 21f50f3b24 | |||
| ce77d41246 | |||
| dec137220c | |||
| 01c7e155c3 | |||
| dcbcb67ce8 | |||
| d57fd10718 | |||
| 2b91db5d81 | |||
| dffa3de1ec | |||
| 403837901b | |||
| 0de725c907 | |||
| e811e08c52 | |||
| 6518ae7516 | |||
| 95b5f99f1f | |||
| de22e79b71 | |||
| 127c67e566 | |||
| 3523dbd5c5 | |||
| b526a07e19 | |||
| d9f10edbb7 | |||
| 7616cd4c69 | |||
| afe75f6848 | |||
| c0e2db8281 | |||
| 3727af11c4 | |||
| 450295cfcf | |||
| 457bce8aa9 | |||
| 0f81497ea3 | |||
| fa7ee800e1 | |||
| 56b7452e55 | |||
| 9d73566453 | |||
| 28ba0c174a | |||
| 5d0444bcc0 | |||
| 40876005d5 | |||
| ac6d941822 | |||
| 113b365a47 | |||
| 2f785536e1 | |||
| 9ab4013b4b | |||
| b3b04f03ce | |||
| 57040f85f0 | |||
| 589ef4fd4c | |||
| 4b829cc484 | |||
| 98e343a108 | |||
| 7749d5a789 | |||
| c3b48bfa41 | |||
| 470e7ab2f4 | |||
| 4ceea36926 | |||
| b3f8174663 | |||
| 58dccea28b | |||
| ca086e01d7 | |||
| c5b1a95661 | |||
| d7881774a8 | |||
| 6eec92243e | |||
| 124b236182 | |||
| 2dc96cdf3d | |||
| 6f7923debc | |||
| 90d148b4a5 | |||
| 73e2c5ec10 | |||
| f31522dcd9 | |||
| a83607fd81 | |||
| 707df3f27d | |||
| 0f43e57831 | |||
| c08ab33060 | |||
| ee2abd98b3 | |||
| e39661a42a | |||
| 9518d19580 | |||
| adf95faaf8 | |||
| 2f92e9909d | |||
| b18f2c4bcd | |||
| 784ba049ad | |||
| 4d6d19d2e5 | |||
| 6fa47f19af | |||
| fb2872422e | |||
| 8460c0fa33 | |||
| 18f95341f4 | |||
| a8011267d9 | |||
| f8ebb4f1d7 | |||
| 3903f85368 | |||
| 05a9bdbf4a | |||
| 2809a9cd82 | |||
| 1c6794dc40 | |||
| cac80657df | |||
| 11241d8f99 | |||
| 308e5c9b0c | |||
| c12ff4f9e3 | |||
| 091c89df2c | |||
| 63a67be0ee | |||
| c68224b31a | |||
| 9f219757c3 | |||
| e09a4402b3 | |||
| 6867eb0e65 | |||
| ffaa5c4a2b | |||
| b9499108d8 | |||
| 37175b7227 | |||
| 2b5831c5fe | |||
| 62c8b9c68d | |||
| a080119c44 | |||
| a26c6f1bd9 | |||
| daac14e099 | |||
| d4b5c32a21 | |||
| c115afd736 | |||
| e7863a92e0 | |||
| 82a9e3a23a | |||
| a3a0a150a8 | |||
| 6951a19670 | |||
| 669133d491 | |||
| c60598b3f6 | |||
| 45733b30ef | |||
| f8bd86692e | |||
| 5e5d86cf94 | |||
| e0b7728719 | |||
| 0f85d4b9bc | |||
| a3fff9c7d7 | |||
| 8dcf3a6768 | |||
| 94949394de | |||
| b7be439381 | |||
| 0cae3428b9 | |||
| cc7755bafc | |||
| 4e78b9c12b | |||
| 5c80cf2222 | |||
| d02548e1a8 | |||
| 51efe973e8 | |||
| 0bb272d89b | |||
| 59f6843ea9 | |||
| be6838f97b | |||
| d5b2d3605b | |||
| 7a48917fb4 | |||
| 59832742b6 | |||
| f9f04901c0 | |||
| 593ffbb068 | |||
| 3d35f2ac63 | |||
| 5bfba581cb | |||
| 8fb570468c | |||
| 128fda60b0 | |||
| ab539c15dd | |||
| b931ba6e17 | |||
| f611aa73db | |||
| 69f697e36f | |||
| 654fb69295 | |||
| 850d44a105 | |||
| 8d4597705d | |||
| fa5655414a | |||
| 6fc4cebbfe | |||
| 89f3c5833f | |||
| adf9a33e83 | |||
| 4adf6bc834 | |||
| 9026f021ed | |||
| e562c31033 | |||
| 7b90b5af57 | |||
| cda1fabd4f | |||
| 4209055d62 | |||
| ed1a4eb88c | |||
| 478f1ad0ff | |||
| 80eb1da0e1 | |||
| ae39d43ea9 | |||
| 602c48bc06 | |||
| d34d501520 | |||
| 8f3ee53915 | |||
| 7eca382cb3 | |||
| f8f5d46491 | |||
| 696c62292b | |||
| d94b25d9d8 | |||
| 93829027af | |||
| cce4b6b191 | |||
| 0876f06282 | |||
| c970412a66 | |||
| 6af9328e14 | |||
| 5987b71c80 | |||
| 79fdc0c60b | |||
| cfb6a84799 | |||
| faa7e701fd | |||
| d5b8286f68 | |||
| a3d5737eaf | |||
| 314bb1b722 | |||
| 1c353bbcdf | |||
| 036b9dcc2d | |||
| 0fec5719bc | |||
| 3572081e43 | |||
| 8cf7f494b3 | |||
| b1165e169a | |||
| 284ebe1b11 | |||
| d51659db3e | |||
| 3aa3a874c9 | |||
| 113d3199b1 | |||
| 5712a9ad67 | |||
| 1f8d420749 | |||
| 9065ef901c | |||
| b2c5d304f8 | |||
| 70ae7dd9e6 | |||
| 94b122d677 | |||
| f6fc5d09e7 | |||
| 2b5c75cc67 | |||
| 167f813bcf | |||
| 7b9765e5b1 | |||
| 7ad01d4bdd | |||
| d19c47e571 | |||
| 4bfc647b91 | |||
| 98117ed7ad | |||
| cc9b25356c | |||
| a95d6e7f8a | |||
| fe5c41ac09 | |||
| b672174960 | |||
| a8691ced5b | |||
| fc53f90ecd | |||
| 0f836b5c7d | |||
| 34ed7123d1 | |||
| 5f668e17c9 | |||
| 806888bf49 | |||
| e8756a09ca | |||
| e38988be1b | |||
| 4009c93353 | |||
| 3ba5c10fad | |||
| 2552f1d43c | |||
| 5be2e83798 | |||
| d4919e027c | |||
| 7ef238b64d | |||
| 703d20f43f | |||
| d9bd7911ef | |||
| 6a5c832288 | |||
| dc849c4f71 | |||
| 76a6ba11fb | |||
| 305a19730f | |||
| de15e81703 | |||
| b91544a0da | |||
| caca34168e | |||
| 18b8ac589d | |||
| d85e628784 | |||
| 1e150cf10c | |||
| 9b0f0b7559 | |||
| cc118b5030 | |||
| 3e7ff78861 | |||
| 448d538d21 | |||
| d368161eb3 | |||
| eef8488ca2 | |||
| b22d04b145 | |||
| 6579e54c2b | |||
| 88c0153ca2 | |||
| f28c6ab309 | |||
| 976041f812 | |||
| 7693dd462f | |||
| df5e61cf98 | |||
| df87d08be3 | |||
| 33cb35e26f | |||
| 18b2cd8f2f | |||
| 7ab2a881e8 | |||
| 960de880ee | |||
| c0d8904782 | |||
| b6d508526a | |||
| 31307485f0 | |||
| 612c3583f1 | |||
| 6cdd3376f1 | |||
| b947789779 | |||
| 0da83935fc | |||
| 3428c70b69 | |||
| 3d511ff727 | |||
| cf2f293290 | |||
| c39601a35d | |||
| 5f36e0a43e | |||
| 31fe1c5cd7 | |||
| 0cdecd893a | |||
| 260fe06be8 | |||
| 8ddfd35a82 | |||
| 099bae3d7c | |||
| 9758e1fae2 | |||
| 211143d6ab | |||
| 70b49a098a | |||
| e2544f90fe | |||
| c223524d1b | |||
| 1789e2671a | |||
| d0812bcf5c | |||
| 4d5368e5fc | |||
| f3be927440 | |||
| d0e3e1792f | |||
| 31793fb290 | |||
| 41ddc86961 | |||
| 30ef74dd18 | |||
| bc69476bb2 | |||
| 05b9fd801b | |||
| 7af7f866c1 | |||
| 069e44bee6 | |||
| 3c0dd00a99 | |||
| afb91c8f1f | |||
| ca51f88d2b | |||
| a683b70c5f | |||
| c650e87443 | |||
| 36dfedf918 | |||
| 252f2b55fe | |||
| 99091a2540 | |||
| c3fdb7a049 | |||
| 5ba02688a6 | |||
| d189d32d96 | |||
| 59e111e593 | |||
| bfa029f207 | |||
| e2e763a424 | |||
| 132d2805ee | |||
| b800152268 | |||
| e49ec43fc4 | |||
| 63599a9ade | |||
| a2313ac952 | |||
| a1cd939aa1 | |||
| f69500418e | |||
| 5669807628 | |||
| 59fc139cfc | |||
| b48754e5db | |||
| 1a61f2cd7c | |||
| 02831c71c9 | |||
| 3764f2d5bd | |||
| a12a54f671 | |||
| f35f5167f0 | |||
| dbb0a4a2df | |||
| bc99763329 | |||
| ecd3e77a38 | |||
| 8ef1416b35 | |||
|
|
dffa1ac703 | ||
| d7becdd9bc | |||
| 23a6207f54 | |||
| 2769afc1e4 | |||
| 08836c1045 | |||
| 121b9b84a0 | |||
| 26ec121079 | |||
| fdb9769fd2 | |||
| 6742023919 | |||
| d61da17ebd | |||
| 57bae9f291 | |||
| 6596364027 | |||
| 85cd9fbcbc | |||
| 3e59f01add | |||
| bdb0548bc8 | |||
| c1fe8c611c | |||
| 3f56247aa7 | |||
| 84680c0c44 | |||
| 094a3c2aa9 | |||
| 51cec3062d | |||
| 268d56c348 | |||
| d1f1627214 | |||
| a604fca5cc | |||
| c3e9803cd6 | |||
| 9e7c6a695f | |||
| f75699f4ed | |||
| 40fb4fb3f9 | |||
| ac1b4b1a2a | |||
| cbf333564c | |||
| d5d8c3f413 | |||
| a9f3f75a79 | |||
| b52930daa5 | |||
| 4390fea084 | |||
| c41e3c0d78 | |||
| 7ffd553709 | |||
| 5c012ab4a0 | |||
| 340906c3f4 | |||
| 47256ab00d | |||
| 072f58a2e9 | |||
| 02b4f78baf | |||
| 49f85acb6c | |||
| 5008594c27 | |||
| d0af34ea25 | |||
| da582a8d88 | |||
| fc12d1803d | |||
| e7796e0371 | |||
| 6094b11068 | |||
| a169c31ed5 | |||
| 0522467b76 | |||
| 534982b18d | |||
| 2778ac0b4d | |||
| 1ba698d12a | |||
| 8d49d6491c | |||
| 787d285329 | |||
| dcbd13de1e | |||
| 4af18b6c70 | |||
| 86089a037c | |||
| 3d001ade0a | |||
| 6a1e7d4063 | |||
| 15b1a82cce | |||
| 9663e542f1 | |||
| f36d8c3e9f | |||
| db21d88721 | |||
| 2580d4b6cf | |||
| b3b65f3dd2 | |||
| ac63751583 | |||
| 8a95c03038 | |||
| 650f632c17 | |||
| 570e9b0215 | |||
| c9b612d552 | |||
| 2ad97d5021 | |||
| 82ffdfe278 | |||
| 0ff9920e9e | |||
| 0b6b205819 | |||
| db34f62fde | |||
| 973fd39f44 | |||
| d6278a3f4e | |||
| ae4709b0d4 | |||
| b377710931 | |||
| d9d2003087 | |||
| 9a713129dc | |||
| c672f53d3f | |||
| 0e6b0a657b | |||
| 4e24662d90 | |||
| 1bff2ea168 | |||
| 6e33f0bcae | |||
| 9a149ec341 | |||
| 064237904a | |||
| 221017ae7e | |||
| 59206dbc32 | |||
| f4ca76d844 | |||
| 31515d2c3a | |||
| 314049f22b | |||
| 87c6899949 | |||
| e8afff0e48 | |||
| 11399d7ea7 | |||
| 35752b2ae0 | |||
| ff0830c128 | |||
| c574a44a26 | |||
| b178e884f6 | |||
| 1097477a10 | |||
| 88142ead23 | |||
| 243e48e8a9 | |||
| 22858c8d2c | |||
| 3740996db3 | |||
| 82ea419088 | |||
| 2ffb101442 | |||
| 8f46e82905 | |||
| e8538d751b | |||
| 964a44a393 | |||
| 1bbbb2d8e1 | |||
| f931ccb7dd | |||
| 3e33a8a773 | |||
| 2d7496dd6e | |||
| f9826e28a5 | |||
| 5f1b56f30b | |||
| 562bb81379 | |||
| 0a630f9316 | |||
| 49f461037a | |||
| 9a0d36ca86 | |||
| 1dfae27d88 | |||
| 570ede237e | |||
| 236597848a | |||
| d3e1d3c368 | |||
| b7f628979e | |||
| 83d0451591 | |||
| 700bf9c937 | |||
| 2c43e55f77 | |||
| 69211cc9e8 | |||
| 6452226b50 | |||
| 01ef965180 | |||
| 956a107d38 | |||
| 266f9945f4 | |||
| 3b6121c9cf | |||
| ce1f057f71 | |||
| 226123a81f | |||
| aa4931fd18 | |||
| 164c639d29 | |||
| 960607a60d | |||
| 2c2c1ede21 | |||
| 8872d1bfe7 | |||
| d5975ea7ba | |||
| 2174cf3701 | |||
| 7a2f4584b0 | |||
| 7223651322 | |||
| 9581283d7d | |||
| b32f846fcf | |||
| ed0b761502 | |||
| 68c136a16f |
11
.gitignore
vendored
11
.gitignore
vendored
@@ -37,7 +37,7 @@ MANIFEST
|
||||
pip-log.txt
|
||||
pip-delete-this-directory.txt
|
||||
|
||||
# Unit test / coverage reports
|
||||
# Unit model / coverage reports
|
||||
htmlcov/
|
||||
.tox/
|
||||
.nox/
|
||||
@@ -106,10 +106,14 @@ celerybeat.pid
|
||||
.venv
|
||||
env/
|
||||
venv/
|
||||
venv_*/
|
||||
ENV/
|
||||
env.bak/
|
||||
venv.bak/
|
||||
|
||||
# Custom Environments
|
||||
cpl-env/
|
||||
|
||||
# Spyder project settings
|
||||
.spyderproject
|
||||
.spyproject
|
||||
@@ -129,5 +133,8 @@ dmypy.json
|
||||
.pyre/
|
||||
|
||||
# IDE
|
||||
.vscode/
|
||||
.idea/
|
||||
PythonImportHelper-v2-Completion.json
|
||||
|
||||
# cpl unittest stuff
|
||||
unittests/test_*_playground
|
||||
|
||||
3
.idea/dictionaries/sven.xml
generated
3
.idea/dictionaries/sven.xml
generated
@@ -1,3 +0,0 @@
|
||||
<component name="ProjectDictionaryState">
|
||||
<dictionary name="sven" />
|
||||
</component>
|
||||
17
.idea/inspectionProfiles/Project_Default.xml
generated
17
.idea/inspectionProfiles/Project_Default.xml
generated
@@ -1,17 +0,0 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<profile version="1.0">
|
||||
<option name="myName" value="Project Default" />
|
||||
<inspection_tool class="PyPackageRequirementsInspection" enabled="true" level="WARNING" enabled_by_default="true">
|
||||
<option name="ignoredPackages">
|
||||
<value>
|
||||
<list size="4">
|
||||
<item index="0" class="java.lang.String" itemvalue="termcolor" />
|
||||
<item index="1" class="java.lang.String" itemvalue="discord" />
|
||||
<item index="2" class="java.lang.String" itemvalue="mysql-connector" />
|
||||
<item index="3" class="java.lang.String" itemvalue="flask" />
|
||||
</list>
|
||||
</value>
|
||||
</option>
|
||||
</inspection_tool>
|
||||
</profile>
|
||||
</component>
|
||||
6
.idea/inspectionProfiles/profiles_settings.xml
generated
6
.idea/inspectionProfiles/profiles_settings.xml
generated
@@ -1,6 +0,0 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<settings>
|
||||
<option name="USE_PROJECT_PROFILE" value="false" />
|
||||
<version value="1.0" />
|
||||
</settings>
|
||||
</component>
|
||||
7
.idea/misc.xml
generated
7
.idea/misc.xml
generated
@@ -1,7 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectPlainTextFileTypeManager">
|
||||
<file url="file://$PROJECT_DIR$/publish_templates/all_template.txt" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.9" project-jdk-type="Python SDK" />
|
||||
</project>
|
||||
8
.idea/modules.xml
generated
8
.idea/modules.xml
generated
@@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/sh_common_py_lib.iml" filepath="$PROJECT_DIR$/.idea/sh_common_py_lib.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
20
.idea/sh_common_py_lib.iml
generated
20
.idea/sh_common_py_lib.iml
generated
@@ -1,20 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="PYTHON_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/dist" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/src/tests/logs" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/src/tests_dev/logs" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/src/sh_edraft.egg-info" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/src/dist" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/src/build" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/src/tests/old" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/.vscode" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build_test" />
|
||||
</content>
|
||||
<orderEntry type="jdk" jdkName="Python 3.9" jdkType="Python SDK" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
File diff suppressed because one or more lines are too long
@@ -1,4 +0,0 @@
|
||||
<changelist name="Uncommitted_changes_before_Update_at_26_11_2020_10_36_[Default_Changelist]" date="1606383362450" recycled="false" toDelete="true">
|
||||
<option name="PATH" value="$PROJECT_DIR$/.idea/shelf/Uncommitted_changes_before_Update_at_26_11_2020_10_36_[Default_Changelist]/shelved.patch" />
|
||||
<option name="DESCRIPTION" value="Uncommitted changes before Update at 26.11.2020 10:36 [Default Changelist]" />
|
||||
</changelist>
|
||||
6
.idea/vcs.xml
generated
6
.idea/vcs.xml
generated
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
868
.idea/workspace.xml
generated
868
.idea/workspace.xml
generated
@@ -1,868 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="AutoImportSettings">
|
||||
<option name="autoReloadType" value="SELECTIVE" />
|
||||
</component>
|
||||
<component name="BranchesTreeState">
|
||||
<expand>
|
||||
<path>
|
||||
<item name="ROOT" type="e8cecc67:BranchNodeDescriptor" />
|
||||
<item name="LOCAL_ROOT" type="e8cecc67:BranchNodeDescriptor" />
|
||||
</path>
|
||||
<path>
|
||||
<item name="ROOT" type="e8cecc67:BranchNodeDescriptor" />
|
||||
<item name="REMOTE_ROOT" type="e8cecc67:BranchNodeDescriptor" />
|
||||
</path>
|
||||
<path>
|
||||
<item name="ROOT" type="e8cecc67:BranchNodeDescriptor" />
|
||||
<item name="REMOTE_ROOT" type="e8cecc67:BranchNodeDescriptor" />
|
||||
<item name="GROUP_NODE:origin" type="e8cecc67:BranchNodeDescriptor" />
|
||||
</path>
|
||||
</expand>
|
||||
<select />
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="7e2256bc-a6b8-4880-83a6-8b0e3372d0a4" name="Default Changelist" comment="Removed unused packages">
|
||||
<change afterPath="$PROJECT_DIR$/src/tests/publish_test/__init__.py" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/src/tests/publish_test/publisher_test.py" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/src/tests/setup.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/sh_common_py_lib.iml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/sh_common_py_lib.iml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/sh_edraft/cli/cpl_cli/commands/build/app.py" beforeDir="false" afterPath="$PROJECT_DIR$/src/sh_edraft/cli/cpl_cli/commands/build/app.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/sh_edraft/cli/cpl_cli/commands/publish/app.py" beforeDir="false" afterPath="$PROJECT_DIR$/src/sh_edraft/cli/cpl_cli/commands/publish/app.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/sh_edraft/publishing/__init__.py" beforeDir="false" afterPath="$PROJECT_DIR$/src/sh_edraft/publish/__init__.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/sh_edraft/publishing/base/__init__.py" beforeDir="false" afterPath="$PROJECT_DIR$/src/sh_edraft/publish/base/__init__.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/sh_edraft/publishing/base/publisher_base.py" beforeDir="false" afterPath="$PROJECT_DIR$/src/sh_edraft/publish/base/publisher_base.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/sh_edraft/publishing/model/__init__.py" beforeDir="false" afterPath="$PROJECT_DIR$/src/sh_edraft/publish/model/__init__.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/sh_edraft/publishing/model/publish_settings_model.py" beforeDir="false" afterPath="$PROJECT_DIR$/src/sh_edraft/publish/model/publish_settings_model.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/sh_edraft/publishing/model/publish_settings_name.py" beforeDir="false" afterPath="$PROJECT_DIR$/src/sh_edraft/publish/model/publish_settings_name.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/sh_edraft/publishing/model/template.py" beforeDir="false" afterPath="$PROJECT_DIR$/src/sh_edraft/publish/model/template.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/sh_edraft/publishing/model/template_enum.py" beforeDir="false" afterPath="$PROJECT_DIR$/src/sh_edraft/publish/model/template_enum.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/sh_edraft/publishing/publisher.py" beforeDir="false" afterPath="$PROJECT_DIR$/src/sh_edraft/publish/publisher.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/tests/__init__.py" beforeDir="false" afterPath="$PROJECT_DIR$/src/tests/__init__.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/tests/appsettings.edrafts-lapi.json" beforeDir="false" afterPath="$PROJECT_DIR$/src/tests/appsettings.edrafts-lapi.json" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/tests/appsettings.edrafts-pc.json" beforeDir="false" afterPath="$PROJECT_DIR$/src/tests/appsettings.edrafts-pc.json" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/tests/build.json" beforeDir="false" afterPath="$PROJECT_DIR$/src/tests/build.json" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/tests/service_test/__init__.py" beforeDir="false" afterPath="$PROJECT_DIR$/src/tests/service_test/__init__.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/tests/time_test/__init__.py" beforeDir="false" afterPath="$PROJECT_DIR$/src/tests/time_test/__init__.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/tests/utils_test/__init__.py" beforeDir="false" afterPath="$PROJECT_DIR$/src/tests/utils_test/__init__.py" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||
<option name="LAST_RESOLUTION" value="IGNORE" />
|
||||
</component>
|
||||
<component name="FileTemplateManagerImpl">
|
||||
<option name="RECENT_TEMPLATES">
|
||||
<list>
|
||||
<option value="Python Script" />
|
||||
<option value="Python Unit Test" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="Git.Pull.Settings">
|
||||
<option name="BRANCH" value="2020.12.6" />
|
||||
</component>
|
||||
<component name="Git.Rebase.Settings">
|
||||
<option name="NEW_BASE" value="2020.12" />
|
||||
</component>
|
||||
<component name="Git.Settings">
|
||||
<option name="RECENT_BRANCH_BY_REPOSITORY">
|
||||
<map>
|
||||
<entry key="$PROJECT_DIR$" value="2020.12" />
|
||||
</map>
|
||||
</option>
|
||||
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
||||
<option name="RESET_MODE" value="HARD" />
|
||||
<option name="UPDATE_TYPE" value="REBASE" />
|
||||
</component>
|
||||
<component name="ProjectId" id="1kYeNqJzjIXigSYYCzg4D16FL1E" />
|
||||
<component name="ProjectViewState">
|
||||
<option name="hideEmptyMiddlePackages" value="true" />
|
||||
<option name="showLibraryContents" value="true" />
|
||||
</component>
|
||||
<component name="PropertiesComponent">
|
||||
<property name="RunOnceActivity.OpenProjectViewOnStart" value="true" />
|
||||
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
|
||||
<property name="last_opened_file_path" value="$PROJECT_DIR$/src/tests" />
|
||||
<property name="settings.editor.selected.configurable" value="com.jetbrains.python.configuration.PyActiveSdkModuleConfigurable" />
|
||||
</component>
|
||||
<component name="RecentsManager">
|
||||
<key name="CopyFile.RECENT_KEYS">
|
||||
<recent name="$PROJECT_DIR$/src/tests" />
|
||||
<recent name="$PROJECT_DIR$/src/tests_dev" />
|
||||
<recent name="$PROJECT_DIR$/src/sh_edraft/cli/cpl_cli/commands/database" />
|
||||
<recent name="$PROJECT_DIR$/src/sh_edraft/cli/cpl_cli/commands/publish" />
|
||||
<recent name="$PROJECT_DIR$/src" />
|
||||
</key>
|
||||
<key name="MoveFile.RECENT_KEYS">
|
||||
<recent name="$PROJECT_DIR$/src/tests" />
|
||||
<recent name="$PROJECT_DIR$/src/tests/publish_test" />
|
||||
<recent name="$PROJECT_DIR$/src/tests/old" />
|
||||
<recent name="$PROJECT_DIR$/src/sh_edraft/cli/cpl_cli/commands/build" />
|
||||
<recent name="$PROJECT_DIR$/src" />
|
||||
</key>
|
||||
</component>
|
||||
<component name="RunManager" selected="Python tests.Unittests">
|
||||
<configuration name="cli build" type="PythonConfigurationType" factoryName="Python">
|
||||
<module name="sh_common_py_lib" />
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="PARENT_ENVS" value="true" />
|
||||
<envs>
|
||||
<env name="PYTHONUNBUFFERED" value="1" />
|
||||
</envs>
|
||||
<option name="SDK_HOME" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/src/" />
|
||||
<option name="IS_MODULE_SDK" value="true" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/src/sh_edraft/cli/cpl_cli/cli.py" />
|
||||
<option name="PARAMETERS" value="build test" />
|
||||
<option name="SHOW_COMMAND_LINE" value="false" />
|
||||
<option name="EMULATE_TERMINAL" value="true" />
|
||||
<option name="MODULE_MODE" value="false" />
|
||||
<option name="REDIRECT_INPUT" value="false" />
|
||||
<option name="INPUT_FILE" value="" />
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
<configuration name="cli database migration" type="PythonConfigurationType" factoryName="Python">
|
||||
<module name="sh_common_py_lib" />
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="PARENT_ENVS" value="true" />
|
||||
<envs>
|
||||
<env name="PYTHONUNBUFFERED" value="1" />
|
||||
</envs>
|
||||
<option name="SDK_HOME" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/src/tests_dev" />
|
||||
<option name="IS_MODULE_SDK" value="true" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/src/sh_edraft/cli/cpl_cli/cli.py" />
|
||||
<option name="PARAMETERS" value="db mig add InitialMigration" />
|
||||
<option name="SHOW_COMMAND_LINE" value="false" />
|
||||
<option name="EMULATE_TERMINAL" value="true" />
|
||||
<option name="MODULE_MODE" value="false" />
|
||||
<option name="REDIRECT_INPUT" value="false" />
|
||||
<option name="INPUT_FILE" value="" />
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
<configuration name="cli database update" type="PythonConfigurationType" factoryName="Python">
|
||||
<module name="sh_common_py_lib" />
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="PARENT_ENVS" value="true" />
|
||||
<envs>
|
||||
<env name="PYTHONUNBUFFERED" value="1" />
|
||||
</envs>
|
||||
<option name="SDK_HOME" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/src/tests_dev" />
|
||||
<option name="IS_MODULE_SDK" value="true" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/src/sh_edraft/cli/cpl_cli/cli.py" />
|
||||
<option name="PARAMETERS" value="database update" />
|
||||
<option name="SHOW_COMMAND_LINE" value="false" />
|
||||
<option name="EMULATE_TERMINAL" value="true" />
|
||||
<option name="MODULE_MODE" value="false" />
|
||||
<option name="REDIRECT_INPUT" value="false" />
|
||||
<option name="INPUT_FILE" value="" />
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
<configuration name="cli help" type="PythonConfigurationType" factoryName="Python">
|
||||
<module name="sh_common_py_lib" />
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="PARENT_ENVS" value="true" />
|
||||
<envs>
|
||||
<env name="PYTHONUNBUFFERED" value="1" />
|
||||
</envs>
|
||||
<option name="SDK_HOME" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/src/sh_edraft/cli/cpl_cli" />
|
||||
<option name="IS_MODULE_SDK" value="true" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/src/sh_edraft/cli/cpl_cli/cli.py" />
|
||||
<option name="PARAMETERS" value="help" />
|
||||
<option name="SHOW_COMMAND_LINE" value="false" />
|
||||
<option name="EMULATE_TERMINAL" value="true" />
|
||||
<option name="MODULE_MODE" value="false" />
|
||||
<option name="REDIRECT_INPUT" value="false" />
|
||||
<option name="INPUT_FILE" value="" />
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
<configuration name="cli new app" type="PythonConfigurationType" factoryName="Python">
|
||||
<module name="sh_common_py_lib" />
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="PARENT_ENVS" value="true" />
|
||||
<envs>
|
||||
<env name="PYTHONUNBUFFERED" value="1" />
|
||||
</envs>
|
||||
<option name="SDK_HOME" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/src/sh_edraft/cli/cpl_cli" />
|
||||
<option name="IS_MODULE_SDK" value="true" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/src/sh_edraft/cli/cpl_cli/cli.py" />
|
||||
<option name="PARAMETERS" value="new app ./Test" />
|
||||
<option name="SHOW_COMMAND_LINE" value="false" />
|
||||
<option name="EMULATE_TERMINAL" value="true" />
|
||||
<option name="MODULE_MODE" value="false" />
|
||||
<option name="REDIRECT_INPUT" value="false" />
|
||||
<option name="INPUT_FILE" value="" />
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
<configuration name="cli new base" type="PythonConfigurationType" factoryName="Python">
|
||||
<module name="sh_common_py_lib" />
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="PARENT_ENVS" value="true" />
|
||||
<envs>
|
||||
<env name="PYTHONUNBUFFERED" value="1" />
|
||||
</envs>
|
||||
<option name="SDK_HOME" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/src/sh_edraft/cli/cpl_cli" />
|
||||
<option name="IS_MODULE_SDK" value="true" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/src/sh_edraft/cli/cpl_cli/cli.py" />
|
||||
<option name="PARAMETERS" value="new app ./Test/Test" />
|
||||
<option name="SHOW_COMMAND_LINE" value="false" />
|
||||
<option name="EMULATE_TERMINAL" value="true" />
|
||||
<option name="MODULE_MODE" value="false" />
|
||||
<option name="REDIRECT_INPUT" value="false" />
|
||||
<option name="INPUT_FILE" value="" />
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
<configuration name="cli new class" type="PythonConfigurationType" factoryName="Python">
|
||||
<module name="sh_common_py_lib" />
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="PARENT_ENVS" value="true" />
|
||||
<envs>
|
||||
<env name="PYTHONUNBUFFERED" value="1" />
|
||||
</envs>
|
||||
<option name="SDK_HOME" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/src/sh_edraft/cli/cpl_cli" />
|
||||
<option name="IS_MODULE_SDK" value="true" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/src/sh_edraft/cli/cpl_cli/cli.py" />
|
||||
<option name="PARAMETERS" value="new class ./Test/Test" />
|
||||
<option name="SHOW_COMMAND_LINE" value="false" />
|
||||
<option name="EMULATE_TERMINAL" value="true" />
|
||||
<option name="MODULE_MODE" value="false" />
|
||||
<option name="REDIRECT_INPUT" value="false" />
|
||||
<option name="INPUT_FILE" value="" />
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
<configuration name="cli new configmodel" type="PythonConfigurationType" factoryName="Python">
|
||||
<module name="sh_common_py_lib" />
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="PARENT_ENVS" value="true" />
|
||||
<envs>
|
||||
<env name="PYTHONUNBUFFERED" value="1" />
|
||||
</envs>
|
||||
<option name="SDK_HOME" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/src/sh_edraft/cli/cpl_cli" />
|
||||
<option name="IS_MODULE_SDK" value="true" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/src/sh_edraft/cli/cpl_cli/cli.py" />
|
||||
<option name="PARAMETERS" value="new configmodel ./Test/Test" />
|
||||
<option name="SHOW_COMMAND_LINE" value="false" />
|
||||
<option name="EMULATE_TERMINAL" value="true" />
|
||||
<option name="MODULE_MODE" value="false" />
|
||||
<option name="REDIRECT_INPUT" value="false" />
|
||||
<option name="INPUT_FILE" value="" />
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
<configuration name="cli new enum" type="PythonConfigurationType" factoryName="Python">
|
||||
<module name="sh_common_py_lib" />
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="PARENT_ENVS" value="true" />
|
||||
<envs>
|
||||
<env name="PYTHONUNBUFFERED" value="1" />
|
||||
</envs>
|
||||
<option name="SDK_HOME" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/src/sh_edraft/cli/cpl_cli" />
|
||||
<option name="IS_MODULE_SDK" value="true" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/src/sh_edraft/cli/cpl_cli/cli.py" />
|
||||
<option name="PARAMETERS" value="new enum ./Test/Test" />
|
||||
<option name="SHOW_COMMAND_LINE" value="false" />
|
||||
<option name="EMULATE_TERMINAL" value="true" />
|
||||
<option name="MODULE_MODE" value="false" />
|
||||
<option name="REDIRECT_INPUT" value="false" />
|
||||
<option name="INPUT_FILE" value="" />
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
<configuration name="cli new service" type="PythonConfigurationType" factoryName="Python">
|
||||
<module name="sh_common_py_lib" />
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="PARENT_ENVS" value="true" />
|
||||
<envs>
|
||||
<env name="PYTHONUNBUFFERED" value="1" />
|
||||
</envs>
|
||||
<option name="SDK_HOME" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/src/sh_edraft/cli/cpl_cli" />
|
||||
<option name="IS_MODULE_SDK" value="true" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/src/sh_edraft/cli/cpl_cli/cli.py" />
|
||||
<option name="PARAMETERS" value="new service ./Test/Test" />
|
||||
<option name="SHOW_COMMAND_LINE" value="false" />
|
||||
<option name="EMULATE_TERMINAL" value="true" />
|
||||
<option name="MODULE_MODE" value="false" />
|
||||
<option name="REDIRECT_INPUT" value="false" />
|
||||
<option name="INPUT_FILE" value="" />
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
<configuration name="cli publish" type="PythonConfigurationType" factoryName="Python">
|
||||
<module name="sh_common_py_lib" />
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="PARENT_ENVS" value="true" />
|
||||
<envs>
|
||||
<env name="PYTHONUNBUFFERED" value="1" />
|
||||
</envs>
|
||||
<option name="SDK_HOME" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/src/" />
|
||||
<option name="IS_MODULE_SDK" value="true" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/src/sh_edraft/cli/cpl_cli/cli.py" />
|
||||
<option name="PARAMETERS" value="publish" />
|
||||
<option name="SHOW_COMMAND_LINE" value="false" />
|
||||
<option name="EMULATE_TERMINAL" value="true" />
|
||||
<option name="MODULE_MODE" value="false" />
|
||||
<option name="REDIRECT_INPUT" value="false" />
|
||||
<option name="INPUT_FILE" value="" />
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
<configuration name="cli version" type="PythonConfigurationType" factoryName="Python">
|
||||
<module name="sh_common_py_lib" />
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="PARENT_ENVS" value="true" />
|
||||
<envs>
|
||||
<env name="PYTHONUNBUFFERED" value="1" />
|
||||
</envs>
|
||||
<option name="SDK_HOME" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/src/sh_edraft/cli/cpl_cli" />
|
||||
<option name="IS_MODULE_SDK" value="true" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/src/sh_edraft/cli/cpl_cli/cli.py" />
|
||||
<option name="PARAMETERS" value="version" />
|
||||
<option name="SHOW_COMMAND_LINE" value="false" />
|
||||
<option name="EMULATE_TERMINAL" value="true" />
|
||||
<option name="MODULE_MODE" value="false" />
|
||||
<option name="REDIRECT_INPUT" value="false" />
|
||||
<option name="INPUT_FILE" value="" />
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
<configuration name="cli" type="PythonConfigurationType" factoryName="Python" nameIsGenerated="true">
|
||||
<module name="sh_common_py_lib" />
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="PARENT_ENVS" value="true" />
|
||||
<envs>
|
||||
<env name="PYTHONUNBUFFERED" value="1" />
|
||||
</envs>
|
||||
<option name="SDK_HOME" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/src/sh_edraft/cli/cpl_cli" />
|
||||
<option name="IS_MODULE_SDK" value="true" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/src/sh_edraft/cli/cpl_cli/cli.py" />
|
||||
<option name="PARAMETERS" value="" />
|
||||
<option name="SHOW_COMMAND_LINE" value="false" />
|
||||
<option name="EMULATE_TERMINAL" value="true" />
|
||||
<option name="MODULE_MODE" value="false" />
|
||||
<option name="REDIRECT_INPUT" value="false" />
|
||||
<option name="INPUT_FILE" value="" />
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
<configuration name="main" type="PythonConfigurationType" factoryName="Python" nameIsGenerated="true">
|
||||
<module name="sh_common_py_lib" />
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="PARENT_ENVS" value="true" />
|
||||
<envs>
|
||||
<env name="PYTHONUNBUFFERED" value="1" />
|
||||
<env name="CPL_NAME" value="CPL_Dev_Test" />
|
||||
<env name="PYTHON_ENVIRONMENT" value="development" />
|
||||
</envs>
|
||||
<option name="SDK_HOME" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/src/tests_dev" />
|
||||
<option name="IS_MODULE_SDK" value="true" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/src/tests_dev/main.py" />
|
||||
<option name="PARAMETERS" value="--customer=sh-edraft.de" />
|
||||
<option name="SHOW_COMMAND_LINE" value="false" />
|
||||
<option name="EMULATE_TERMINAL" value="true" />
|
||||
<option name="MODULE_MODE" value="false" />
|
||||
<option name="REDIRECT_INPUT" value="false" />
|
||||
<option name="INPUT_FILE" value="" />
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
<configuration name="Unittests" type="tests" factoryName="Unittests" temporary="true" nameIsGenerated="true">
|
||||
<module name="sh_common_py_lib" />
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="PARENT_ENVS" value="true" />
|
||||
<envs>
|
||||
<env name="CPL_ENVIRONMENT" value="testing" />
|
||||
</envs>
|
||||
<option name="SDK_HOME" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/src/tests" />
|
||||
<option name="IS_MODULE_SDK" value="true" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<option name="_new_pattern" value="""" />
|
||||
<option name="_new_additionalArguments" value=""discover -s $PROJECT_DIR$/src/tests -p \u0027*_test.py\u0027"" />
|
||||
<option name="_new_target" value="""" />
|
||||
<option name="_new_targetType" value=""CUSTOM"" />
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
<configuration name="Unittests" type="tests" factoryName="Unittests" temporary="true" nameIsGenerated="true">
|
||||
<module name="sh_common_py_lib" />
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="PARENT_ENVS" value="true" />
|
||||
<envs>
|
||||
<env name="CPL_ENVIRONMENT" value="testing" />
|
||||
</envs>
|
||||
<option name="SDK_HOME" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/src/tests" />
|
||||
<option name="IS_MODULE_SDK" value="true" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<option name="_new_pattern" value="""" />
|
||||
<option name="_new_additionalArguments" value=""discover -s $PROJECT_DIR$/src/tests -p \u0027*_test.py\u0027"" />
|
||||
<option name="_new_target" value="""" />
|
||||
<option name="_new_targetType" value=""CUSTOM"" />
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
<list>
|
||||
<item itemvalue="Python.cli build" />
|
||||
<item itemvalue="Python.cli database migration" />
|
||||
<item itemvalue="Python.cli database update" />
|
||||
<item itemvalue="Python.cli help" />
|
||||
<item itemvalue="Python.cli new app" />
|
||||
<item itemvalue="Python.cli new base" />
|
||||
<item itemvalue="Python.cli new class" />
|
||||
<item itemvalue="Python.cli new configmodel" />
|
||||
<item itemvalue="Python.cli new enum" />
|
||||
<item itemvalue="Python.cli new service" />
|
||||
<item itemvalue="Python.cli publish" />
|
||||
<item itemvalue="Python.cli version" />
|
||||
<item itemvalue="Python.cli" />
|
||||
<item itemvalue="Python.main" />
|
||||
<item itemvalue="Python tests.Unittests" />
|
||||
</list>
|
||||
<recent_temporary>
|
||||
<list>
|
||||
<item itemvalue="Python tests.Unittests" />
|
||||
</list>
|
||||
</recent_temporary>
|
||||
</component>
|
||||
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
|
||||
<component name="TaskManager">
|
||||
<task active="true" id="Default" summary="Default task">
|
||||
<changelist id="7e2256bc-a6b8-4880-83a6-8b0e3372d0a4" name="Default Changelist" comment="" />
|
||||
<created>1605881914521</created>
|
||||
<option name="number" value="Default" />
|
||||
<option name="presentableId" value="Default" />
|
||||
<updated>1605881914521</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00031" summary="Improved database module structure">
|
||||
<created>1607285697331</created>
|
||||
<option name="number" value="00031" />
|
||||
<option name="presentableId" value="LOCAL-00031" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1607285697331</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00032" summary="Improved database module structure">
|
||||
<created>1607620265254</created>
|
||||
<option name="number" value="00032" />
|
||||
<option name="presentableId" value="LOCAL-00032" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1607620265254</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00033" summary="Changed DatabaseConnection">
|
||||
<created>1607712129507</created>
|
||||
<option name="number" value="00033" />
|
||||
<option name="presentableId" value="LOCAL-00033" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1607712129507</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00034" summary="Improved session reference">
|
||||
<created>1607971885250</created>
|
||||
<option name="number" value="00034" />
|
||||
<option name="presentableId" value="LOCAL-00034" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1607971885250</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00035" summary="Added console module">
|
||||
<created>1607976456889</created>
|
||||
<option name="number" value="00035" />
|
||||
<option name="presentableId" value="LOCAL-00035" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1607976456889</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00036" summary="Added console module">
|
||||
<created>1607976626173</created>
|
||||
<option name="number" value="00036" />
|
||||
<option name="presentableId" value="LOCAL-00036" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1607976626173</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00037" summary="Improved console">
|
||||
<created>1608037411172</created>
|
||||
<option name="number" value="00037" />
|
||||
<option name="presentableId" value="LOCAL-00037" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1608037411172</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00038" summary="Improved console">
|
||||
<created>1608047595029</created>
|
||||
<option name="number" value="00038" />
|
||||
<option name="presentableId" value="LOCAL-00038" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1608047595029</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00039" summary="Improved ApplicationHost">
|
||||
<created>1608047655667</created>
|
||||
<option name="number" value="00039" />
|
||||
<option name="presentableId" value="LOCAL-00039" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1608047655667</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00040" summary="Improved publisher">
|
||||
<created>1608048544558</created>
|
||||
<option name="number" value="00040" />
|
||||
<option name="presentableId" value="LOCAL-00040" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1608048544558</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00041" summary="Improved publisher">
|
||||
<created>1608049672925</created>
|
||||
<option name="number" value="00041" />
|
||||
<option name="presentableId" value="LOCAL-00041" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1608049672925</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00042" summary="Published for 2020.12.9">
|
||||
<created>1608049772153</created>
|
||||
<option name="number" value="00042" />
|
||||
<option name="presentableId" value="LOCAL-00042" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1608049772153</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00043" summary="Publish improvements for pip install">
|
||||
<created>1608059323858</created>
|
||||
<option name="number" value="00043" />
|
||||
<option name="presentableId" value="LOCAL-00043" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1608059323858</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00044" summary="Improved setup.py">
|
||||
<created>1608059501153</created>
|
||||
<option name="number" value="00044" />
|
||||
<option name="presentableId" value="LOCAL-00044" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1608059501153</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00045" summary="Added first cli commands">
|
||||
<created>1608066984496</created>
|
||||
<option name="number" value="00045" />
|
||||
<option name="presentableId" value="LOCAL-00045" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1608066984496</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00046" summary="Bugfixes and improved setup logic">
|
||||
<created>1608070231599</created>
|
||||
<option name="number" value="00046" />
|
||||
<option name="presentableId" value="LOCAL-00046" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1608070231599</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00047" summary="Improved cli">
|
||||
<created>1608122289003</created>
|
||||
<option name="number" value="00047" />
|
||||
<option name="presentableId" value="LOCAL-00047" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1608122289003</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00048" summary="Added version command to cli">
|
||||
<created>1608125743068</created>
|
||||
<option name="number" value="00048" />
|
||||
<option name="presentableId" value="LOCAL-00048" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1608125743068</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00049" summary="Improved version command & improved help command">
|
||||
<created>1608127752645</created>
|
||||
<option name="number" value="00049" />
|
||||
<option name="presentableId" value="LOCAL-00049" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1608127752645</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00050" summary="Improved cli error handling">
|
||||
<created>1608127998033</created>
|
||||
<option name="number" value="00050" />
|
||||
<option name="presentableId" value="LOCAL-00050" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1608127998034</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00051" summary="Removed module template">
|
||||
<created>1608128026922</created>
|
||||
<option name="number" value="00051" />
|
||||
<option name="presentableId" value="LOCAL-00051" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1608128026922</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00052" summary="Added build command to cli">
|
||||
<created>1608133651981</created>
|
||||
<option name="number" value="00052" />
|
||||
<option name="presentableId" value="LOCAL-00052" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1608133651982</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00053" summary="Improved publish process">
|
||||
<created>1608136663213</created>
|
||||
<option name="number" value="00053" />
|
||||
<option name="presentableId" value="LOCAL-00053" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1608136663213</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00054" summary="Improved publish process">
|
||||
<created>1608137669182</created>
|
||||
<option name="number" value="00054" />
|
||||
<option name="presentableId" value="LOCAL-00054" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1608137669182</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00055" summary="Added publish command to cli">
|
||||
<created>1608138851088</created>
|
||||
<option name="number" value="00055" />
|
||||
<option name="presentableId" value="LOCAL-00055" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1608138851088</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00056" summary="Added imports to cli module">
|
||||
<created>1608138986801</created>
|
||||
<option name="number" value="00056" />
|
||||
<option name="presentableId" value="LOCAL-00056" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1608138986801</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00057" summary="Improved help command">
|
||||
<created>1608139067953</created>
|
||||
<option name="number" value="00057" />
|
||||
<option name="presentableId" value="LOCAL-00057" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1608139067953</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00058" summary="Changed deps">
|
||||
<created>1608139239527</created>
|
||||
<option name="number" value="00058" />
|
||||
<option name="presentableId" value="LOCAL-00058" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1608139239527</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00059" summary="Bugfixes">
|
||||
<created>1608139414722</created>
|
||||
<option name="number" value="00059" />
|
||||
<option name="presentableId" value="LOCAL-00059" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1608139414722</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00060" summary="Bugfixes">
|
||||
<created>1608139502304</created>
|
||||
<option name="number" value="00060" />
|
||||
<option name="presentableId" value="LOCAL-00060" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1608139502304</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00061" summary="Removed publisher.py">
|
||||
<created>1608139612476</created>
|
||||
<option name="number" value="00061" />
|
||||
<option name="presentableId" value="LOCAL-00061" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1608139612476</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00062" summary="Added first steps of database command">
|
||||
<created>1608383809354</created>
|
||||
<option name="number" value="00062" />
|
||||
<option name="presentableId" value="LOCAL-00062" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1608383809355</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00063" summary="Improved error handling">
|
||||
<created>1608383870849</created>
|
||||
<option name="number" value="00063" />
|
||||
<option name="presentableId" value="LOCAL-00063" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1608383870849</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00064" summary="Improved service providing">
|
||||
<created>1608472168532</created>
|
||||
<option name="number" value="00064" />
|
||||
<option name="presentableId" value="LOCAL-00064" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1608472168532</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00065" summary="Added email client">
|
||||
<created>1608472183294</created>
|
||||
<option name="number" value="00065" />
|
||||
<option name="presentableId" value="LOCAL-00065" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1608472183294</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00066" summary="Published">
|
||||
<created>1608474022759</created>
|
||||
<option name="number" value="00066" />
|
||||
<option name="presentableId" value="LOCAL-00066" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1608474022759</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00067" summary="Improved publisher">
|
||||
<created>1608474032244</created>
|
||||
<option name="number" value="00067" />
|
||||
<option name="presentableId" value="LOCAL-00067" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1608474032244</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00068" summary="Added imports">
|
||||
<created>1608474289859</created>
|
||||
<option name="number" value="00068" />
|
||||
<option name="presentableId" value="LOCAL-00068" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1608474289859</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00069" summary="Removed build form gitignore, added build command">
|
||||
<created>1608813096023</created>
|
||||
<option name="number" value="00069" />
|
||||
<option name="presentableId" value="LOCAL-00069" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1608813096023</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00070" summary="Added init file for build command package">
|
||||
<created>1608813152266</created>
|
||||
<option name="number" value="00070" />
|
||||
<option name="presentableId" value="LOCAL-00070" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1608813152266</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00071" summary="Added pycharm files to gitignore">
|
||||
<created>1608822597300</created>
|
||||
<option name="number" value="00071" />
|
||||
<option name="presentableId" value="LOCAL-00071" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1608822597311</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00072" summary="Added more development tests">
|
||||
<created>1608823061488</created>
|
||||
<option name="number" value="00072" />
|
||||
<option name="presentableId" value="LOCAL-00072" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1608823061489</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00073" summary="Added new tester and CredentialManager TestCase">
|
||||
<created>1608894745271</created>
|
||||
<option name="number" value="00073" />
|
||||
<option name="presentableId" value="LOCAL-00073" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1608894745274</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00074" summary="Bugfix">
|
||||
<created>1608896199033</created>
|
||||
<option name="number" value="00074" />
|
||||
<option name="presentableId" value="LOCAL-00074" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1608896199034</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00075" summary="Added TimeFormatSettings Test">
|
||||
<created>1608896235005</created>
|
||||
<option name="number" value="00075" />
|
||||
<option name="presentableId" value="LOCAL-00075" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1608896235006</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00076" summary="Bugfixes">
|
||||
<created>1608901608928</created>
|
||||
<option name="number" value="00076" />
|
||||
<option name="presentableId" value="LOCAL-00076" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1608901608930</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00077" summary="Improved tests">
|
||||
<created>1608921175852</created>
|
||||
<option name="number" value="00077" />
|
||||
<option name="presentableId" value="LOCAL-00077" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1608921175853</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00078" summary="Bugfixes and improved tests">
|
||||
<created>1608986131753</created>
|
||||
<option name="number" value="00078" />
|
||||
<option name="presentableId" value="LOCAL-00078" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1608986131755</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00079" summary="Removed unused packages">
|
||||
<created>1611431001647</created>
|
||||
<option name="number" value="00079" />
|
||||
<option name="presentableId" value="LOCAL-00079" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1611431001649</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="80" />
|
||||
<servers />
|
||||
</component>
|
||||
<component name="Vcs.Log.Tabs.Properties">
|
||||
<option name="TAB_STATES">
|
||||
<map>
|
||||
<entry key="MAIN">
|
||||
<value>
|
||||
<State />
|
||||
</value>
|
||||
</entry>
|
||||
</map>
|
||||
</option>
|
||||
<option name="oldMeFiltersMigrated" value="true" />
|
||||
</component>
|
||||
<component name="VcsManagerConfiguration">
|
||||
<MESSAGE value="Added build command to cli" />
|
||||
<MESSAGE value="Improved publish process" />
|
||||
<MESSAGE value="Added publish command to cli" />
|
||||
<MESSAGE value="Added imports to cli module" />
|
||||
<MESSAGE value="Improved help command" />
|
||||
<MESSAGE value="Changed deps" />
|
||||
<MESSAGE value="Removed publisher.py" />
|
||||
<MESSAGE value="Added first steps of database command" />
|
||||
<MESSAGE value="Improved error handling" />
|
||||
<MESSAGE value="Improved service providing" />
|
||||
<MESSAGE value="Added email client" />
|
||||
<MESSAGE value="Published" />
|
||||
<MESSAGE value="Improved publisher" />
|
||||
<MESSAGE value="Added imports" />
|
||||
<MESSAGE value="Removed build form gitignore, added build command" />
|
||||
<MESSAGE value="Added init file for build command package" />
|
||||
<MESSAGE value="Added pycharm files to gitignore" />
|
||||
<MESSAGE value="Added more development tests" />
|
||||
<MESSAGE value="Added new tester and CredentialManager TestCase" />
|
||||
<MESSAGE value="Bugfix" />
|
||||
<MESSAGE value="Added TimeFormatSettings Test" />
|
||||
<MESSAGE value="Bugfixes" />
|
||||
<MESSAGE value="Improved tests" />
|
||||
<MESSAGE value="Bugfixes and improved tests" />
|
||||
<MESSAGE value="Removed unused packages" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="Removed unused packages" />
|
||||
</component>
|
||||
<component name="XDebuggerManager">
|
||||
<breakpoint-manager>
|
||||
<breakpoints>
|
||||
<line-breakpoint enabled="true" suspend="THREAD" type="python-line">
|
||||
<url>file://$PROJECT_DIR$/src/tests/publish_test/publisher_test.py</url>
|
||||
<line>50</line>
|
||||
<option name="timeStamp" value="3" />
|
||||
</line-breakpoint>
|
||||
</breakpoints>
|
||||
</breakpoint-manager>
|
||||
</component>
|
||||
</project>
|
||||
2
LICENSE
2
LICENSE
@@ -1,4 +1,4 @@
|
||||
MIT License Copyright (c) <year> <copyright holders>
|
||||
MIT License Copyright (c) 2020 - 2023 sh-edraft.de
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
153
README.md
153
README.md
@@ -1,2 +1,153 @@
|
||||
# sh_common_py_lib
|
||||
<h1 align="center">CPL - Common python library</h1>
|
||||
|
||||
<!-- Summary -->
|
||||
<p align="center">
|
||||
<!-- <img src="" alt="cpl-logo" width="120px" height="120px"/> -->
|
||||
<br>
|
||||
<i>
|
||||
CPL is a development platform for python server applications
|
||||
<br>using Python.</i>
|
||||
<br>
|
||||
</p>
|
||||
|
||||
## Table of Contents
|
||||
<!-- TABLE OF CONTENTS -->
|
||||
<ol>
|
||||
<li><a href="#Features">Features</a></li>
|
||||
<li>
|
||||
<a href="#getting-started">Getting Started</a>
|
||||
<ul>
|
||||
<li><a href="#prerequisites">Prerequisites</a></li>
|
||||
<li><a href="#installation">Installation</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#roadmap">Roadmap</a></li>
|
||||
<li><a href="#contributing">Contributing</a></li>
|
||||
<li><a href="#license">License</a></li>
|
||||
<li><a href="#contact">Contact</a></li>
|
||||
</ol>
|
||||
|
||||
## Features
|
||||
<!-- FEATURE OVERVIEW -->
|
||||
- Expandle
|
||||
- Application base
|
||||
- Standardized application classes
|
||||
- Application object builder
|
||||
- Application extension classes
|
||||
- Startup classes
|
||||
- Startup extension classes
|
||||
- Configuration
|
||||
- Configure via object mapped JSON
|
||||
- Console argument handling
|
||||
- Console class for in and output
|
||||
- Banner
|
||||
- Spinner
|
||||
- Options (menu)
|
||||
- Table
|
||||
- Write
|
||||
- Write_at
|
||||
- Write_line
|
||||
- Write_line_at
|
||||
- Dependency injection
|
||||
- Service lifetimes: singleton, scoped and transient
|
||||
- Providing of application environment
|
||||
- Environment (development, staging, testing, production)
|
||||
- Appname
|
||||
- Customer
|
||||
- Hostname
|
||||
- Runtime directory
|
||||
- Working directory
|
||||
- Logging
|
||||
- Standardized logger
|
||||
- Log-level (FATAL, ERROR, WARN, INFO, DEBUG & TRACE)
|
||||
- Mail handling
|
||||
- Send mails
|
||||
- Pipe classes
|
||||
- Convert input
|
||||
- Utils
|
||||
- Credential manager
|
||||
- Encryption via BASE64
|
||||
- PIP wrapper class based on subprocess
|
||||
- Run pip commands
|
||||
- String converter to different variants
|
||||
- to_lower_case
|
||||
- to_camel_case
|
||||
- ...
|
||||
|
||||
<!-- GETTING STARTED -->
|
||||
## Getting Started
|
||||
|
||||
[Get started with CPL][quickstart].
|
||||
|
||||
### Prerequisites
|
||||
|
||||
- Install [python] which includes [Pip installs packages][pip]
|
||||
|
||||
### Installation
|
||||
|
||||
Install the CPL package
|
||||
```sh
|
||||
pip install cpl-core --extra-index-url https://pip.sh-edraft.de
|
||||
```
|
||||
|
||||
Install the CPL CLI
|
||||
```sh
|
||||
pip install cpl-cli --extra-index-url https://pip.sh-edraft.de
|
||||
```
|
||||
|
||||
Create workspace:
|
||||
```sh
|
||||
cpl new <console|library|unittest> <PROJECT NAME>
|
||||
```
|
||||
|
||||
Run the application:
|
||||
```sh
|
||||
cd <PROJECT NAME>
|
||||
cpl start
|
||||
```
|
||||
|
||||
|
||||
<!-- ROADMAP -->
|
||||
## Roadmap
|
||||
|
||||
See the [open issues](https://git.sh-edraft.de/sh-edraft.de/sh_cpl/issues) for a list of proposed features (and known issues).
|
||||
|
||||
|
||||
|
||||
<!-- CONTRIBUTING -->
|
||||
## Contributing
|
||||
|
||||
### Contributing Guidelines
|
||||
|
||||
Read through our [contributing guidelines][contributing] to learn about our submission process, coding rules and more.
|
||||
|
||||
### Want to Help?
|
||||
|
||||
Want to file a bug, contribute some code, or improve documentation? Excellent! Read up on our guidelines for [contributing][contributing].
|
||||
|
||||
|
||||
|
||||
<!-- LICENSE -->
|
||||
## License
|
||||
|
||||
Distributed under the MIT License. See [LICENSE] for more information.
|
||||
|
||||
|
||||
|
||||
<!-- CONTACT -->
|
||||
## Contact
|
||||
|
||||
Sven Heidemann - sven.heidemann@sh-edraft.de
|
||||
|
||||
Project link: [https://git.sh-edraft.de/sh-edraft.de/sh_common_py_lib](https://git.sh-edraft.de/sh-edraft.de/sh_cpl)
|
||||
|
||||
<!-- External LINKS -->
|
||||
[pip_url]: https://pip.sh-edraft.de
|
||||
[python]: https://www.python.org/
|
||||
[pip]: https://pypi.org/project/pip/
|
||||
|
||||
<!-- Internal LINKS -->
|
||||
[project]: https://git.sh-edraft.de/sh-edraft.de/sh_cpl
|
||||
[quickstart]: https://git.sh-edraft.de/sh-edraft.de/sh_cpl/wiki/quickstart
|
||||
[contributing]: https://git.sh-edraft.de/sh-edraft.de/sh_cpl/wiki/contributing
|
||||
[license]: LICENSE
|
||||
|
||||
151
cpl-workspace.json
Normal file
151
cpl-workspace.json
Normal file
@@ -0,0 +1,151 @@
|
||||
{
|
||||
"WorkspaceSettings": {
|
||||
"DefaultProject": "cpl-core",
|
||||
"Projects": {
|
||||
"cpl-cli": "src/cpl_cli/cpl-cli.json",
|
||||
"cpl-core": "src/cpl_core/cpl-core.json",
|
||||
"cpl-discord": "src/cpl_discord/cpl-discord.json",
|
||||
"cpl-query": "src/cpl_query/cpl-query.json",
|
||||
"cpl-translation": "src/cpl_translation/cpl-translation.json",
|
||||
"set-version": "tools/set_version/set-version.json",
|
||||
"set-pip-urls": "tools/set_pip_urls/set-pip-urls.json",
|
||||
"unittests": "unittests/unittests/unittests.json",
|
||||
"unittests_cli": "unittests/unittests_cli/unittests_cli.json",
|
||||
"unittests_core": "unittests/unittests_core/unittests_core.json",
|
||||
"unittests_query": "unittests/unittests_query/unittests_query.json",
|
||||
"unittests_shared": "unittests/unittests_shared/unittests_shared.json",
|
||||
"unittests_translation": "unittests/unittests_translation/unittests_translation.json"
|
||||
},
|
||||
"Scripts": {
|
||||
"hello-world": "echo 'Hello World'",
|
||||
|
||||
"format": "echo 'Formatting:'; black ./",
|
||||
|
||||
"sv": "cpl set-version",
|
||||
"set-version": "cpl run set-version --dev $ARGS; echo '';",
|
||||
|
||||
"spu": "cpl set-pip-urls",
|
||||
"set-pip-urls": "cpl run set-pip-urls --dev $ARGS; echo '';",
|
||||
|
||||
"docs-build": "cpl format; echo 'Build Documentation'; cpl db-core; cpl db-discord; cpl db-query; cpl db-translation; cd docs/; make clean; make html;",
|
||||
"db-core": "cd docs/; sphinx-apidoc -o source/ ../src/cpl_core; cd ../",
|
||||
"db-discord": "cd docs/; sphinx-apidoc -o source/ ../src/cpl_discord; cd ../",
|
||||
"db-query": "cd docs/; sphinx-apidoc -o source/ ../src/cpl_query; cd ../",
|
||||
"db-translation": "cd docs/; sphinx-apidoc -o source/ ../src/cpl_translation; cd ../",
|
||||
"db": "cpl docs-build",
|
||||
|
||||
"docs-open": "xdg-open $PWD/docs/build/html/index.html &",
|
||||
"do": "cpl docs-open",
|
||||
|
||||
"test": "cpl run unittests",
|
||||
|
||||
"pre-build-all": "cpl sv $ARGS; cpl spu $ARGS;",
|
||||
"build-all": "cpl build-cli; cpl build-core; cpl build-discord; cpl build-query; cpl build-translation; cpl build-set-pip-urls; cpl build-set-version",
|
||||
"ba": "cpl build-all $ARGS",
|
||||
"build-cli": "echo 'Build cpl-cli'; cd ./src/cpl_cli; cpl build; cd ../../;",
|
||||
"build-core": "echo 'Build cpl-core'; cd ./src/cpl_core; cpl build; cd ../../;",
|
||||
"build-discord": "echo 'Build cpl-discord'; cd ./src/cpl_discord; cpl build; cd ../../;",
|
||||
"build-query": "echo 'Build cpl-query'; cd ./src/cpl_query; cpl build; cd ../../;",
|
||||
"build-translation": "echo 'Build cpl-translation'; cd ./src/cpl_translation; cpl build; cd ../../;",
|
||||
"build-set-pip-urls": "echo 'Build set-pip-urls'; cd ./tools/set_pip_urls; cpl build; cd ../../;",
|
||||
"build-set-version": "echo 'Build set-version'; cd ./tools/set_version; cpl build; cd ../../;",
|
||||
|
||||
"pre-publish-all": "cpl sv $ARGS; cpl spu $ARGS;",
|
||||
"publish-all": "cpl publish-cli; cpl publish-core; cpl publish-discord; cpl publish-query; cpl publish-translation;",
|
||||
"pa": "cpl publish-all $ARGS",
|
||||
"publish-cli": "echo 'Publish cpl-cli'; cd ./src/cpl_cli; cpl publish; cd ../../;",
|
||||
"publish-core": "echo 'Publish cpl-core'; cd ./src/cpl_core; cpl publish; cd ../../;",
|
||||
"publish-discord": "echo 'Publish cpl-discord'; cd ./src/cpl_discord; cpl publish; cd ../../;",
|
||||
"publish-query": "echo 'Publish cpl-query'; cd ./src/cpl_query; cpl publish; cd ../../;",
|
||||
"publish-translation": "echo 'Publish cpl-translation'; cd ./src/cpl_translation; cpl publish; cd ../../;",
|
||||
|
||||
"upload-prod-cli": "echo 'PROD Upload cpl-cli'; cpl upl-prod-cli;",
|
||||
"upl-prod-cli": "twine upload -r pip.sh-edraft.de dist/cpl-cli/publish/setup/*",
|
||||
|
||||
"upload-prod-core": "echo 'PROD Upload cpl-core'; cpl upl-prod-core;",
|
||||
"upl-prod-core": "twine upload -r pip.sh-edraft.de dist/cpl-core/publish/setup/*",
|
||||
|
||||
"upload-prod-discord": "echo 'PROD Upload cpl-discord'; cpl upl-prod-discord;",
|
||||
"upl-prod-discord": "twine upload -r pip.sh-edraft.de dist/cpl-discord/publish/setup/*",
|
||||
|
||||
"upload-prod-query": "echo 'PROD Upload cpl-query'; cpl upl-prod-query;",
|
||||
"upl-prod-query": "twine upload -r pip.sh-edraft.de dist/cpl-query/publish/setup/*",
|
||||
|
||||
"upload-prod-translation": "echo 'PROD Upload cpl-translation'; cpl upl-prod-translation;",
|
||||
"upl-prod-translation": "twine upload -r pip.sh-edraft.de dist/cpl-translation/publish/setup/*",
|
||||
|
||||
"upload-exp-cli": "echo 'EXP Upload cpl-cli'; cpl upl-exp-cli;",
|
||||
"upl-exp-cli": "twine upload -r pip-exp.sh-edraft.de dist/cpl-cli/publish/setup/*",
|
||||
|
||||
"upload-exp-core": "echo 'EXP Upload cpl-core'; cpl upl-exp-core;",
|
||||
"upl-exp-core": "twine upload -r pip-exp.sh-edraft.de dist/cpl-core/publish/setup/*",
|
||||
|
||||
"upload-exp-discord": "echo 'EXP Upload cpl-discord'; cpl upl-exp-discord;",
|
||||
"upl-exp-discord": "twine upload -r pip-exp.sh-edraft.de dist/cpl-discord/publish/setup/*",
|
||||
|
||||
"upload-exp-query": "echo 'EXP Upload cpl-query'; cpl upl-exp-query;",
|
||||
"upl-exp-query": "twine upload -r pip-exp.sh-edraft.de dist/cpl-query/publish/setup/*",
|
||||
|
||||
"upload-exp-translation": "echo 'EXP Upload cpl-translation'; cpl upl-exp-translation;",
|
||||
"upl-exp-translation": "twine upload -r pip-exp.sh-edraft.de dist/cpl-translation/publish/setup/*",
|
||||
|
||||
"upload-dev-cli": "echo 'DEV Upload cpl-cli'; cpl upl-dev-cli;",
|
||||
"upl-dev-cli": "twine upload -r pip-dev.sh-edraft.de dist/cpl-cli/publish/setup/*",
|
||||
|
||||
"upload-dev-core": "echo 'DEV Upload cpl-core'; cpl upl-dev-core;",
|
||||
"upl-dev-core": "twine upload -r pip-dev.sh-edraft.de dist/cpl-core/publish/setup/*",
|
||||
|
||||
"upload-dev-discord": "echo 'DEV Upload cpl-discord'; cpl upl-dev-discord;",
|
||||
"upl-dev-discord": "twine upload -r pip-dev.sh-edraft.de dist/cpl-discord/publish/setup/*",
|
||||
|
||||
"upload-dev-query": "echo 'DEV Upload cpl-query'; cpl upl-dev-query;",
|
||||
"upl-dev-query": "twine upload -r pip-dev.sh-edraft.de dist/cpl-query/publish/setup/*",
|
||||
|
||||
"upload-dev-translation": "echo 'DEV Upload cpl-translation'; cpl upl-dev-translation;",
|
||||
"upl-dev-translation": "twine upload -r pip-dev.sh-edraft.de dist/cpl-translation/publish/setup/*",
|
||||
|
||||
"pre-deploy-prod": "cpl sv $ARGS; cpl spu --environment=production;",
|
||||
"deploy-prod": "cpl deploy-prod-cli; cpl deploy-prod-core; cpl deploy-prod-discord; cpl deploy-prod-query; cpl deploy-prod-translation;",
|
||||
"dp": "cpl deploy-prod $ARGS",
|
||||
"deploy-prod-cli": "cpl publish-cli; cpl upload-prod-cli",
|
||||
"deploy-prod-core": "cpl publish-core; cpl upload-prod-core",
|
||||
"deploy-prod-query": "cpl publish-query; cpl upload-prod-query",
|
||||
"deploy-prod-discord": "cpl publish-discord; cpl upload-prod-discord",
|
||||
"deploy-prod-translation": "cpl publish-translation; cpl upload-prod-translation",
|
||||
|
||||
"pre-deploy-exp": "cpl sv $ARGS; cpl spu --environment=staging;",
|
||||
"deploy-exp": "cpl deploy-exp-cli; cpl deploy-exp-core; cpl deploy-exp-discord; cpl deploy-exp-query; cpl deploy-exp-translation;",
|
||||
"de": "cpl deploy-exp $ARGS",
|
||||
"deploy-exp-cli": "cpl publish-cli; cpl upload-exp-cli",
|
||||
"deploy-exp-core": "cpl publish-core; cpl upload-exp-core",
|
||||
"deploy-exp-discord": "cpl publish-discord; cpl upload-exp-discord",
|
||||
"deploy-exp-query": "cpl publish-query; cpl upload-exp-query",
|
||||
"deploy-exp-translation": "cpl publish-translation; cpl upload-exp-translation",
|
||||
|
||||
"pre-deploy-dev": "cpl sv $ARGS; cpl spu --environment=development;",
|
||||
"deploy-dev": "cpl deploy-dev-cli; cpl deploy-dev-core; cpl deploy-dev-discord; cpl deploy-dev-query; cpl deploy-dev-translation;",
|
||||
"dd": "cpl deploy-dev $ARGS",
|
||||
"deploy-dev-cli": "cpl publish-cli; cpl upload-dev-cli",
|
||||
"deploy-dev-core": "cpl publish-core; cpl upload-dev-core",
|
||||
"deploy-dev-discord": "cpl publish-discord; cpl upload-dev-discord",
|
||||
"deploy-dev-query": "cpl publish-query; cpl upload-dev-query",
|
||||
"deploy-dev-translation": "cpl publish-query; cpl upload-dev-translation",
|
||||
|
||||
"dev-install": "cpl di-core; cpl di-cli; cpl di-query; cpl di-translation;",
|
||||
"di": "cpl dev-install",
|
||||
"di-core": "pip install cpl-core --pre --upgrade --extra-index-url https://pip-dev.sh-edraft.de",
|
||||
"di-cli": "pip install cpl-cli --pre --upgrade --extra-index-url https://pip-dev.sh-edraft.de",
|
||||
"di-discord": "pip install cpl-discord --pre --upgrade --extra-index-url https://pip-dev.sh-edraft.de",
|
||||
"di-query": "pip install cpl-query --pre --upgrade --extra-index-url https://pip-dev.sh-edraft.de",
|
||||
"di-translation": "pip install cpl-translation --pre --upgrade --extra-index-url https://pip-dev.sh-edraft.de",
|
||||
|
||||
"prod-install": "cpl pi-core; cpl pi-cli; cpl pi-query; cpl pi-translation;",
|
||||
"pi": "cpl prod-install",
|
||||
"pi-core": "pip install cpl-core --pre --upgrade --extra-index-url https://pip.sh-edraft.de",
|
||||
"pi-cli": "pip install cpl-cli --pre --upgrade --extra-index-url https://pip.sh-edraft.de",
|
||||
"pi-discord": "pip install cpl-discord --pre --upgrade --extra-index-url https://pip.sh-edraft.de",
|
||||
"pi-query": "pip install cpl-query --pre --upgrade --extra-index-url https://pip.sh-edraft.de",
|
||||
"pi-translation": "pip install cpl-translation --pre --upgrade --extra-index-url https://pip.sh-edraft.de"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
prefix: cpl
|
||||
commands:
|
||||
new:
|
||||
app
|
||||
base
|
||||
class
|
||||
configmodel
|
||||
enum
|
||||
service
|
||||
@@ -1,2 +0,0 @@
|
||||
python setup.py install # for install
|
||||
python setup.py sdist bdist_wheel # for build
|
||||
@@ -1,10 +0,0 @@
|
||||
- sh_edraft
|
||||
- common # Contains Interfaces and models for the hole library
|
||||
- interface
|
||||
- model
|
||||
- configuration # Contains classes for app configuration by JSON, ENV vars and arguments
|
||||
- discord # Contains classes for better use of discord.py
|
||||
- logging # Contains classes for logging
|
||||
- mailing # Contains classes for mailing
|
||||
- messenger # Contains classes for sh_messenger_server client
|
||||
- service # Contains classes to provide and use the services defined in this library
|
||||
@@ -1,2 +0,0 @@
|
||||
- create logger
|
||||
- use logger in publisher
|
||||
@@ -1,25 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
"""
|
||||
$Name $Description
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
$LongDescription
|
||||
|
||||
:copyright: (c) $CopyrightDate $CopyrightName
|
||||
:license: $LicenseName$LicenseDescription
|
||||
|
||||
"""
|
||||
|
||||
__title__ = '$Title'
|
||||
__author__ = '$Author'
|
||||
__license__ = '$LicenseName'
|
||||
__copyright__ = 'Copyright (c) $CopyrightDate $CopyrightName'
|
||||
__version__ = '$Version'
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
$Imports
|
||||
|
||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||
version_info = VersionInfo(major=$Major, minor=$Minor, micro=$Micro)
|
||||
2
pyproject.toml
Normal file
2
pyproject.toml
Normal file
@@ -0,0 +1,2 @@
|
||||
[tool.black]
|
||||
line-length = 120
|
||||
@@ -1,29 +0,0 @@
|
||||
aiohttp==3.6.3
|
||||
async-timeout==3.0.1
|
||||
attrs==20.3.0
|
||||
certifi==2020.11.8
|
||||
chardet==3.0.4
|
||||
click==7.1.2
|
||||
dateutils==0.6.12
|
||||
discord==1.0.1
|
||||
discord.py==1.5.1
|
||||
Flask==1.1.2
|
||||
idna==2.10
|
||||
itsdangerous==1.1.0
|
||||
Jinja2==2.11.2
|
||||
keyboard==0.13.5
|
||||
MarkupSafe==1.1.1
|
||||
multidict==4.7.6
|
||||
mysql-connector==2.2.9
|
||||
overloading==0.5.0
|
||||
python-dateutil==2.8.1
|
||||
pytz==2020.4
|
||||
six==1.15.0
|
||||
SQLAlchemy==1.3.20
|
||||
termcolor==1.1.0
|
||||
urllib3==1.26.2
|
||||
Werkzeug==1.0.1
|
||||
yarl==1.5.1
|
||||
setuptools~=49.2.1
|
||||
pyfiglet~=0.8.post1
|
||||
tabulate~=0.8.7
|
||||
@@ -1,2 +0,0 @@
|
||||
include ../ README
|
||||
recursive-include sh_edraft *.txt
|
||||
@@ -1,66 +0,0 @@
|
||||
{
|
||||
"TimeFormatSettings": {
|
||||
"DateFormat": "%Y-%m-%d",
|
||||
"TimeFormat": "%H:%M:%S",
|
||||
"DateTimeFormat": "%Y-%m-%d %H:%M:%S.%f",
|
||||
"DateTimeLogFormat": "%Y-%m-%d_%H-%M-%S"
|
||||
},
|
||||
"LoggingSettings": {
|
||||
"Path": "../build/logs/",
|
||||
"Filename": "log_$start_time.log",
|
||||
"ConsoleLogLevel": "INFO",
|
||||
"FileLogLevel": "TRACE"
|
||||
},
|
||||
"PublishSettings": {
|
||||
"SourcePath": "./",
|
||||
"DistPath": "../build/dist",
|
||||
"Templates": [
|
||||
{
|
||||
"TemplatePath": "../publish_templates/all_template.txt",
|
||||
"Name": "all",
|
||||
"Description": "",
|
||||
"LongDescription": "",
|
||||
"CopyrightDate": "2020",
|
||||
"CopyrightName": "sh-edraft.de",
|
||||
"LicenseName": "MIT",
|
||||
"LicenseDescription": ", see LICENSE for more details.",
|
||||
"Title": "",
|
||||
"Author": "Sven Heidemann",
|
||||
"Version": {
|
||||
"Major": 2020,
|
||||
"Minor": 12,
|
||||
"Micro": 10
|
||||
}
|
||||
},
|
||||
{
|
||||
"TemplatePath": "../publish_templates/all_template.txt",
|
||||
"Name": "sh_edraft",
|
||||
"Description": "common python library",
|
||||
"LongDescription": "Library to share common classes and models used at sh-edraft.de",
|
||||
"CopyrightDate": "2020",
|
||||
"CopyrightName": "sh-edraft.de",
|
||||
"LicenseName": "MIT",
|
||||
"LicenseDescription": ", see LICENSE for more details.",
|
||||
"Title": "",
|
||||
"Author": "Sven Heidemann",
|
||||
"Version": {
|
||||
"Major": 2020,
|
||||
"Minor": 12,
|
||||
"Micro": 10
|
||||
}
|
||||
}
|
||||
],
|
||||
"IncludedFiles": [
|
||||
"./MANIFEST.in",
|
||||
"../LICENSE",
|
||||
"../README.md",
|
||||
"../requirements.txt",
|
||||
"sh_edraft/cli/cpl_cli/templates"
|
||||
],
|
||||
"ExcludedFiles": [
|
||||
"./tests",
|
||||
"./tests_dev"
|
||||
],
|
||||
"TemplateEnding": "_template.txt"
|
||||
}
|
||||
}
|
||||
26
src/cpl_cli/.cpl/__init__.py
Normal file
26
src/cpl_cli/.cpl/__init__.py
Normal file
@@ -0,0 +1,26 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
"""
|
||||
cpl-cli CPL CLI
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
CPL Command Line Interface
|
||||
|
||||
:copyright: (c) 2020 - 2024 sh-edraft.de
|
||||
:license: MIT, see LICENSE for more details.
|
||||
|
||||
"""
|
||||
|
||||
__title__ = "cpl_cli"
|
||||
__author__ = "Sven Heidemann"
|
||||
__license__ = "MIT"
|
||||
__copyright__ = "Copyright (c) 2020 - 2024 sh-edraft.de"
|
||||
__version__ = "2024.10.0"
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
|
||||
# imports:
|
||||
|
||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||
version_info = VersionInfo(major="2024", minor="10", micro="0")
|
||||
69
src/cpl_cli/.cpl/project_console.py
Normal file
69
src/cpl_cli/.cpl/project_console.py
Normal file
@@ -0,0 +1,69 @@
|
||||
from cpl_cli.abc.project_type_abc import ProjectTypeABC
|
||||
from cpl_cli.configuration import WorkspaceSettings
|
||||
from cpl_core.utils import String
|
||||
|
||||
|
||||
class Console(ProjectTypeABC):
|
||||
def __init__(
|
||||
self,
|
||||
base_path: str,
|
||||
project_name: str,
|
||||
workspace: WorkspaceSettings,
|
||||
use_application_api: bool,
|
||||
use_startup: bool,
|
||||
use_service_providing: bool,
|
||||
use_async: bool,
|
||||
project_file_data: dict,
|
||||
):
|
||||
from project_file import ProjectFile
|
||||
from project_file_appsettings import ProjectFileAppsettings
|
||||
from project_file_code_application import ProjectFileApplication
|
||||
from project_file_code_main import ProjectFileMain
|
||||
from project_file_code_startup import ProjectFileStartup
|
||||
from project_file_readme import ProjectFileReadme
|
||||
from project_file_license import ProjectFileLicense
|
||||
from schematic_init import Init
|
||||
|
||||
ProjectTypeABC.__init__(
|
||||
self,
|
||||
base_path,
|
||||
project_name,
|
||||
workspace,
|
||||
use_application_api,
|
||||
use_startup,
|
||||
use_service_providing,
|
||||
use_async,
|
||||
project_file_data,
|
||||
)
|
||||
|
||||
project_path = f'{base_path}{String.convert_to_snake_case(project_name.split("/")[-1])}/'
|
||||
|
||||
self.add_template(ProjectFile(project_name.split("/")[-1], project_path, project_file_data))
|
||||
if workspace is None:
|
||||
self.add_template(ProjectFileLicense(""))
|
||||
self.add_template(ProjectFileReadme(""))
|
||||
self.add_template(Init("", "init", f"{base_path}tests/"))
|
||||
|
||||
self.add_template(Init("", "init", project_path))
|
||||
self.add_template(ProjectFileAppsettings(project_path))
|
||||
|
||||
if use_application_api:
|
||||
self.add_template(
|
||||
ProjectFileApplication(project_path, use_application_api, use_startup, use_service_providing, use_async)
|
||||
)
|
||||
|
||||
if use_startup:
|
||||
self.add_template(
|
||||
ProjectFileStartup(project_path, use_application_api, use_startup, use_service_providing, use_async)
|
||||
)
|
||||
|
||||
self.add_template(
|
||||
ProjectFileMain(
|
||||
project_name.split("/")[-1],
|
||||
project_path,
|
||||
use_application_api,
|
||||
use_startup,
|
||||
use_service_providing,
|
||||
use_async,
|
||||
)
|
||||
)
|
||||
13
src/cpl_cli/.cpl/project_file.py
Normal file
13
src/cpl_cli/.cpl/project_file.py
Normal file
@@ -0,0 +1,13 @@
|
||||
import json
|
||||
|
||||
from cpl_cli.abc.file_template_abc import FileTemplateABC
|
||||
|
||||
|
||||
class ProjectFile(FileTemplateABC):
|
||||
def __init__(self, name: str, path: str, code: dict):
|
||||
FileTemplateABC.__init__(self, "", path, "{}")
|
||||
self._name = f"{name}.json"
|
||||
self._code = code
|
||||
|
||||
def get_code(self) -> str:
|
||||
return json.dumps(self._code, indent=2)
|
||||
29
src/cpl_cli/.cpl/project_file_appsettings.py
Normal file
29
src/cpl_cli/.cpl/project_file_appsettings.py
Normal file
@@ -0,0 +1,29 @@
|
||||
import textwrap
|
||||
|
||||
from cpl_cli.abc.file_template_abc import FileTemplateABC
|
||||
|
||||
|
||||
class ProjectFileAppsettings(FileTemplateABC):
|
||||
def __init__(self, path: str):
|
||||
FileTemplateABC.__init__(self, "", path, "{}")
|
||||
self._name = "appsettings.json"
|
||||
|
||||
def get_code(self) -> str:
|
||||
return textwrap.dedent(
|
||||
"""\
|
||||
{
|
||||
"TimeFormatSettings": {
|
||||
"DateFormat": "%Y-%m-%d",
|
||||
"TimeFormat": "%H:%M:%S",
|
||||
"DateTimeFormat": "%Y-%m-%d %H:%M:%S.%f",
|
||||
"DateTimeLogFormat": "%Y-%m-%d_%H-%M-%S"
|
||||
},
|
||||
"LoggingSettings": {
|
||||
"Path": "logs/",
|
||||
"Filename": "log_$start_time.log",
|
||||
"ConsoleLogLevel": "ERROR",
|
||||
"FileLogLevel": "WARN"
|
||||
}
|
||||
}
|
||||
"""
|
||||
)
|
||||
56
src/cpl_cli/.cpl/project_file_code_application.py
Normal file
56
src/cpl_cli/.cpl/project_file_code_application.py
Normal file
@@ -0,0 +1,56 @@
|
||||
from cpl_cli.abc.code_file_template_abc import CodeFileTemplateABC
|
||||
|
||||
|
||||
class ProjectFileApplication(CodeFileTemplateABC):
|
||||
def __init__(
|
||||
self, path: str, use_application_api: bool, use_startup: bool, use_service_providing: bool, use_async: bool
|
||||
):
|
||||
CodeFileTemplateABC.__init__(
|
||||
self, "application", path, "", use_application_api, use_startup, use_service_providing, use_async
|
||||
)
|
||||
|
||||
def get_code(self) -> str:
|
||||
import textwrap
|
||||
|
||||
if self._use_async:
|
||||
return textwrap.dedent(
|
||||
"""\
|
||||
from cpl_core.application import ApplicationABC
|
||||
from cpl_core.configuration import ConfigurationABC
|
||||
from cpl_core.console import Console
|
||||
from cpl_core.dependency_injection import ServiceProviderABC
|
||||
|
||||
|
||||
class Application(ApplicationABC):
|
||||
|
||||
def __init__(self, config: ConfigurationABC, services: ServiceProviderABC):
|
||||
ApplicationABC.__init__(self, config, services)
|
||||
|
||||
async def configure(self):
|
||||
pass
|
||||
|
||||
async def main(self):
|
||||
Console.write_line('Hello World')
|
||||
"""
|
||||
)
|
||||
|
||||
return textwrap.dedent(
|
||||
"""\
|
||||
from cpl_core.application import ApplicationABC
|
||||
from cpl_core.configuration import ConfigurationABC
|
||||
from cpl_core.console import Console
|
||||
from cpl_core.dependency_injection import ServiceProviderABC
|
||||
|
||||
|
||||
class Application(ApplicationABC):
|
||||
|
||||
def __init__(self, config: ConfigurationABC, services: ServiceProviderABC):
|
||||
ApplicationABC.__init__(self, config, services)
|
||||
|
||||
def configure(self):
|
||||
pass
|
||||
|
||||
def main(self):
|
||||
Console.write_line('Hello World')
|
||||
"""
|
||||
)
|
||||
107
src/cpl_cli/.cpl/project_file_code_main.py
Normal file
107
src/cpl_cli/.cpl/project_file_code_main.py
Normal file
@@ -0,0 +1,107 @@
|
||||
from cpl_cli.abc.code_file_template_abc import CodeFileTemplateABC
|
||||
from cpl_core.utils import String
|
||||
|
||||
|
||||
class ProjectFileMain(CodeFileTemplateABC):
|
||||
def __init__(
|
||||
self,
|
||||
name: str,
|
||||
path: str,
|
||||
use_application_api: bool,
|
||||
use_startup: bool,
|
||||
use_service_providing: bool,
|
||||
use_async: bool,
|
||||
):
|
||||
CodeFileTemplateABC.__init__(
|
||||
self, "main", path, "", use_application_api, use_startup, use_service_providing, use_async
|
||||
)
|
||||
|
||||
import textwrap
|
||||
|
||||
import_pkg = f"{String.convert_to_snake_case(name)}."
|
||||
|
||||
self._main_with_application_host_and_startup = textwrap.dedent(
|
||||
f"""\
|
||||
{"import asyncio" if self._use_async else ''}
|
||||
|
||||
from cpl_core.application import ApplicationBuilder
|
||||
|
||||
from {import_pkg}application import Application
|
||||
from {import_pkg}startup import Startup
|
||||
|
||||
|
||||
{self._async()}def main():
|
||||
app_builder = ApplicationBuilder(Application)
|
||||
app_builder.use_startup(Startup)
|
||||
{"app: Application = await app_builder.build_async()" if self._use_async else ""}
|
||||
{"await app.run_async()" if self._use_async else "app_builder.build().run()"}
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
{"asyncio.run(main())" if self._use_async else "main()"}
|
||||
"""
|
||||
)
|
||||
self._main_with_application_base = textwrap.dedent(
|
||||
f"""\
|
||||
{"import asyncio" if self._use_async else ''}
|
||||
|
||||
from cpl_core.application import ApplicationBuilder
|
||||
|
||||
from {import_pkg}application import Application
|
||||
|
||||
|
||||
{self._async()}def main():
|
||||
app_builder = ApplicationBuilder(Application)
|
||||
{"app: Application = await app_builder.build_async()" if self._use_async else ""}
|
||||
{"await app.run_async()" if self._use_async else "app_builder.build().run()"}
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
{"asyncio.run(main())" if self._use_async else "main()"}
|
||||
"""
|
||||
)
|
||||
|
||||
self._main_with_dependency_injection = textwrap.dedent(
|
||||
f"""\
|
||||
{"import asyncio" if self._use_async else ''}
|
||||
|
||||
from cpl_core.application import ApplicationBuilder
|
||||
|
||||
|
||||
{self._async()}def configure_configuration() -> ConfigurationABC:
|
||||
config = Configuration()
|
||||
return config
|
||||
|
||||
|
||||
{self._async()}def configure_services(config: ConfigurationABC) -> ServiceProviderABC:
|
||||
services = ServiceCollection(config)
|
||||
return services.build_service_provider()
|
||||
|
||||
|
||||
{self._async()}def main():
|
||||
config = {self._async()}configure_configuration()
|
||||
provider = {self._async()}configure_services(config)
|
||||
Console.write_line('Hello World')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
{"asyncio.run(main())" if self._use_async else "main()"}
|
||||
"""
|
||||
)
|
||||
|
||||
def _async(self) -> str:
|
||||
if self._use_async:
|
||||
return "async "
|
||||
return ""
|
||||
|
||||
def get_code(self) -> str:
|
||||
if self._use_application_api and self._use_startup:
|
||||
return self._main_with_application_host_and_startup
|
||||
|
||||
if self._use_application_api:
|
||||
return self._main_with_application_base
|
||||
|
||||
if self._use_service_providing:
|
||||
return self._main_with_dependency_injection
|
||||
|
||||
return self._main_with_application_base
|
||||
34
src/cpl_cli/.cpl/project_file_code_startup.py
Normal file
34
src/cpl_cli/.cpl/project_file_code_startup.py
Normal file
@@ -0,0 +1,34 @@
|
||||
from cpl_cli.abc.code_file_template_abc import CodeFileTemplateABC
|
||||
|
||||
|
||||
class ProjectFileStartup(CodeFileTemplateABC):
|
||||
def __init__(
|
||||
self, path: str, use_application_api: bool, use_startup: bool, use_service_providing: bool, use_async: bool
|
||||
):
|
||||
CodeFileTemplateABC.__init__(
|
||||
self, "startup", path, "", use_application_api, use_startup, use_service_providing, use_async
|
||||
)
|
||||
|
||||
def get_code(self) -> str:
|
||||
import textwrap
|
||||
|
||||
return textwrap.dedent(
|
||||
"""\
|
||||
from cpl_core.application import StartupABC
|
||||
from cpl_core.configuration import ConfigurationABC
|
||||
from cpl_core.dependency_injection import ServiceProviderABC, ServiceCollectionABC
|
||||
from cpl_core.environment import ApplicationEnvironment
|
||||
|
||||
|
||||
class Startup(StartupABC):
|
||||
|
||||
def __init__(self):
|
||||
StartupABC.__init__(self)
|
||||
|
||||
def configure_configuration(self, configuration: ConfigurationABC, environment: ApplicationEnvironment) -> ConfigurationABC:
|
||||
return configuration
|
||||
|
||||
def configure_services(self, services: ServiceCollectionABC, environment: ApplicationEnvironment) -> ServiceProviderABC:
|
||||
return services.build_service_provider()
|
||||
"""
|
||||
)
|
||||
66
src/cpl_cli/.cpl/project_file_code_test_application.py
Normal file
66
src/cpl_cli/.cpl/project_file_code_test_application.py
Normal file
@@ -0,0 +1,66 @@
|
||||
from cpl_cli.abc.code_file_template_abc import CodeFileTemplateABC
|
||||
|
||||
|
||||
class ProjectFileTestApplication(CodeFileTemplateABC):
|
||||
def __init__(
|
||||
self, path: str, use_application_api: bool, use_startup: bool, use_service_providing: bool, use_async: bool
|
||||
):
|
||||
CodeFileTemplateABC.__init__(
|
||||
self, "application", path, "", use_application_api, use_startup, use_service_providing, use_async
|
||||
)
|
||||
|
||||
def get_code(self) -> str:
|
||||
import textwrap
|
||||
|
||||
if self._use_async:
|
||||
return textwrap.dedent(
|
||||
"""\
|
||||
import unittest
|
||||
from unittest import TestSuite
|
||||
|
||||
from cpl_core.application import ApplicationABC
|
||||
from cpl_core.configuration import ConfigurationABC
|
||||
from cpl_core.dependency_injection import ServiceProviderABC
|
||||
from unittests.test_case import TestCase
|
||||
|
||||
|
||||
class Application(ApplicationABC):
|
||||
|
||||
def __init__(self, config: ConfigurationABC, services: ServiceProviderABC):
|
||||
ApplicationABC.__init__(self, config, services)
|
||||
self._suite: TestSuite = unittest.TestSuite()
|
||||
|
||||
async def configure(self):
|
||||
self._suite.addTest(TestCase('test_equal'))
|
||||
|
||||
async def main(self):
|
||||
runner = unittest.TextTestRunner()
|
||||
runner.run(self._suite)
|
||||
"""
|
||||
)
|
||||
|
||||
return textwrap.dedent(
|
||||
"""\
|
||||
import unittest
|
||||
from unittest import TestSuite
|
||||
|
||||
from cpl_core.application import ApplicationABC
|
||||
from cpl_core.configuration import ConfigurationABC
|
||||
from cpl_core.dependency_injection import ServiceProviderABC
|
||||
from unittests.test_case import TestCase
|
||||
|
||||
|
||||
class Application(ApplicationABC):
|
||||
|
||||
def __init__(self, config: ConfigurationABC, services: ServiceProviderABC):
|
||||
ApplicationABC.__init__(self, config, services)
|
||||
self._suite: TestSuite = unittest.TestSuite()
|
||||
|
||||
def configure(self):
|
||||
self._suite.addTest(TestCase('test_equal'))
|
||||
|
||||
def main(self):
|
||||
runner = unittest.TextTestRunner()
|
||||
runner.run(self._suite)
|
||||
"""
|
||||
)
|
||||
44
src/cpl_cli/.cpl/project_file_code_test_case.py
Normal file
44
src/cpl_cli/.cpl/project_file_code_test_case.py
Normal file
@@ -0,0 +1,44 @@
|
||||
from cpl_cli.abc.code_file_template_abc import CodeFileTemplateABC
|
||||
|
||||
|
||||
class ProjectFileTestCase(CodeFileTemplateABC):
|
||||
def __init__(
|
||||
self, path: str, use_application_api: bool, use_startup: bool, use_service_providing: bool, use_async: bool
|
||||
):
|
||||
CodeFileTemplateABC.__init__(
|
||||
self, "test_case", path, "", use_application_api, use_startup, use_service_providing, use_async
|
||||
)
|
||||
|
||||
def get_code(self) -> str:
|
||||
import textwrap
|
||||
|
||||
if self._use_async:
|
||||
return textwrap.dedent(
|
||||
"""\
|
||||
import unittest
|
||||
|
||||
|
||||
class TestCase(unittest.TestCase):
|
||||
|
||||
async def setUp(self) -> None:
|
||||
pass
|
||||
|
||||
async def test_equal(self):
|
||||
self.assertEqual(True, True)
|
||||
"""
|
||||
)
|
||||
|
||||
return textwrap.dedent(
|
||||
"""\
|
||||
import unittest
|
||||
|
||||
|
||||
class TestCase(unittest.TestCase):
|
||||
|
||||
def setUp(self) -> None:
|
||||
pass
|
||||
|
||||
def test_equal(self):
|
||||
self.assertEqual(True, True)
|
||||
"""
|
||||
)
|
||||
10
src/cpl_cli/.cpl/project_file_license.py
Normal file
10
src/cpl_cli/.cpl/project_file_license.py
Normal file
@@ -0,0 +1,10 @@
|
||||
from cpl_cli.abc.file_template_abc import FileTemplateABC
|
||||
|
||||
|
||||
class ProjectFileLicense(FileTemplateABC):
|
||||
def __init__(self, path: str):
|
||||
FileTemplateABC.__init__(self, "", path, "")
|
||||
self._name = "LICENSE"
|
||||
|
||||
def get_code(self) -> str:
|
||||
return self._code
|
||||
10
src/cpl_cli/.cpl/project_file_readme.py
Normal file
10
src/cpl_cli/.cpl/project_file_readme.py
Normal file
@@ -0,0 +1,10 @@
|
||||
from cpl_cli.abc.file_template_abc import FileTemplateABC
|
||||
|
||||
|
||||
class ProjectFileReadme(FileTemplateABC):
|
||||
def __init__(self, path: str):
|
||||
FileTemplateABC.__init__(self, "", path, "")
|
||||
self._name = "README.md"
|
||||
|
||||
def get_code(self) -> str:
|
||||
return self._code
|
||||
46
src/cpl_cli/.cpl/project_library.py
Normal file
46
src/cpl_cli/.cpl/project_library.py
Normal file
@@ -0,0 +1,46 @@
|
||||
import os
|
||||
|
||||
from cpl_cli.abc.project_type_abc import ProjectTypeABC
|
||||
from cpl_cli.configuration import WorkspaceSettings
|
||||
from cpl_core.utils import String
|
||||
|
||||
|
||||
class Library(ProjectTypeABC):
|
||||
def __init__(
|
||||
self,
|
||||
base_path: str,
|
||||
project_name: str,
|
||||
workspace: WorkspaceSettings,
|
||||
use_application_api: bool,
|
||||
use_startup: bool,
|
||||
use_service_providing: bool,
|
||||
use_async: bool,
|
||||
project_file_data: dict,
|
||||
):
|
||||
from project_file import ProjectFile
|
||||
from project_file_readme import ProjectFileReadme
|
||||
from project_file_license import ProjectFileLicense
|
||||
from schematic_init import Init
|
||||
from schematic_class import Class
|
||||
|
||||
ProjectTypeABC.__init__(
|
||||
self,
|
||||
base_path,
|
||||
project_name,
|
||||
workspace,
|
||||
use_application_api,
|
||||
use_startup,
|
||||
use_service_providing,
|
||||
use_async,
|
||||
project_file_data,
|
||||
)
|
||||
|
||||
project_path = f'{base_path}{String.convert_to_snake_case(project_name.split("/")[-1])}/'
|
||||
|
||||
self.add_template(ProjectFile(project_name.split("/")[-1], project_path, project_file_data))
|
||||
if workspace is None:
|
||||
self.add_template(ProjectFileLicense(""))
|
||||
self.add_template(ProjectFileReadme(""))
|
||||
|
||||
self.add_template(Init("", "init", project_path))
|
||||
self.add_template(Class("Class1", "class", project_path))
|
||||
64
src/cpl_cli/.cpl/project_unittest.py
Normal file
64
src/cpl_cli/.cpl/project_unittest.py
Normal file
@@ -0,0 +1,64 @@
|
||||
import os
|
||||
|
||||
from cpl_cli.abc.project_type_abc import ProjectTypeABC
|
||||
from cpl_cli.configuration import WorkspaceSettings
|
||||
from cpl_core.utils import String
|
||||
|
||||
|
||||
class Unittest(ProjectTypeABC):
|
||||
def __init__(
|
||||
self,
|
||||
base_path: str,
|
||||
project_name: str,
|
||||
workspace: WorkspaceSettings,
|
||||
use_application_api: bool,
|
||||
use_startup: bool,
|
||||
use_service_providing: bool,
|
||||
use_async: bool,
|
||||
project_file_data: dict,
|
||||
):
|
||||
from project_file import ProjectFile
|
||||
from project_file_code_application import ProjectFileApplication
|
||||
from project_file_code_main import ProjectFileMain
|
||||
from project_file_code_test_case import ProjectFileTestCase
|
||||
from project_file_readme import ProjectFileReadme
|
||||
from project_file_license import ProjectFileLicense
|
||||
from schematic_init import Init
|
||||
|
||||
ProjectTypeABC.__init__(
|
||||
self,
|
||||
base_path,
|
||||
project_name,
|
||||
workspace,
|
||||
use_application_api,
|
||||
use_startup,
|
||||
use_service_providing,
|
||||
use_async,
|
||||
project_file_data,
|
||||
)
|
||||
|
||||
project_path = f'{base_path}{String.convert_to_snake_case(project_name.split("/")[-1])}/'
|
||||
|
||||
self.add_template(ProjectFile(project_name.split("/")[-1], project_path, project_file_data))
|
||||
if workspace is None:
|
||||
self.add_template(ProjectFileLicense(""))
|
||||
self.add_template(ProjectFileReadme(""))
|
||||
self.add_template(Init("", "init", f"{base_path}tests/"))
|
||||
|
||||
self.add_template(Init("", "init", project_path))
|
||||
self.add_template(
|
||||
ProjectFileApplication(project_path, use_application_api, use_startup, use_service_providing, use_async)
|
||||
)
|
||||
self.add_template(
|
||||
ProjectFileMain(
|
||||
project_name.split("/")[-1],
|
||||
project_path,
|
||||
use_application_api,
|
||||
use_startup,
|
||||
use_service_providing,
|
||||
use_async,
|
||||
)
|
||||
)
|
||||
self.add_template(
|
||||
ProjectFileTestCase(project_path, use_application_api, use_startup, use_service_providing, use_async)
|
||||
)
|
||||
27
src/cpl_cli/.cpl/schematic_abc.py
Normal file
27
src/cpl_cli/.cpl/schematic_abc.py
Normal file
@@ -0,0 +1,27 @@
|
||||
from cpl_cli.abc.generate_schematic_abc import GenerateSchematicABC
|
||||
from cpl_core.utils import String
|
||||
|
||||
|
||||
class ABC(GenerateSchematicABC):
|
||||
def __init__(self, name: str, schematic: str, path: str):
|
||||
GenerateSchematicABC.__init__(self, name, schematic, path)
|
||||
self._class_name = name
|
||||
if name != "":
|
||||
self._class_name = f'{String.first_to_upper(name.replace(schematic, ""))}ABC'
|
||||
|
||||
def get_code(self) -> str:
|
||||
code = """\
|
||||
from abc import ABC, abstractmethod
|
||||
|
||||
|
||||
class $Name(ABC):
|
||||
|
||||
@abstractmethod
|
||||
def __init__(self): pass
|
||||
"""
|
||||
x = self.build_code_str(code, Name=self._class_name)
|
||||
return x
|
||||
|
||||
@classmethod
|
||||
def register(cls):
|
||||
GenerateSchematicABC.register(cls, "abc", ["a", "A"])
|
||||
34
src/cpl_cli/.cpl/schematic_application.py
Normal file
34
src/cpl_cli/.cpl/schematic_application.py
Normal file
@@ -0,0 +1,34 @@
|
||||
import textwrap
|
||||
|
||||
from cpl_cli.abc.generate_schematic_abc import GenerateSchematicABC
|
||||
|
||||
|
||||
class Application(GenerateSchematicABC):
|
||||
def __init__(self, *args: str):
|
||||
GenerateSchematicABC.__init__(self, *args)
|
||||
|
||||
def get_code(self) -> str:
|
||||
code = """\
|
||||
from cpl_core.application import ApplicationABC
|
||||
from cpl_core.configuration import ConfigurationABC
|
||||
from cpl_core.console import Console
|
||||
from cpl_core.dependency_injection import ServiceProviderABC
|
||||
|
||||
|
||||
class $Name(ApplicationABC):
|
||||
|
||||
def __init__(self, config: ConfigurationABC, services: ServiceProviderABC):
|
||||
ApplicationABC.__init__(self, config, services)
|
||||
|
||||
def configure(self):
|
||||
pass
|
||||
|
||||
def main(self):
|
||||
Console.write_line('Hello World')
|
||||
"""
|
||||
x = self.build_code_str(code, Name=self._class_name)
|
||||
return x
|
||||
|
||||
@classmethod
|
||||
def register(cls):
|
||||
GenerateSchematicABC.register(cls, "application", ["app", "APP"])
|
||||
31
src/cpl_cli/.cpl/schematic_application_extension.py
Normal file
31
src/cpl_cli/.cpl/schematic_application_extension.py
Normal file
@@ -0,0 +1,31 @@
|
||||
import textwrap
|
||||
|
||||
from cpl_cli.abc.generate_schematic_abc import GenerateSchematicABC
|
||||
from cpl_core.utils import String
|
||||
|
||||
|
||||
class ApplicationExtension(GenerateSchematicABC):
|
||||
def __init__(self, *args: str):
|
||||
GenerateSchematicABC.__init__(self, *args)
|
||||
|
||||
def get_code(self) -> str:
|
||||
code = """\
|
||||
from cpl_core.application import ApplicationExtensionABC
|
||||
from cpl_core.configuration import ConfigurationABC
|
||||
from cpl_core.dependency_injection import ServiceProviderABC
|
||||
|
||||
|
||||
class $Name(ApplicationExtensionABC):
|
||||
|
||||
def __init__(self):
|
||||
ApplicationExtensionABC.__init__(self)
|
||||
|
||||
def run(self, config: ConfigurationABC, services: ServiceProviderABC):
|
||||
pass
|
||||
"""
|
||||
x = self.build_code_str(code, Name=String.convert_to_camel_case(self._class_name))
|
||||
return x
|
||||
|
||||
@classmethod
|
||||
def register(cls):
|
||||
GenerateSchematicABC.register(cls, "application-extension", ["appex", "APPEX"])
|
||||
23
src/cpl_cli/.cpl/schematic_class.py
Normal file
23
src/cpl_cli/.cpl/schematic_class.py
Normal file
@@ -0,0 +1,23 @@
|
||||
from cpl_cli.abc.generate_schematic_abc import GenerateSchematicABC
|
||||
from cpl_core.utils import String
|
||||
|
||||
|
||||
class Class(GenerateSchematicABC):
|
||||
def __init__(self, name: str, schematic: str, path: str):
|
||||
GenerateSchematicABC.__init__(self, name, schematic, path)
|
||||
self._name = f"{String.convert_to_snake_case(name)}.py"
|
||||
self._class_name = f"{String.first_to_upper(name)}"
|
||||
|
||||
def get_code(self) -> str:
|
||||
code = """\
|
||||
class $Name:
|
||||
|
||||
def __init__(self):
|
||||
pass
|
||||
"""
|
||||
x = self.build_code_str(code, Name=self._class_name)
|
||||
return x
|
||||
|
||||
@classmethod
|
||||
def register(cls):
|
||||
GenerateSchematicABC.register(cls, "class", ["c", "C"])
|
||||
35
src/cpl_cli/.cpl/schematic_configmodel.py
Normal file
35
src/cpl_cli/.cpl/schematic_configmodel.py
Normal file
@@ -0,0 +1,35 @@
|
||||
import textwrap
|
||||
|
||||
from cpl_cli.abc.generate_schematic_abc import GenerateSchematicABC
|
||||
|
||||
|
||||
class ConfigModel(GenerateSchematicABC):
|
||||
def __init__(self, *args: str):
|
||||
GenerateSchematicABC.__init__(self, *args)
|
||||
|
||||
def get_code(self) -> str:
|
||||
code = """\
|
||||
import traceback
|
||||
|
||||
from cpl_core.configuration.configuration_model_abc import ConfigurationModelABC
|
||||
from cpl_core.console import Console
|
||||
|
||||
|
||||
class $Name(ConfigurationModelABC):
|
||||
|
||||
def __init__(self, atr: str = None):
|
||||
ConfigurationModelABC.__init__(self)
|
||||
|
||||
self._atr = atr
|
||||
|
||||
@property
|
||||
def atr(self) -> str:
|
||||
return self._atr
|
||||
|
||||
"""
|
||||
x = self.build_code_str(code, Name=self._class_name)
|
||||
return x
|
||||
|
||||
@classmethod
|
||||
def register(cls):
|
||||
GenerateSchematicABC.register(cls, "settings", ["st", "ST"])
|
||||
25
src/cpl_cli/.cpl/schematic_enum.py
Normal file
25
src/cpl_cli/.cpl/schematic_enum.py
Normal file
@@ -0,0 +1,25 @@
|
||||
from cpl_cli.abc.generate_schematic_abc import GenerateSchematicABC
|
||||
|
||||
|
||||
class Enum(GenerateSchematicABC):
|
||||
def __init__(self, *args: str):
|
||||
GenerateSchematicABC.__init__(self, *args)
|
||||
|
||||
def get_code(self) -> str:
|
||||
import textwrap
|
||||
|
||||
code = textwrap.dedent(
|
||||
"""\
|
||||
from enum import Enum
|
||||
|
||||
|
||||
class $Name(Enum):
|
||||
|
||||
atr = 0
|
||||
"""
|
||||
)
|
||||
return self.build_code_str(code, Name=self._class_name)
|
||||
|
||||
@classmethod
|
||||
def register(cls):
|
||||
GenerateSchematicABC.register(cls, "enum", ["e", "E"])
|
||||
20
src/cpl_cli/.cpl/schematic_init.py
Normal file
20
src/cpl_cli/.cpl/schematic_init.py
Normal file
@@ -0,0 +1,20 @@
|
||||
import textwrap
|
||||
|
||||
from cpl_cli.abc.generate_schematic_abc import GenerateSchematicABC
|
||||
|
||||
|
||||
class Init(GenerateSchematicABC):
|
||||
def __init__(self, *args: str):
|
||||
GenerateSchematicABC.__init__(self, *args)
|
||||
self._name = f"__init__.py"
|
||||
|
||||
def get_code(self) -> str:
|
||||
code = """\
|
||||
# imports
|
||||
"""
|
||||
x = self.build_code_str(code, Name=self._class_name)
|
||||
return x
|
||||
|
||||
@classmethod
|
||||
def register(cls):
|
||||
GenerateSchematicABC.register(cls, "init", [])
|
||||
27
src/cpl_cli/.cpl/schematic_pipe.py
Normal file
27
src/cpl_cli/.cpl/schematic_pipe.py
Normal file
@@ -0,0 +1,27 @@
|
||||
import textwrap
|
||||
|
||||
from cpl_cli.abc.generate_schematic_abc import GenerateSchematicABC
|
||||
|
||||
|
||||
class Pipe(GenerateSchematicABC):
|
||||
def __init__(self, *args: str):
|
||||
GenerateSchematicABC.__init__(self, *args)
|
||||
|
||||
def get_code(self) -> str:
|
||||
code = """\
|
||||
from cpl_core.pipes.pipe_abc import PipeABC
|
||||
|
||||
|
||||
class $Name(PipeABC):
|
||||
|
||||
def __init__(self): pass
|
||||
|
||||
def transform(self, value: any, *args):
|
||||
return value
|
||||
"""
|
||||
x = self.build_code_str(code, Name=self._class_name)
|
||||
return x
|
||||
|
||||
@classmethod
|
||||
def register(cls):
|
||||
GenerateSchematicABC.register(cls, "pipe", ["p", "P"])
|
||||
46
src/cpl_cli/.cpl/schematic_schematic.py
Normal file
46
src/cpl_cli/.cpl/schematic_schematic.py
Normal file
@@ -0,0 +1,46 @@
|
||||
from cpl_cli.abc.generate_schematic_abc import GenerateSchematicABC
|
||||
from cpl_core.utils import String
|
||||
|
||||
|
||||
class Schematic(GenerateSchematicABC):
|
||||
def __init__(self, name: str, path: str, schematic: str):
|
||||
GenerateSchematicABC.__init__(self, name, path, schematic)
|
||||
self._name = f"schematic_{String.convert_to_snake_case(name)}.py"
|
||||
self._path = ".cpl/"
|
||||
self._class_name = String.convert_to_camel_case(name)
|
||||
|
||||
def get_code(self) -> str:
|
||||
code = """\
|
||||
from cpl_cli.abc.generate_schematic_abc import GenerateSchematicABC
|
||||
|
||||
|
||||
class $Name(GenerateSchematicABC):
|
||||
|
||||
def __init__(self, *args: str):
|
||||
GenerateSchematicABC.__init__(self, *args)
|
||||
|
||||
def get_code(self) -> str:
|
||||
import textwrap
|
||||
code = textwrap.dedent(\"\"\"\\
|
||||
from enum import Enum
|
||||
|
||||
|
||||
class $Name(Enum):
|
||||
|
||||
atr = 0
|
||||
\"\"\")
|
||||
return self.build_code_str(code, Name=self._class_name)
|
||||
|
||||
@classmethod
|
||||
def register(cls):
|
||||
GenerateSchematicABC.register(
|
||||
cls,
|
||||
'$NameLower',
|
||||
[]
|
||||
)
|
||||
"""
|
||||
return self.build_code_str(code, Name=self._class_name, NameLower=self._class_name.lower())
|
||||
|
||||
@classmethod
|
||||
def register(cls):
|
||||
GenerateSchematicABC.register(cls, "schematic", ["scheme", "SCHEME"])
|
||||
22
src/cpl_cli/.cpl/schematic_service.py
Normal file
22
src/cpl_cli/.cpl/schematic_service.py
Normal file
@@ -0,0 +1,22 @@
|
||||
import textwrap
|
||||
|
||||
from cpl_cli.abc.generate_schematic_abc import GenerateSchematicABC
|
||||
|
||||
|
||||
class Service(GenerateSchematicABC):
|
||||
def __init__(self, *args: str):
|
||||
GenerateSchematicABC.__init__(self, *args)
|
||||
|
||||
def get_code(self) -> str:
|
||||
code = """\
|
||||
class $Name:
|
||||
|
||||
def __init__(self):
|
||||
pass
|
||||
"""
|
||||
x = self.build_code_str(code, Name=self._class_name)
|
||||
return x
|
||||
|
||||
@classmethod
|
||||
def register(cls):
|
||||
GenerateSchematicABC.register(cls, "service", ["s", "S"])
|
||||
34
src/cpl_cli/.cpl/schematic_startup.py
Normal file
34
src/cpl_cli/.cpl/schematic_startup.py
Normal file
@@ -0,0 +1,34 @@
|
||||
import textwrap
|
||||
|
||||
from cpl_cli.abc.generate_schematic_abc import GenerateSchematicABC
|
||||
|
||||
|
||||
class Startup(GenerateSchematicABC):
|
||||
def __init__(self, *args: str):
|
||||
GenerateSchematicABC.__init__(self, *args)
|
||||
|
||||
def get_code(self) -> str:
|
||||
code = """\
|
||||
from cpl_core.application import StartupABC
|
||||
from cpl_core.configuration import ConfigurationABC
|
||||
from cpl_core.dependency_injection import ServiceProviderABC, ServiceCollectionABC
|
||||
from cpl_core.environment import ApplicationEnvironment
|
||||
|
||||
|
||||
class $Name(StartupABC):
|
||||
|
||||
def __init__(self):
|
||||
StartupABC.__init__(self)
|
||||
|
||||
def configure_configuration(self, configuration: ConfigurationABC, environment: ApplicationEnvironment) -> ConfigurationABC:
|
||||
return configuration
|
||||
|
||||
def configure_services(self, services: ServiceCollectionABC, environment: ApplicationEnvironment) -> ServiceProviderABC:
|
||||
return services.build_service_provider()
|
||||
"""
|
||||
x = self.build_code_str(code, Name=self._class_name)
|
||||
return x
|
||||
|
||||
@classmethod
|
||||
def register(cls):
|
||||
GenerateSchematicABC.register(cls, "startup", ["stup", "STUP"])
|
||||
35
src/cpl_cli/.cpl/schematic_startup_extension.py
Normal file
35
src/cpl_cli/.cpl/schematic_startup_extension.py
Normal file
@@ -0,0 +1,35 @@
|
||||
import textwrap
|
||||
|
||||
from cpl_cli.abc.generate_schematic_abc import GenerateSchematicABC
|
||||
from cpl_core.utils import String
|
||||
|
||||
|
||||
class StartupExtension(GenerateSchematicABC):
|
||||
def __init__(self, *args: str):
|
||||
GenerateSchematicABC.__init__(self, *args)
|
||||
|
||||
def get_code(self) -> str:
|
||||
code = """\
|
||||
from cpl_core.application.startup_extension_abc import StartupExtensionABC
|
||||
from cpl_core.configuration.configuration_abc import ConfigurationABC
|
||||
from cpl_core.dependency_injection.service_collection_abc import ServiceCollectionABC
|
||||
from cpl_core.environment.application_environment_abc import ApplicationEnvironmentABC
|
||||
|
||||
|
||||
class $Name(StartupExtensionABC):
|
||||
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
def configure_configuration(self, config: ConfigurationABC, env: ApplicationEnvironmentABC):
|
||||
pass
|
||||
|
||||
def configure_services(self, services: ServiceCollectionABC, env: ApplicationEnvironmentABC):
|
||||
pass
|
||||
"""
|
||||
x = self.build_code_str(code, Name=String.convert_to_camel_case(self._class_name))
|
||||
return x
|
||||
|
||||
@classmethod
|
||||
def register(cls):
|
||||
GenerateSchematicABC.register(cls, "startup-extension", ["stupex", "STUPEX"])
|
||||
28
src/cpl_cli/.cpl/schematic_test_case.py
Normal file
28
src/cpl_cli/.cpl/schematic_test_case.py
Normal file
@@ -0,0 +1,28 @@
|
||||
import textwrap
|
||||
|
||||
from cpl_cli.abc.generate_schematic_abc import GenerateSchematicABC
|
||||
from cpl_core.utils import String
|
||||
|
||||
|
||||
class TestCase(GenerateSchematicABC):
|
||||
def __init__(self, *args: str):
|
||||
GenerateSchematicABC.__init__(self, *args)
|
||||
|
||||
def get_code(self) -> str:
|
||||
code = """\
|
||||
import unittest
|
||||
|
||||
|
||||
class $Name(unittest.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
def test_equal(self):
|
||||
pass
|
||||
"""
|
||||
return self.build_code_str(code, Name=String.convert_to_camel_case(self._class_name))
|
||||
|
||||
@classmethod
|
||||
def register(cls):
|
||||
GenerateSchematicABC.register(cls, "test-case", ["tc", "TC"])
|
||||
28
src/cpl_cli/.cpl/schematic_thread.py
Normal file
28
src/cpl_cli/.cpl/schematic_thread.py
Normal file
@@ -0,0 +1,28 @@
|
||||
import textwrap
|
||||
|
||||
from cpl_cli.abc.generate_schematic_abc import GenerateSchematicABC
|
||||
|
||||
|
||||
class Thread(GenerateSchematicABC):
|
||||
def __init__(self, *args: str):
|
||||
GenerateSchematicABC.__init__(self, *args)
|
||||
|
||||
def get_code(self) -> str:
|
||||
code = """\
|
||||
import threading
|
||||
|
||||
|
||||
class $Name(threading.Thread):
|
||||
|
||||
def __init__(self):
|
||||
threading.Thread.__init__(self)
|
||||
|
||||
def run(self) -> None:
|
||||
pass
|
||||
"""
|
||||
x = self.build_code_str(code, Name=self._class_name)
|
||||
return x
|
||||
|
||||
@classmethod
|
||||
def register(cls):
|
||||
GenerateSchematicABC.register(cls, "thread", ["t", "T"])
|
||||
28
src/cpl_cli/.cpl/schematic_validator.py
Normal file
28
src/cpl_cli/.cpl/schematic_validator.py
Normal file
@@ -0,0 +1,28 @@
|
||||
import textwrap
|
||||
|
||||
from cpl_cli.abc.generate_schematic_abc import GenerateSchematicABC
|
||||
|
||||
|
||||
class Validator(GenerateSchematicABC):
|
||||
def __init__(self, *args: str):
|
||||
GenerateSchematicABC.__init__(self, *args)
|
||||
|
||||
def get_code(self) -> str:
|
||||
code = """\
|
||||
from cpl_core.configuration.validator_abc import ValidatorABC
|
||||
|
||||
|
||||
class $Name(ValidatorABC):
|
||||
|
||||
def __init__(self):
|
||||
ValidatorABC.__init__(self)
|
||||
|
||||
def validate(self) -> bool:
|
||||
return True
|
||||
"""
|
||||
x = self.build_code_str(code, Name=self._class_name)
|
||||
return x
|
||||
|
||||
@classmethod
|
||||
def register(cls):
|
||||
GenerateSchematicABC.register(cls, "validator", ["v", "V"])
|
||||
31
src/cpl_cli/__init__.py
Normal file
31
src/cpl_cli/__init__.py
Normal file
@@ -0,0 +1,31 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
"""
|
||||
cpl-cli CPL CLI
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
CPL Command Line Interface
|
||||
|
||||
:copyright: (c) 2020 - 2024 sh-edraft.de
|
||||
:license: MIT, see LICENSE for more details.
|
||||
|
||||
"""
|
||||
|
||||
__title__ = "cpl_cli"
|
||||
__author__ = "Sven Heidemann"
|
||||
__license__ = "MIT"
|
||||
__copyright__ = "Copyright (c) 2020 - 2024 sh-edraft.de"
|
||||
__version__ = "2024.10.0"
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
|
||||
# imports:
|
||||
from .cli import CLI
|
||||
from .command_abc import CommandABC
|
||||
from .error import Error
|
||||
from .main import main
|
||||
from .startup import Startup
|
||||
|
||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||
version_info = VersionInfo(major="2024", minor="10", micro="0")
|
||||
26
src/cpl_cli/_templates/__init__.py
Normal file
26
src/cpl_cli/_templates/__init__.py
Normal file
@@ -0,0 +1,26 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
"""
|
||||
cpl-cli CPL CLI
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
CPL Command Line Interface
|
||||
|
||||
:copyright: (c) 2020 - 2024 sh-edraft.de
|
||||
:license: MIT, see LICENSE for more details.
|
||||
|
||||
"""
|
||||
|
||||
__title__ = "cpl_cli._templates"
|
||||
__author__ = "Sven Heidemann"
|
||||
__license__ = "MIT"
|
||||
__copyright__ = "Copyright (c) 2020 - 2024 sh-edraft.de"
|
||||
__version__ = "2024.10.0"
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
|
||||
# imports:
|
||||
|
||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||
version_info = VersionInfo(major="2024", minor="10", micro="0")
|
||||
26
src/cpl_cli/_templates/build/__init__.py
Normal file
26
src/cpl_cli/_templates/build/__init__.py
Normal file
@@ -0,0 +1,26 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
"""
|
||||
cpl-cli CPL CLI
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
CPL Command Line Interface
|
||||
|
||||
:copyright: (c) 2020 - 2024 sh-edraft.de
|
||||
:license: MIT, see LICENSE for more details.
|
||||
|
||||
"""
|
||||
|
||||
__title__ = "cpl_cli._templates.build"
|
||||
__author__ = "Sven Heidemann"
|
||||
__license__ = "MIT"
|
||||
__copyright__ = "Copyright (c) 2020 - 2024 sh-edraft.de"
|
||||
__version__ = "2024.10.0"
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
|
||||
# imports:
|
||||
|
||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||
version_info = VersionInfo(major="2024", minor="10", micro="0")
|
||||
38
src/cpl_cli/_templates/build/init_template.py
Normal file
38
src/cpl_cli/_templates/build/init_template.py
Normal file
@@ -0,0 +1,38 @@
|
||||
import textwrap
|
||||
|
||||
|
||||
class InitTemplate:
|
||||
@staticmethod
|
||||
def get_init_py() -> str:
|
||||
string = textwrap.dedent(
|
||||
"""\
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
\"\"\"
|
||||
$Name $Description
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
$LongDescription
|
||||
|
||||
:copyright: (c) $CopyrightDate $CopyrightName
|
||||
:license: $LicenseDescription
|
||||
|
||||
\"\"\"
|
||||
|
||||
__title__ = "$Title"
|
||||
__author__ = "$Author"
|
||||
__license__ = "$LicenseName"
|
||||
__copyright__ = "Copyright (c) $CopyrightDate $CopyrightName"
|
||||
__version__ = "$Version"
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
|
||||
$Imports
|
||||
|
||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||
version_info = VersionInfo(major="$Major", minor="$Minor", micro="$Micro")
|
||||
"""
|
||||
)
|
||||
|
||||
return string
|
||||
26
src/cpl_cli/_templates/publish/__init__.py
Normal file
26
src/cpl_cli/_templates/publish/__init__.py
Normal file
@@ -0,0 +1,26 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
"""
|
||||
cpl-cli CPL CLI
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
CPL Command Line Interface
|
||||
|
||||
:copyright: (c) 2020 - 2024 sh-edraft.de
|
||||
:license: MIT, see LICENSE for more details.
|
||||
|
||||
"""
|
||||
|
||||
__title__ = "cpl_cli._templates.publish"
|
||||
__author__ = "Sven Heidemann"
|
||||
__license__ = "MIT"
|
||||
__copyright__ = "Copyright (c) 2020 - 2024 sh-edraft.de"
|
||||
__version__ = "2024.10.0"
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
|
||||
# imports:
|
||||
|
||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||
version_info = VersionInfo(major="2024", minor="10", micro="0")
|
||||
33
src/cpl_cli/_templates/publish/setup_template.py
Normal file
33
src/cpl_cli/_templates/publish/setup_template.py
Normal file
@@ -0,0 +1,33 @@
|
||||
import textwrap
|
||||
|
||||
|
||||
class SetupTemplate:
|
||||
@staticmethod
|
||||
def get_setup_py() -> str:
|
||||
string = textwrap.dedent(
|
||||
"""\
|
||||
\"\"\"
|
||||
This file is generated by CPL CLI
|
||||
\"\"\"
|
||||
|
||||
import setuptools
|
||||
|
||||
setuptools.setup(
|
||||
name='$Name',
|
||||
version='$Version',
|
||||
packages=$Packages,
|
||||
url='$URL',
|
||||
license='$LicenseName',
|
||||
author='$Author',
|
||||
author_email='$AuthorMail',
|
||||
include_package_data=$IncludePackageData,
|
||||
description='$Description',
|
||||
python_requires='$PyRequires',
|
||||
install_requires=$Dependencies,
|
||||
entry_points=$EntryPoints,
|
||||
package_data=$PackageData
|
||||
)
|
||||
"""
|
||||
)
|
||||
|
||||
return string
|
||||
22
src/cpl_cli/_templates/template_file_abc.py
Normal file
22
src/cpl_cli/_templates/template_file_abc.py
Normal file
@@ -0,0 +1,22 @@
|
||||
from abc import ABC, abstractmethod
|
||||
|
||||
|
||||
class TemplateFileABC(ABC):
|
||||
@abstractmethod
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
@property
|
||||
@abstractmethod
|
||||
def name(self) -> str:
|
||||
pass
|
||||
|
||||
@property
|
||||
@abstractmethod
|
||||
def path(self) -> str:
|
||||
pass
|
||||
|
||||
@property
|
||||
@abstractmethod
|
||||
def value(self) -> str:
|
||||
pass
|
||||
26
src/cpl_cli/abc/__init__.py
Normal file
26
src/cpl_cli/abc/__init__.py
Normal file
@@ -0,0 +1,26 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
"""
|
||||
cpl-cli CPL CLI
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
CPL Command Line Interface
|
||||
|
||||
:copyright: (c) 2020 - 2024 sh-edraft.de
|
||||
:license: MIT, see LICENSE for more details.
|
||||
|
||||
"""
|
||||
|
||||
__title__ = "cpl_cli.abc"
|
||||
__author__ = "Sven Heidemann"
|
||||
__license__ = "MIT"
|
||||
__copyright__ = "Copyright (c) 2020 - 2024 sh-edraft.de"
|
||||
__version__ = "2024.10.0"
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
|
||||
# imports
|
||||
|
||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||
version_info = VersionInfo(major="2024", minor="10", micro="0")
|
||||
23
src/cpl_cli/abc/code_file_template_abc.py
Normal file
23
src/cpl_cli/abc/code_file_template_abc.py
Normal file
@@ -0,0 +1,23 @@
|
||||
from abc import ABC, abstractmethod
|
||||
|
||||
from cpl_cli.abc.file_template_abc import FileTemplateABC
|
||||
from cpl_core.utils import String
|
||||
|
||||
|
||||
class CodeFileTemplateABC(FileTemplateABC):
|
||||
@abstractmethod
|
||||
def __init__(
|
||||
self,
|
||||
name: str,
|
||||
path: str,
|
||||
code: str,
|
||||
use_application_api: bool,
|
||||
use_startup: bool,
|
||||
use_service_providing: bool,
|
||||
use_async: bool,
|
||||
):
|
||||
FileTemplateABC.__init__(self, name, path, code)
|
||||
self._use_application_api = use_application_api
|
||||
self._use_startup = use_startup
|
||||
self._use_service_providing = use_service_providing
|
||||
self._use_async = use_async
|
||||
34
src/cpl_cli/abc/file_template_abc.py
Normal file
34
src/cpl_cli/abc/file_template_abc.py
Normal file
@@ -0,0 +1,34 @@
|
||||
from abc import ABC, abstractmethod
|
||||
|
||||
from cpl_core.utils import String
|
||||
|
||||
|
||||
class FileTemplateABC(ABC):
|
||||
@abstractmethod
|
||||
def __init__(self, name: str, path: str, code: str):
|
||||
self._name = f"{String.convert_to_snake_case(name)}.py"
|
||||
self._path = path
|
||||
self._code = code
|
||||
|
||||
def __repr__(self):
|
||||
return f"<{type(self).__name__} {self._path}{self._name}>"
|
||||
|
||||
@property
|
||||
def name(self) -> str:
|
||||
return self._name
|
||||
|
||||
@property
|
||||
def path(self) -> str:
|
||||
return self._path
|
||||
|
||||
@path.setter
|
||||
def path(self, value: str):
|
||||
self._path = value
|
||||
|
||||
@property
|
||||
def value(self) -> str:
|
||||
return self.get_code()
|
||||
|
||||
@abstractmethod
|
||||
def get_code(self) -> str:
|
||||
pass
|
||||
40
src/cpl_cli/abc/generate_schematic_abc.py
Normal file
40
src/cpl_cli/abc/generate_schematic_abc.py
Normal file
@@ -0,0 +1,40 @@
|
||||
import textwrap
|
||||
from abc import abstractmethod
|
||||
from string import Template
|
||||
|
||||
from cpl_cli.abc.file_template_abc import FileTemplateABC
|
||||
from cpl_cli.configuration.schematic_collection import SchematicCollection
|
||||
from cpl_core.utils import String
|
||||
|
||||
|
||||
class GenerateSchematicABC(FileTemplateABC):
|
||||
def __init__(self, name: str, schematic: str, path: str):
|
||||
FileTemplateABC.__init__(self, name, path, "")
|
||||
self._name = f"{String.convert_to_snake_case(name)}_{schematic}.py"
|
||||
if schematic in name.lower():
|
||||
self._name = f"{String.convert_to_snake_case(name)}.py"
|
||||
|
||||
self._class_name = name
|
||||
if name != "":
|
||||
self._class_name = f"{String.first_to_upper(name)}{String.first_to_upper(schematic)}"
|
||||
|
||||
if schematic in name.lower():
|
||||
self._class_name = f"{String.first_to_upper(name)}"
|
||||
|
||||
@property
|
||||
def class_name(self) -> str:
|
||||
return self._class_name
|
||||
|
||||
@abstractmethod
|
||||
def get_code(self) -> str:
|
||||
pass
|
||||
|
||||
@classmethod
|
||||
def build_code_str(cls, code: str, **kwargs) -> str:
|
||||
text = textwrap.dedent(code)
|
||||
return Template(text).substitute(**kwargs)
|
||||
|
||||
@classmethod
|
||||
@abstractmethod
|
||||
def register(cls, *args):
|
||||
SchematicCollection.register(*args)
|
||||
36
src/cpl_cli/abc/project_type_abc.py
Normal file
36
src/cpl_cli/abc/project_type_abc.py
Normal file
@@ -0,0 +1,36 @@
|
||||
from abc import ABC, abstractmethod
|
||||
from typing import Optional
|
||||
|
||||
from cpl_cli.abc.file_template_abc import FileTemplateABC
|
||||
from cpl_cli.configuration import WorkspaceSettings
|
||||
|
||||
|
||||
class ProjectTypeABC(ABC):
|
||||
@abstractmethod
|
||||
def __init__(
|
||||
self,
|
||||
base_path: str,
|
||||
project_name: str,
|
||||
workspace: Optional[WorkspaceSettings],
|
||||
use_application_api: bool,
|
||||
use_startup: bool,
|
||||
use_service_providing: bool,
|
||||
use_async: bool,
|
||||
project_file_data: dict,
|
||||
):
|
||||
self._templates: list[FileTemplateABC] = []
|
||||
self._base_path = base_path
|
||||
self._project_name = project_name
|
||||
self._workspace = workspace
|
||||
self._use_application_api = use_application_api
|
||||
self._use_startup = use_startup
|
||||
self._use_service_providing = use_service_providing
|
||||
self._use_async = use_async
|
||||
self._project_file_data = project_file_data
|
||||
|
||||
@property
|
||||
def templates(self) -> list[FileTemplateABC]:
|
||||
return self._templates
|
||||
|
||||
def add_template(self, t: FileTemplateABC):
|
||||
self._templates.append(t)
|
||||
5
src/cpl_cli/appsettings.json
Normal file
5
src/cpl_cli/appsettings.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"CLI": {
|
||||
"PipPath": "https://pip.sh-edraft.de"
|
||||
}
|
||||
}
|
||||
46
src/cpl_cli/cli.py
Normal file
46
src/cpl_cli/cli.py
Normal file
@@ -0,0 +1,46 @@
|
||||
import sys
|
||||
import traceback
|
||||
|
||||
from cpl_cli.error import Error
|
||||
from cpl_core.application.application_abc import ApplicationABC
|
||||
from cpl_core.configuration.configuration_abc import ConfigurationABC
|
||||
from cpl_core.console.console import Console
|
||||
from cpl_core.dependency_injection.service_provider_abc import ServiceProviderABC
|
||||
|
||||
|
||||
class CLI(ApplicationABC):
|
||||
def __init__(self, config: ConfigurationABC, services: ServiceProviderABC):
|
||||
"""
|
||||
CPL CLI
|
||||
"""
|
||||
ApplicationABC.__init__(self, config, services)
|
||||
|
||||
self._options: list[str] = []
|
||||
|
||||
def configure(self):
|
||||
pass
|
||||
|
||||
def main(self):
|
||||
"""
|
||||
Entry point of the CPL CLI
|
||||
:return:
|
||||
"""
|
||||
try:
|
||||
result = self._configuration.parse_console_arguments(self._services)
|
||||
if result:
|
||||
Console.write_line()
|
||||
return
|
||||
|
||||
if len(self._configuration.additional_arguments) == 0:
|
||||
Error.error("Expected command")
|
||||
return
|
||||
|
||||
unexpected_arguments = ", ".join(self._configuration.additional_arguments)
|
||||
Error.error(f"Unexpected argument(s): {unexpected_arguments}")
|
||||
Console.write_line()
|
||||
except KeyboardInterrupt:
|
||||
Console.write_line()
|
||||
sys.exit()
|
||||
except Exception as e:
|
||||
Console.error(str(e), traceback.format_exc())
|
||||
sys.exit()
|
||||
14
src/cpl_cli/cli_settings.py
Normal file
14
src/cpl_cli/cli_settings.py
Normal file
@@ -0,0 +1,14 @@
|
||||
from typing import Optional
|
||||
|
||||
from cpl_core.configuration.configuration_model_abc import ConfigurationModelABC
|
||||
|
||||
|
||||
class CLISettings(ConfigurationModelABC):
|
||||
def __init__(self, pip_path: str = None):
|
||||
ConfigurationModelABC.__init__(self)
|
||||
|
||||
self._pip_path: Optional[str] = pip_path
|
||||
|
||||
@property
|
||||
def pip_path(self) -> str:
|
||||
return self._pip_path
|
||||
5
src/cpl_cli/cli_settings_name_enum.py
Normal file
5
src/cpl_cli/cli_settings_name_enum.py
Normal file
@@ -0,0 +1,5 @@
|
||||
from enum import Enum
|
||||
|
||||
|
||||
class CLISettingsNameEnum(Enum):
|
||||
pip_path = "PipPath"
|
||||
32
src/cpl_cli/command/__init__.py
Normal file
32
src/cpl_cli/command/__init__.py
Normal file
@@ -0,0 +1,32 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
"""
|
||||
cpl-cli CPL CLI
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
CPL Command Line Interface
|
||||
|
||||
:copyright: (c) 2020 - 2024 sh-edraft.de
|
||||
:license: MIT, see LICENSE for more details.
|
||||
|
||||
"""
|
||||
|
||||
__title__ = "cpl_cli.command"
|
||||
__author__ = "Sven Heidemann"
|
||||
__license__ = "MIT"
|
||||
__copyright__ = "Copyright (c) 2020 - 2024 sh-edraft.de"
|
||||
__version__ = "2024.10.0"
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
|
||||
# imports:
|
||||
from .build_service import BuildService
|
||||
from .generate_service import GenerateService
|
||||
from .help_service import HelpService
|
||||
from .new_service import NewService
|
||||
from .publish_service import PublishService
|
||||
from .version_service import VersionService
|
||||
|
||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||
version_info = VersionInfo(major="2024", minor="10", micro="0")
|
||||
138
src/cpl_cli/command/add_service.py
Normal file
138
src/cpl_cli/command/add_service.py
Normal file
@@ -0,0 +1,138 @@
|
||||
import json
|
||||
import os
|
||||
import textwrap
|
||||
from typing import Optional
|
||||
|
||||
from cpl_cli.command_abc import CommandABC
|
||||
from cpl_cli.configuration.build_settings import BuildSettings
|
||||
from cpl_cli.configuration.project_settings import ProjectSettings
|
||||
from cpl_cli.configuration.settings_helper import SettingsHelper
|
||||
from cpl_cli.configuration.workspace_settings import WorkspaceSettings
|
||||
from cpl_core.configuration.configuration_abc import ConfigurationABC
|
||||
from cpl_core.console.console import Console
|
||||
from cpl_core.console.foreground_color_enum import ForegroundColorEnum
|
||||
|
||||
|
||||
class AddService(CommandABC):
|
||||
def __init__(self, config: ConfigurationABC, workspace: WorkspaceSettings):
|
||||
"""
|
||||
Service for CLI command add
|
||||
"""
|
||||
CommandABC.__init__(self)
|
||||
|
||||
self._config = config
|
||||
self._workspace = workspace
|
||||
self._is_simulation = False
|
||||
|
||||
@property
|
||||
def help_message(self) -> str:
|
||||
return textwrap.dedent(
|
||||
"""\
|
||||
Adds a project reference to given project.
|
||||
Usage: cpl add <source-project> <target-project>
|
||||
|
||||
Arguments:
|
||||
source-project: Name of the project to which the reference has to be
|
||||
target-project: Name of the project to be referenced
|
||||
"""
|
||||
)
|
||||
|
||||
def _edit_project_file(self, source: str, project_settings: ProjectSettings, build_settings: BuildSettings):
|
||||
if self._is_simulation:
|
||||
return
|
||||
with open(source, "w") as file:
|
||||
file.write(
|
||||
json.dumps(
|
||||
{
|
||||
ProjectSettings.__name__: SettingsHelper.get_project_settings_dict(project_settings),
|
||||
BuildSettings.__name__: SettingsHelper.get_build_settings_dict(build_settings),
|
||||
},
|
||||
indent=2,
|
||||
)
|
||||
)
|
||||
file.close()
|
||||
|
||||
def execute(self, args: list[str]):
|
||||
"""
|
||||
Entry point of command
|
||||
:param args:
|
||||
:return:
|
||||
"""
|
||||
if "simulate" in args:
|
||||
args.remove("simulate")
|
||||
Console.write_line("Running in simulation mode:")
|
||||
self._is_simulation = True
|
||||
|
||||
if len(args) == 0:
|
||||
Console.error("Expected source and target project")
|
||||
return
|
||||
|
||||
elif len(args) == 1:
|
||||
Console.error("Expected target project")
|
||||
return
|
||||
|
||||
elif len(args) > 2:
|
||||
Console.error(f'Unexpected argument(s): {", ".join(args[2:])}')
|
||||
return
|
||||
|
||||
# file names
|
||||
source = args[0]
|
||||
target = args[1]
|
||||
# validation flags
|
||||
is_invalid_source = False
|
||||
is_invalid_target = source == target
|
||||
|
||||
if not is_invalid_target:
|
||||
if self._workspace is None:
|
||||
is_invalid_source = not os.path.isfile(source)
|
||||
is_invalid_target = not os.path.isfile(target)
|
||||
|
||||
else:
|
||||
if source not in self._workspace.projects:
|
||||
is_invalid_source = True
|
||||
|
||||
else:
|
||||
source = self._workspace.projects[source]
|
||||
|
||||
if target not in self._workspace.projects:
|
||||
is_invalid_target = True
|
||||
|
||||
else:
|
||||
target = self._workspace.projects[target]
|
||||
|
||||
# load project-name.json
|
||||
self._config.add_json_file(source, optional=True, output=False)
|
||||
project_settings: Optional[ProjectSettings] = self._config.get_configuration(ProjectSettings)
|
||||
build_settings: Optional[BuildSettings] = self._config.get_configuration(BuildSettings)
|
||||
|
||||
if project_settings is None or build_settings is None:
|
||||
is_invalid_source = True
|
||||
|
||||
if is_invalid_source:
|
||||
Console.error(f"Invalid source: {source}")
|
||||
return
|
||||
|
||||
if is_invalid_target or source == target or not os.path.isfile(target):
|
||||
Console.error(f"Invalid target: {target}")
|
||||
return
|
||||
|
||||
if self._workspace is None:
|
||||
target = f"../{target}"
|
||||
else:
|
||||
target = target.replace("src", "..")
|
||||
|
||||
if target in build_settings.project_references:
|
||||
Console.error(f"Project reference already exists.")
|
||||
return
|
||||
|
||||
build_settings.project_references.append(target)
|
||||
|
||||
Console.spinner(
|
||||
f"Editing {source}",
|
||||
self._edit_project_file,
|
||||
source,
|
||||
project_settings,
|
||||
build_settings,
|
||||
text_foreground_color=ForegroundColorEnum.green,
|
||||
spinner_foreground_color=ForegroundColorEnum.cyan,
|
||||
)
|
||||
32
src/cpl_cli/command/build_service.py
Normal file
32
src/cpl_cli/command/build_service.py
Normal file
@@ -0,0 +1,32 @@
|
||||
import textwrap
|
||||
|
||||
from cpl_cli.command_abc import CommandABC
|
||||
from cpl_cli.publish.publisher_abc import PublisherABC
|
||||
|
||||
|
||||
class BuildService(CommandABC):
|
||||
def __init__(self, publisher: PublisherABC):
|
||||
"""
|
||||
Service for the CLI command build
|
||||
:param publisher:
|
||||
"""
|
||||
CommandABC.__init__(self)
|
||||
|
||||
self._publisher = publisher
|
||||
|
||||
@property
|
||||
def help_message(self) -> str:
|
||||
return textwrap.dedent(
|
||||
"""\
|
||||
Copies an python app into an output directory named build/ at the given output path. Must be executed within a CPL workspace or project directory
|
||||
Usage: cpl build
|
||||
"""
|
||||
)
|
||||
|
||||
def execute(self, args: list[str]):
|
||||
"""
|
||||
Entry point of command
|
||||
:param args:
|
||||
:return:
|
||||
"""
|
||||
self._publisher.build()
|
||||
49
src/cpl_cli/command/custom_script_service.py
Normal file
49
src/cpl_cli/command/custom_script_service.py
Normal file
@@ -0,0 +1,49 @@
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
from cpl_core.environment import ApplicationEnvironmentABC
|
||||
|
||||
from cpl_core.configuration.configuration_abc import ConfigurationABC
|
||||
from cpl_core.console.console import Console
|
||||
from cpl_cli.command_abc import CommandABC
|
||||
from cpl_cli.configuration.workspace_settings import WorkspaceSettings
|
||||
|
||||
|
||||
class CustomScriptService(CommandABC):
|
||||
def __init__(self, config: ConfigurationABC, env: ApplicationEnvironmentABC, ws: WorkspaceSettings):
|
||||
"""
|
||||
Service for CLI scripts
|
||||
"""
|
||||
CommandABC.__init__(self)
|
||||
|
||||
self._config = config
|
||||
self._env = env
|
||||
self._workspace = ws
|
||||
|
||||
@property
|
||||
def help_message(self) -> str:
|
||||
return ""
|
||||
|
||||
def execute(self, args: list[str]):
|
||||
cmd = self._config.get_configuration("ACTIVE_EXECUTABLE")
|
||||
wd = self._config.get_configuration("PATH_WORKSPACE")
|
||||
if wd is not None:
|
||||
self._env.set_working_directory(wd)
|
||||
|
||||
for script in self._workspace.scripts:
|
||||
if script != cmd:
|
||||
continue
|
||||
|
||||
command = ""
|
||||
external_args = self._config.get_configuration("ARGS")
|
||||
if external_args is not None:
|
||||
command += f'ARGS="{external_args}";'
|
||||
|
||||
command += self._workspace.scripts[script]
|
||||
env_vars = os.environ
|
||||
env_vars["CPL_ARGS"] = " ".join(args)
|
||||
|
||||
try:
|
||||
subprocess.run(command, shell=True if os.name == "posix" else None)
|
||||
except Exception as e:
|
||||
Console.error(str(e))
|
||||
223
src/cpl_cli/command/generate_service.py
Normal file
223
src/cpl_cli/command/generate_service.py
Normal file
@@ -0,0 +1,223 @@
|
||||
import importlib
|
||||
import os
|
||||
import sys
|
||||
import textwrap
|
||||
import traceback
|
||||
|
||||
from cpl_cli.abc.generate_schematic_abc import GenerateSchematicABC
|
||||
from cpl_cli.command_abc import CommandABC
|
||||
from cpl_cli.configuration import WorkspaceSettings
|
||||
from cpl_cli.configuration.schematic_collection import SchematicCollection
|
||||
from cpl_cli.helper.dependencies import Dependencies
|
||||
from cpl_core.configuration.configuration_abc import ConfigurationABC
|
||||
from cpl_core.console.console import Console
|
||||
from cpl_core.console.foreground_color_enum import ForegroundColorEnum
|
||||
from cpl_core.utils.string import String
|
||||
|
||||
|
||||
class GenerateService(CommandABC):
|
||||
def __init__(
|
||||
self,
|
||||
configuration: ConfigurationABC,
|
||||
workspace: WorkspaceSettings,
|
||||
):
|
||||
"""
|
||||
Service for the CLI command generate
|
||||
:param configuration:
|
||||
"""
|
||||
CommandABC.__init__(self)
|
||||
|
||||
self._config = configuration
|
||||
self._workspace = workspace
|
||||
|
||||
self._config = configuration
|
||||
self._env = self._config.environment
|
||||
self._schematics = {}
|
||||
self._schematic_classes = set()
|
||||
|
||||
for package_name, version in Dependencies.get_cpl_packages():
|
||||
if package_name == "cpl-cli":
|
||||
continue
|
||||
package = importlib.import_module(String.convert_to_snake_case(package_name))
|
||||
self._read_custom_schematics_from_path(os.path.dirname(package.__file__))
|
||||
|
||||
self._read_custom_schematics_from_path(self._env.working_directory)
|
||||
self._read_custom_schematics_from_path(self._env.runtime_directory)
|
||||
|
||||
if len(self._schematic_classes) == 0:
|
||||
Console.error(f"No schematics found in template directory: .cpl")
|
||||
sys.exit()
|
||||
|
||||
known_schematics = []
|
||||
for schematic in self._schematic_classes:
|
||||
known_schematics.append(schematic.__name__)
|
||||
schematic.register()
|
||||
|
||||
self._schematics = SchematicCollection.get_schematics()
|
||||
|
||||
@property
|
||||
def help_message(self) -> str:
|
||||
schematics = []
|
||||
for schematic in self._schematics:
|
||||
aliases = "|".join(self._schematics[schematic]["Aliases"])
|
||||
schematic_str = schematic
|
||||
if len(aliases) > 0:
|
||||
schematic_str = f"{schematic} ({aliases})"
|
||||
|
||||
schematics.append(schematic_str)
|
||||
help_msg = textwrap.dedent(
|
||||
"""\
|
||||
Generate a file based on schematic.
|
||||
Usage: cpl generate <schematic> <name>
|
||||
|
||||
Arguments:
|
||||
schematic: The schematic to generate.
|
||||
name: The name of the generated file
|
||||
|
||||
Schematics:"""
|
||||
)
|
||||
|
||||
for schematic in schematics:
|
||||
help_msg += f"\n {schematic}"
|
||||
return help_msg
|
||||
|
||||
def _read_custom_schematics_from_path(self, path: str):
|
||||
if not os.path.exists(os.path.join(path, ".cpl")):
|
||||
return
|
||||
|
||||
sys.path.insert(0, os.path.join(path, ".cpl"))
|
||||
for r, d, f in os.walk(os.path.join(path, ".cpl")):
|
||||
for file in f:
|
||||
if not file.startswith("schematic_") or not file.endswith(".py"):
|
||||
continue
|
||||
|
||||
try:
|
||||
exec(open(os.path.join(r, file), "r").read())
|
||||
self._schematic_classes.update(GenerateSchematicABC.__subclasses__())
|
||||
except Exception as e:
|
||||
Console.error(str(e), traceback.format_exc())
|
||||
sys.exit(-1)
|
||||
|
||||
@staticmethod
|
||||
def _create_file(file_path: str, value: str):
|
||||
"""
|
||||
Creates the given file with content
|
||||
:param file_path:
|
||||
:param value:
|
||||
:return:
|
||||
"""
|
||||
with open(file_path, "w") as template:
|
||||
template.write(value)
|
||||
template.close()
|
||||
|
||||
def _create_init_files(
|
||||
self, file_path: str, template: GenerateSchematicABC, class_name: str, schematic: str, rel_path: str
|
||||
):
|
||||
if not os.path.isdir(os.path.dirname(file_path)):
|
||||
os.makedirs(os.path.dirname(file_path))
|
||||
directory = ""
|
||||
for subdir in template.path.split("/"):
|
||||
directory = os.path.join(directory, subdir)
|
||||
if subdir == "src":
|
||||
continue
|
||||
|
||||
file = self._schematics["init"]["Template"](class_name, "init", rel_path)
|
||||
if os.path.exists(os.path.join(os.path.abspath(directory), file.name)):
|
||||
continue
|
||||
|
||||
Console.spinner(
|
||||
f"Creating {os.path.abspath(directory)}/{file.name}",
|
||||
self._create_file,
|
||||
os.path.join(os.path.abspath(directory), file.name),
|
||||
file.get_code(),
|
||||
text_foreground_color=ForegroundColorEnum.green,
|
||||
spinner_foreground_color=ForegroundColorEnum.cyan,
|
||||
)
|
||||
|
||||
def _generate(self, schematic: str, name: str, template: type):
|
||||
"""
|
||||
Generates files by given schematic, name and template
|
||||
:param schematic:
|
||||
:param name:
|
||||
:param template:
|
||||
:return:
|
||||
"""
|
||||
class_name = name
|
||||
rel_path = ""
|
||||
if "/" in name:
|
||||
parts = name.split("/")
|
||||
rel_path = "/".join(parts[:-1])
|
||||
class_name = parts[len(parts) - 1]
|
||||
|
||||
if self._workspace is not None and parts[0] in self._workspace.projects:
|
||||
rel_path = os.path.join(os.path.dirname(self._workspace.projects[parts[0]]), *parts[1:-1])
|
||||
|
||||
template = template(class_name, String.convert_to_snake_case(schematic), rel_path)
|
||||
|
||||
file_path = os.path.join(self._env.working_directory, template.path, template.name)
|
||||
self._create_init_files(file_path, template, class_name, schematic, rel_path)
|
||||
|
||||
if os.path.isfile(file_path):
|
||||
Console.error(f"{String.first_to_upper(schematic)} already exists!\n")
|
||||
sys.exit()
|
||||
|
||||
message = f"Creating {self._env.working_directory}/{template.path}/{template.name}"
|
||||
if template.path == "":
|
||||
message = f"Creating {self._env.working_directory}/{template.name}"
|
||||
|
||||
Console.spinner(
|
||||
message,
|
||||
self._create_file,
|
||||
file_path,
|
||||
template.get_code(),
|
||||
text_foreground_color=ForegroundColorEnum.green,
|
||||
spinner_foreground_color=ForegroundColorEnum.cyan,
|
||||
)
|
||||
|
||||
def _get_schematic_by_alias(self, schematic: str) -> str:
|
||||
for key in self._schematics:
|
||||
if schematic in self._schematics[key]["Aliases"]:
|
||||
return key
|
||||
|
||||
return schematic
|
||||
|
||||
def execute(self, args: list[str]):
|
||||
"""
|
||||
Entry point of command
|
||||
:param args:
|
||||
:return:
|
||||
"""
|
||||
schematic = None
|
||||
value = None
|
||||
for s in self._schematics:
|
||||
value = self._config.get_configuration(s)
|
||||
if value is not None:
|
||||
schematic = s
|
||||
break
|
||||
|
||||
if (
|
||||
schematic is None
|
||||
and len(args) >= 1
|
||||
and (args[0] in self._schematics or self._get_schematic_by_alias(args[0]) != args[0])
|
||||
):
|
||||
schematic = self._get_schematic_by_alias(args[0])
|
||||
self._config.add_configuration(schematic, args[1])
|
||||
value = args[1]
|
||||
|
||||
if schematic is None:
|
||||
Console.error(f"Schematic not found")
|
||||
Console.write_line(self.help_message)
|
||||
sys.exit()
|
||||
|
||||
name = value
|
||||
if name is None:
|
||||
name = Console.read(f"Name for the {args[0]}: ")
|
||||
|
||||
if schematic in self._schematics:
|
||||
s = self._schematics[schematic]
|
||||
self._generate(schematic, name, s["Template"])
|
||||
|
||||
else:
|
||||
self._help("Usage: cpl generate <schematic> [options]")
|
||||
Console.write_line()
|
||||
sys.exit()
|
||||
67
src/cpl_cli/command/help_service.py
Normal file
67
src/cpl_cli/command/help_service.py
Normal file
@@ -0,0 +1,67 @@
|
||||
import sys
|
||||
import textwrap
|
||||
|
||||
from cpl_core.console.console import Console
|
||||
from cpl_core.console.foreground_color_enum import ForegroundColorEnum
|
||||
from cpl_core.dependency_injection.service_provider_abc import ServiceProviderABC
|
||||
from cpl_cli.command_abc import CommandABC
|
||||
|
||||
|
||||
class HelpService(CommandABC):
|
||||
def __init__(self, services: ServiceProviderABC):
|
||||
"""
|
||||
Service for CLI command help
|
||||
"""
|
||||
CommandABC.__init__(self)
|
||||
|
||||
self._services = services
|
||||
|
||||
@property
|
||||
def help_message(self) -> str:
|
||||
return textwrap.dedent(
|
||||
"""\
|
||||
Lists available command and their short descriptions.
|
||||
Usage: cpl help
|
||||
"""
|
||||
)
|
||||
|
||||
def execute(self, args: list[str]):
|
||||
"""
|
||||
Entry point of command
|
||||
:param args:
|
||||
:return:
|
||||
"""
|
||||
if len(args) > 0:
|
||||
Console.error(f'Unexpected argument(s): {", ".join(args)}')
|
||||
sys.exit()
|
||||
|
||||
Console.write_line("Available Commands:")
|
||||
commands = [
|
||||
["add (a|a)", "Adds a project reference to given project."],
|
||||
[
|
||||
"build (b|B)",
|
||||
"Prepares files for publish into an output directory named dist/ at the given output path. Must be executed from within a workspace directory.",
|
||||
],
|
||||
["generate (g|G)", "Generate a new file."],
|
||||
["help (h|H)", "Lists available command and their short descriptions."],
|
||||
[
|
||||
"install (i|I)",
|
||||
"With argument installs packages to project, without argument installs project dependencies.",
|
||||
],
|
||||
["new (n|N)", "Creates new CPL project."],
|
||||
[
|
||||
"publish (p|P)",
|
||||
"Prepares files for publish into an output directory named dist/ at the given output path and executes setup.py. Must be executed from within a library workspace directory.",
|
||||
],
|
||||
["remove (r|R)", "Removes a project from workspace."],
|
||||
["start (s|S)", "Starts CPL project, restarting on file changes."],
|
||||
["uninstall (ui|UI)", "Uninstalls packages from project."],
|
||||
["update (u|u)", "Update CPL and project dependencies."],
|
||||
["version (v|V)", "Outputs CPL CLI version."],
|
||||
]
|
||||
for name, description in commands:
|
||||
Console.set_foreground_color(ForegroundColorEnum.blue)
|
||||
Console.write(f"\n\t{name} ")
|
||||
Console.set_foreground_color(ForegroundColorEnum.default)
|
||||
Console.write(f"{description}")
|
||||
Console.write_line("\nRun 'cpl <command> --help' for command specific information's\n")
|
||||
281
src/cpl_cli/command/install_service.py
Normal file
281
src/cpl_cli/command/install_service.py
Normal file
@@ -0,0 +1,281 @@
|
||||
import json
|
||||
import os
|
||||
import subprocess
|
||||
import textwrap
|
||||
import time
|
||||
|
||||
from packaging import version
|
||||
|
||||
from cpl_cli.cli_settings import CLISettings
|
||||
from cpl_cli.command_abc import CommandABC
|
||||
from cpl_cli.configuration.build_settings import BuildSettings
|
||||
from cpl_cli.configuration.project_settings import ProjectSettings
|
||||
from cpl_cli.configuration.settings_helper import SettingsHelper
|
||||
from cpl_cli.configuration.venv_helper_service import VenvHelper
|
||||
from cpl_cli.error import Error
|
||||
from cpl_core.configuration.configuration_abc import ConfigurationABC
|
||||
from cpl_core.console.console import Console
|
||||
from cpl_core.console.foreground_color_enum import ForegroundColorEnum
|
||||
from cpl_core.environment.application_environment_abc import ApplicationEnvironmentABC
|
||||
from cpl_core.utils.pip import Pip
|
||||
|
||||
|
||||
class InstallService(CommandABC):
|
||||
def __init__(
|
||||
self,
|
||||
config: ConfigurationABC,
|
||||
env: ApplicationEnvironmentABC,
|
||||
build_settings: BuildSettings,
|
||||
project_settings: ProjectSettings,
|
||||
cli_settings: CLISettings,
|
||||
):
|
||||
"""
|
||||
Service for the CLI command install
|
||||
:param config:
|
||||
:param env:
|
||||
:param build_settings:
|
||||
:param project_settings:
|
||||
:param cli_settings:
|
||||
"""
|
||||
CommandABC.__init__(self)
|
||||
|
||||
self._config = config
|
||||
self._env = env
|
||||
self._build_settings = build_settings
|
||||
self._project_settings = project_settings
|
||||
self._cli_settings = cli_settings
|
||||
|
||||
self._is_simulation = False
|
||||
self._is_virtual = False
|
||||
self._is_dev = False
|
||||
|
||||
self._project_file = f"{self._project_settings.name}.json"
|
||||
|
||||
@property
|
||||
def help_message(self) -> str:
|
||||
return textwrap.dedent(
|
||||
"""\
|
||||
Installs given package via pip
|
||||
Usage: cpl install <package>
|
||||
|
||||
Arguments:
|
||||
package The package to install
|
||||
"""
|
||||
)
|
||||
|
||||
def _wait(self, t: int, *args, source: str = None, stdout=None, stderr=None):
|
||||
time.sleep(t)
|
||||
|
||||
def _install_project(self):
|
||||
"""
|
||||
Installs dependencies of CPl project
|
||||
:return:
|
||||
"""
|
||||
if self._project_settings is None or self._build_settings is None:
|
||||
Error.error("The command requires to be run in an CPL project, but a project could not be found.")
|
||||
return
|
||||
|
||||
if self._project_settings.dependencies is None:
|
||||
Error.error(f"Found invalid dependencies in {self._project_file}.")
|
||||
return
|
||||
|
||||
for dependency in self._project_settings.dependencies:
|
||||
Console.spinner(
|
||||
f"Installing: {dependency}",
|
||||
Pip.install if not self._is_virtual else self._wait,
|
||||
dependency if not self._is_virtual else 2,
|
||||
"--upgrade",
|
||||
source=self._cli_settings.pip_path,
|
||||
stdout=subprocess.DEVNULL,
|
||||
stderr=subprocess.DEVNULL,
|
||||
text_foreground_color=ForegroundColorEnum.green,
|
||||
spinner_foreground_color=ForegroundColorEnum.cyan,
|
||||
)
|
||||
local_package = Pip.get_package(dependency)
|
||||
if local_package is None:
|
||||
Error.warn(f"Installation of package {dependency} failed!")
|
||||
return
|
||||
|
||||
for dependency in self._project_settings.dev_dependencies:
|
||||
Console.spinner(
|
||||
f"Installing dev: {dependency}",
|
||||
Pip.install if not self._is_virtual else self._wait,
|
||||
dependency if not self._is_virtual else 2,
|
||||
"--upgrade",
|
||||
source=self._cli_settings.pip_path,
|
||||
stdout=subprocess.DEVNULL,
|
||||
stderr=subprocess.DEVNULL,
|
||||
text_foreground_color=ForegroundColorEnum.green,
|
||||
spinner_foreground_color=ForegroundColorEnum.cyan,
|
||||
)
|
||||
local_package = Pip.get_package(dependency)
|
||||
if local_package is None:
|
||||
Error.warn(f"Installation of package {dependency} failed!")
|
||||
return
|
||||
|
||||
if not self._is_virtual:
|
||||
Pip.reset_executable()
|
||||
|
||||
def _install_package(self, package: str):
|
||||
"""
|
||||
Installs given package
|
||||
:param package:
|
||||
:return:
|
||||
"""
|
||||
is_already_in_project = False
|
||||
if self._project_settings is None or self._build_settings is None:
|
||||
Error.error("The command requires to be run in an CPL project, but a project could not be found.")
|
||||
return
|
||||
|
||||
if self._project_settings.dependencies is None:
|
||||
Error.error(f"Found invalid dependencies in {self._project_file}.")
|
||||
return
|
||||
|
||||
package_version = ""
|
||||
name = package
|
||||
if "==" in package:
|
||||
name = package.split("==")[0]
|
||||
package_version = package.split("==")[1]
|
||||
elif ">=" in package:
|
||||
name = package.split(">=")[0]
|
||||
package_version = package.split(">=")[1]
|
||||
elif "<=" in package:
|
||||
name = package.split("<=")[0]
|
||||
package_version = package.split("<=")[1]
|
||||
|
||||
to_remove_list = []
|
||||
deps = self._project_settings.dependencies
|
||||
if self._is_dev:
|
||||
deps = self._project_settings.dev_dependencies
|
||||
|
||||
for dependency in deps:
|
||||
dependency_version = ""
|
||||
|
||||
if "==" in dependency:
|
||||
dependency_version = dependency.split("==")[1]
|
||||
elif "<=" in dependency:
|
||||
dependency_version = dependency.split("<=")[1]
|
||||
elif ">=" in dependency:
|
||||
dependency_version = dependency.split(">=")[1]
|
||||
|
||||
if name in dependency:
|
||||
if package_version != "" and version.parse(package_version) != version.parse(dependency_version):
|
||||
to_remove_list.append(dependency)
|
||||
break
|
||||
else:
|
||||
is_already_in_project = True
|
||||
|
||||
for to_remove in to_remove_list:
|
||||
if self._is_dev:
|
||||
self._project_settings.dev_dependencies.remove(to_remove)
|
||||
else:
|
||||
self._project_settings.dependencies.remove(to_remove)
|
||||
|
||||
local_package = Pip.get_package(package)
|
||||
if local_package is not None and local_package in self._project_settings.dependencies:
|
||||
Error.warn(f"Package {local_package} is already installed.")
|
||||
return
|
||||
|
||||
elif is_already_in_project:
|
||||
Error.warn(f"Package {package} is already installed.")
|
||||
return
|
||||
|
||||
Console.spinner(
|
||||
f"Installing: {package}" if not self._is_dev else f"Installing dev: {package}",
|
||||
Pip.install if not self._is_virtual else self._wait,
|
||||
package if not self._is_virtual else 2,
|
||||
source=self._cli_settings.pip_path,
|
||||
stdout=subprocess.DEVNULL,
|
||||
stderr=subprocess.DEVNULL,
|
||||
text_foreground_color=ForegroundColorEnum.green,
|
||||
spinner_foreground_color=ForegroundColorEnum.cyan,
|
||||
)
|
||||
|
||||
if self._is_virtual:
|
||||
new_package = name
|
||||
else:
|
||||
new_package = Pip.get_package(name)
|
||||
|
||||
if (
|
||||
new_package is None
|
||||
or "==" in package
|
||||
and version.parse(package.split("==")[1]) != version.parse(new_package.split("==")[1])
|
||||
or "<=" in package
|
||||
and version.parse(package.split("<=")[1]) != version.parse(new_package.split("<=")[1])
|
||||
or ">=" in package
|
||||
and version.parse(package.split(">=")[1]) != version.parse(new_package.split(">=")[1])
|
||||
):
|
||||
Console.error(f"Installation of package {package} failed")
|
||||
return
|
||||
|
||||
if not is_already_in_project:
|
||||
new_name = package
|
||||
if "==" in new_package or ">=" in new_package or "<=" in new_package:
|
||||
new_name = new_package
|
||||
elif "==" in name or ">=" in name or "<=" in name:
|
||||
new_name = name
|
||||
|
||||
if "/" in new_name:
|
||||
new_name = new_name.split("/")[0]
|
||||
|
||||
if "\r" in new_name:
|
||||
new_name = new_name.replace("\r", "")
|
||||
|
||||
if self._is_dev:
|
||||
self._project_settings.dev_dependencies.append(new_name)
|
||||
else:
|
||||
self._project_settings.dependencies.append(new_name)
|
||||
|
||||
if not self._is_simulation:
|
||||
config = {
|
||||
ProjectSettings.__name__: SettingsHelper.get_project_settings_dict(self._project_settings),
|
||||
BuildSettings.__name__: SettingsHelper.get_build_settings_dict(self._build_settings),
|
||||
}
|
||||
|
||||
with open(os.path.join(self._env.working_directory, self._project_file), "w") as project_file:
|
||||
project_file.write(json.dumps(config, indent=2))
|
||||
project_file.close()
|
||||
|
||||
Pip.reset_executable()
|
||||
|
||||
def execute(self, args: list[str]):
|
||||
"""
|
||||
Entry point of command
|
||||
:param args:
|
||||
:return:
|
||||
"""
|
||||
if "dev" in args:
|
||||
self._is_dev = True
|
||||
args.remove("dev")
|
||||
|
||||
if "virtual" in args:
|
||||
self._is_virtual = True
|
||||
args.remove("virtual")
|
||||
Console.write_line("Running in virtual mode:")
|
||||
|
||||
if "simulate" in args:
|
||||
self._is_simulation = True
|
||||
args.remove("simulate")
|
||||
Console.write_line("Running in simulation mode:")
|
||||
|
||||
if "cpl-prod" in args:
|
||||
args.remove("cpl-prod")
|
||||
self._cli_settings.from_dict({"PipPath": "https://pip.sh-edraft.de"})
|
||||
|
||||
if "cpl-exp" in args:
|
||||
args.remove("cpl-exp")
|
||||
self._cli_settings.from_dict({"PipPath": "https://pip-exp.sh-edraft.de"})
|
||||
|
||||
if "cpl-dev" in args:
|
||||
args.remove("cpl-dev")
|
||||
self._cli_settings.from_dict({"PipPath": "https://pip-dev.sh-edraft.de"})
|
||||
|
||||
VenvHelper.init_venv(self._is_virtual, self._env, self._project_settings.python_executable)
|
||||
|
||||
if len(args) == 0:
|
||||
self._install_project()
|
||||
else:
|
||||
self._install_package(args[0])
|
||||
|
||||
if not self._is_virtual:
|
||||
Pip.reset_executable()
|
||||
362
src/cpl_cli/command/new_service.py
Normal file
362
src/cpl_cli/command/new_service.py
Normal file
@@ -0,0 +1,362 @@
|
||||
import importlib
|
||||
import os
|
||||
import sys
|
||||
import textwrap
|
||||
import traceback
|
||||
from typing import Optional
|
||||
|
||||
from packaging import version
|
||||
|
||||
import cpl_cli
|
||||
import cpl_core
|
||||
from cpl_cli.abc.project_type_abc import ProjectTypeABC
|
||||
from cpl_cli.command_abc import CommandABC
|
||||
from cpl_cli.configuration import VersionSettings
|
||||
from cpl_cli.configuration.build_settings import BuildSettings
|
||||
from cpl_cli.configuration.project_settings import ProjectSettings
|
||||
from cpl_cli.configuration.project_type_enum import ProjectTypeEnum
|
||||
from cpl_cli.configuration.settings_helper import SettingsHelper
|
||||
from cpl_cli.configuration.venv_helper_service import VenvHelper
|
||||
from cpl_cli.configuration.workspace_settings import WorkspaceSettings
|
||||
from cpl_cli.helper.dependencies import Dependencies
|
||||
from cpl_cli.source_creator.template_builder import TemplateBuilder
|
||||
from cpl_core.configuration.configuration_abc import ConfigurationABC
|
||||
from cpl_core.console.console import Console
|
||||
from cpl_core.console.foreground_color_enum import ForegroundColorEnum
|
||||
from cpl_core.utils.string import String
|
||||
|
||||
|
||||
class NewService(CommandABC):
|
||||
def __init__(self, configuration: ConfigurationABC):
|
||||
"""
|
||||
Service for the CLI command new
|
||||
:param configuration:
|
||||
"""
|
||||
CommandABC.__init__(self)
|
||||
|
||||
self._config = configuration
|
||||
self._env = self._config.environment
|
||||
|
||||
self._workspace: WorkspaceSettings = self._config.get_configuration(WorkspaceSettings)
|
||||
self._project_dict = {}
|
||||
self._build_dict = {}
|
||||
self._project_name = ""
|
||||
self._python_executable = ""
|
||||
|
||||
self._project_type_classes = set()
|
||||
|
||||
self._name: str = ""
|
||||
self._rel_path: str = ""
|
||||
self._project_type: ProjectTypeEnum = ProjectTypeEnum.console
|
||||
self._use_nothing: bool = False
|
||||
self._use_application_api: bool = False
|
||||
self._use_startup: bool = False
|
||||
self._use_service_providing: bool = False
|
||||
self._use_async: bool = False
|
||||
self._use_venv: bool = False
|
||||
self._use_base: bool = False
|
||||
|
||||
@property
|
||||
def help_message(self) -> str:
|
||||
return textwrap.dedent(
|
||||
"""\
|
||||
Generates a workspace and initial project or add a project to workspace.
|
||||
Usage: cpl new <type> <name>
|
||||
|
||||
Arguments:
|
||||
type The project type of the initial project
|
||||
name Name of the workspace or the project
|
||||
|
||||
Types:
|
||||
console (c|C)
|
||||
library (l|L)
|
||||
unittest (ut|UT)
|
||||
"""
|
||||
)
|
||||
|
||||
def _create_project_settings(self):
|
||||
self._project_name = os.path.basename(self._name)
|
||||
self._python_executable = ProjectSettings(
|
||||
python_path={sys.platform: "../../venv/" if self._use_venv else ""}
|
||||
).python_executable
|
||||
self._rel_path = os.path.dirname(self._name)
|
||||
self._project_dict = SettingsHelper.get_project_settings_dict(
|
||||
ProjectSettings(
|
||||
os.path.basename(self._name),
|
||||
VersionSettings("0", "0", "0"),
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
[f"cpl-core>={version.parse(cpl_core.__version__)}"],
|
||||
[f"cpl-cli>={version.parse(cpl_cli.__version__)}"],
|
||||
f'>={sys.version.split(" ")[0]}',
|
||||
{sys.platform: "../../venv/" if self._use_venv else ""},
|
||||
None,
|
||||
[],
|
||||
)
|
||||
)
|
||||
|
||||
def _create_build_settings(self, project_type: str):
|
||||
self._build_dict = SettingsHelper.get_build_settings_dict(
|
||||
BuildSettings(
|
||||
ProjectTypeEnum[project_type],
|
||||
"",
|
||||
"../../dist",
|
||||
f"{String.convert_to_snake_case(self._project_name)}.main",
|
||||
self._project_name,
|
||||
False,
|
||||
[],
|
||||
["*/__pycache__", "*/logs", "*/tests"],
|
||||
{},
|
||||
[],
|
||||
)
|
||||
)
|
||||
|
||||
def _create_project_json(self):
|
||||
"""
|
||||
Creates cpl.json content
|
||||
:return:
|
||||
"""
|
||||
self._project_json = {ProjectSettings.__name__: self._project_dict, BuildSettings.__name__: self._build_dict}
|
||||
|
||||
def _get_project_path(self) -> Optional[str]:
|
||||
"""
|
||||
Gets project path
|
||||
:return:
|
||||
"""
|
||||
if self._workspace is None:
|
||||
project_path = os.path.join(self._env.working_directory, self._rel_path, self._project_name)
|
||||
else:
|
||||
base = "" if self._use_base else "src"
|
||||
project_path = os.path.join(
|
||||
self._env.working_directory, base, self._rel_path, String.convert_to_snake_case(self._project_name)
|
||||
)
|
||||
|
||||
if os.path.isdir(project_path) and len(os.listdir(project_path)) > 0:
|
||||
Console.write_line(project_path)
|
||||
Console.error("Project path is not empty\n")
|
||||
return None
|
||||
|
||||
return project_path
|
||||
|
||||
def _get_project_information(self, project_type: str):
|
||||
"""
|
||||
Gets project information's from user
|
||||
:return:
|
||||
"""
|
||||
is_unittest = project_type == "unittest"
|
||||
is_library = project_type == "library"
|
||||
if is_library:
|
||||
return
|
||||
|
||||
if (
|
||||
self._use_application_api
|
||||
or self._use_startup
|
||||
or self._use_service_providing
|
||||
or self._use_async
|
||||
or self._use_nothing
|
||||
):
|
||||
Console.set_foreground_color(ForegroundColorEnum.default)
|
||||
Console.write_line("Skipping question due to given flags")
|
||||
return
|
||||
|
||||
if not is_unittest and not is_library:
|
||||
self._use_application_api = Console.read("Do you want to use application base? (y/n) ").lower() == "y"
|
||||
|
||||
if not is_unittest and self._use_application_api:
|
||||
self._use_startup = Console.read("Do you want to use startup? (y/n) ").lower() == "y"
|
||||
|
||||
if not is_unittest and not self._use_application_api:
|
||||
self._use_service_providing = Console.read("Do you want to use service providing? (y/n) ").lower() == "y"
|
||||
|
||||
if not self._use_async:
|
||||
self._use_async = Console.read("Do you want to use async? (y/n) ").lower() == "y"
|
||||
|
||||
Console.set_foreground_color(ForegroundColorEnum.default)
|
||||
|
||||
def _create_venv(self):
|
||||
project = self._project_name
|
||||
if self._workspace is not None:
|
||||
project = self._workspace.default_project
|
||||
|
||||
if self._env.working_directory.endswith(project):
|
||||
project = ""
|
||||
|
||||
if self._workspace is None and self._use_base:
|
||||
project = f"{self._rel_path}/{project}"
|
||||
|
||||
VenvHelper.init_venv(
|
||||
False,
|
||||
self._env,
|
||||
self._python_executable,
|
||||
explicit_path=os.path.join(
|
||||
self._env.working_directory, project, self._python_executable.replace("../", "")
|
||||
),
|
||||
)
|
||||
|
||||
def _read_custom_project_types_from_path(self, path: str):
|
||||
if not os.path.exists(os.path.join(path, ".cpl")):
|
||||
return
|
||||
|
||||
sys.path.insert(0, os.path.join(path, ".cpl"))
|
||||
for r, d, f in os.walk(os.path.join(path, ".cpl")):
|
||||
for file in f:
|
||||
if file.startswith("project_file_") or not file.startswith("project_") or not file.endswith(".py"):
|
||||
continue
|
||||
|
||||
try:
|
||||
exec(open(os.path.join(r, file), "r").read())
|
||||
self._project_type_classes.update(ProjectTypeABC.__subclasses__())
|
||||
except Exception as e:
|
||||
Console.error(str(e), traceback.format_exc())
|
||||
sys.exit(-1)
|
||||
|
||||
def _create_project(self, project_type: str):
|
||||
for package_name in Dependencies.get_cpl_packages():
|
||||
if package_name == "cpl-cli":
|
||||
continue
|
||||
package = importlib.import_module(String.convert_to_snake_case(package_name[0]))
|
||||
self._read_custom_project_types_from_path(os.path.dirname(package.__file__))
|
||||
|
||||
self._read_custom_project_types_from_path(self._env.working_directory)
|
||||
self._read_custom_project_types_from_path(self._env.runtime_directory)
|
||||
|
||||
if len(self._project_type_classes) == 0:
|
||||
Console.error(f"No project types found in template directory: .cpl")
|
||||
sys.exit()
|
||||
|
||||
project_class = None
|
||||
known_project_types = []
|
||||
for p in self._project_type_classes:
|
||||
known_project_types.append(p.__name__)
|
||||
if p.__name__.lower() != project_type and p.__name__.lower()[0] != project_type[0]:
|
||||
continue
|
||||
|
||||
project_class = p
|
||||
|
||||
if project_class is None:
|
||||
Console.error(f"Project type {project_type} not found in template directory: .cpl/")
|
||||
sys.exit()
|
||||
|
||||
project_type = String.convert_to_snake_case(project_class.__name__)
|
||||
self._create_project_settings()
|
||||
self._create_build_settings(project_type)
|
||||
self._create_project_json()
|
||||
path = self._get_project_path()
|
||||
if path is None:
|
||||
return
|
||||
|
||||
self._get_project_information(project_type)
|
||||
project_name = self._project_name
|
||||
if self._rel_path != "":
|
||||
project_name = f"{self._rel_path}/{project_name}"
|
||||
|
||||
base = "src/"
|
||||
split_project_name = project_name.split("/")
|
||||
if self._use_base and len(split_project_name) > 0:
|
||||
base = f"{split_project_name[0]}/"
|
||||
|
||||
project = project_class(
|
||||
base if self._workspace is not None else "src/",
|
||||
project_name,
|
||||
self._workspace,
|
||||
self._use_application_api,
|
||||
self._use_startup,
|
||||
self._use_service_providing,
|
||||
self._use_async,
|
||||
self._project_json,
|
||||
)
|
||||
|
||||
if self._workspace is None:
|
||||
TemplateBuilder.create_workspace(
|
||||
f"{project_name}/cpl-workspace.json",
|
||||
project_name.split("/")[-1],
|
||||
{
|
||||
project_name: f'{base if self._workspace is not None else "src/"}{String.convert_to_snake_case(project_name)}/{project_name}.json'
|
||||
},
|
||||
{},
|
||||
)
|
||||
else:
|
||||
self._workspace.projects[
|
||||
project_name
|
||||
] = f'{base if self._workspace is not None else "src/"}{String.convert_to_snake_case(project_name)}/{project_name}.json'
|
||||
TemplateBuilder.create_workspace(
|
||||
"cpl-workspace.json", self._workspace.default_project, self._workspace.projects, self._workspace.scripts
|
||||
)
|
||||
|
||||
for template in project.templates:
|
||||
rel_base = "/".join(project_name.split("/")[:-1])
|
||||
template_path_base = template.path.split("/")[0]
|
||||
if not self._use_base and rel_base != "" and template_path_base != "" and template_path_base != rel_base:
|
||||
template.path = template.path.replace(f"{template_path_base}/", f"{template_path_base}/{rel_base}/")
|
||||
|
||||
if template.name.endswith(f'{project_name.split("/")[-1]}.json'):
|
||||
pass
|
||||
|
||||
file_path = os.path.join(project_name if self._workspace is None else "", template.path, template.name)
|
||||
|
||||
Console.spinner(
|
||||
f"Creating {file_path}",
|
||||
TemplateBuilder.build,
|
||||
file_path,
|
||||
template,
|
||||
text_foreground_color=ForegroundColorEnum.green,
|
||||
spinner_foreground_color=ForegroundColorEnum.cyan,
|
||||
)
|
||||
|
||||
if self._use_venv:
|
||||
self._create_venv()
|
||||
|
||||
def execute(self, args: list[str]):
|
||||
"""
|
||||
Entry point of command
|
||||
:param args:
|
||||
:return:
|
||||
"""
|
||||
if "nothing" in args:
|
||||
self._use_nothing = True
|
||||
self._use_async = False
|
||||
self._use_application_api = False
|
||||
self._use_startup = False
|
||||
self._use_service_providing = False
|
||||
if "async" in args:
|
||||
args.remove("async")
|
||||
if "application-base" in args:
|
||||
args.remove("application-base")
|
||||
if "startup" in args:
|
||||
args.remove("startup")
|
||||
if "service-providing" in args:
|
||||
args.remove("service-providing")
|
||||
|
||||
if "async" in args:
|
||||
self._use_async = True
|
||||
args.remove("async")
|
||||
if "application-base" in args:
|
||||
self._use_application_api = True
|
||||
args.remove("application-base")
|
||||
if "startup" in args:
|
||||
self._use_startup = True
|
||||
args.remove("startup")
|
||||
if "service-providing" in args:
|
||||
self._use_service_providing = True
|
||||
args.remove("service-providing")
|
||||
if "venv" in args:
|
||||
self._use_venv = True
|
||||
args.remove("venv")
|
||||
if "base" in args:
|
||||
self._use_base = True
|
||||
args.remove("base")
|
||||
|
||||
if len(args) <= 1:
|
||||
Console.error(f"Project type not found")
|
||||
Console.write_line(self.help_message)
|
||||
return
|
||||
|
||||
self._name = args[1]
|
||||
self._create_project(args[0])
|
||||
32
src/cpl_cli/command/publish_service.py
Normal file
32
src/cpl_cli/command/publish_service.py
Normal file
@@ -0,0 +1,32 @@
|
||||
import textwrap
|
||||
|
||||
from cpl_cli.command_abc import CommandABC
|
||||
from cpl_cli.publish.publisher_abc import PublisherABC
|
||||
|
||||
|
||||
class PublishService(CommandABC):
|
||||
def __init__(self, publisher: PublisherABC):
|
||||
"""
|
||||
Service for the CLI command publish
|
||||
:param publisher:
|
||||
"""
|
||||
CommandABC.__init__(self)
|
||||
|
||||
self._publisher = publisher
|
||||
|
||||
@property
|
||||
def help_message(self) -> str:
|
||||
return textwrap.dedent(
|
||||
"""\
|
||||
Prepares files for publish into an output directory named dist/ at the given output path and executes setup.py.
|
||||
Usage: cpl publish
|
||||
"""
|
||||
)
|
||||
|
||||
def execute(self, args: list[str]):
|
||||
"""
|
||||
Entry point of command
|
||||
:param args:
|
||||
:return:
|
||||
"""
|
||||
self._publisher.publish()
|
||||
172
src/cpl_cli/command/remove_service.py
Normal file
172
src/cpl_cli/command/remove_service.py
Normal file
@@ -0,0 +1,172 @@
|
||||
import os
|
||||
import shutil
|
||||
import json
|
||||
import textwrap
|
||||
|
||||
from cpl_cli.configuration.settings_helper import SettingsHelper
|
||||
|
||||
from cpl_core.configuration.configuration_abc import ConfigurationABC
|
||||
from cpl_core.console.console import Console
|
||||
from cpl_core.console.foreground_color_enum import ForegroundColorEnum
|
||||
from cpl_core.environment.application_environment_abc import ApplicationEnvironmentABC
|
||||
from cpl_cli.command_abc import CommandABC
|
||||
from cpl_cli.configuration import (
|
||||
WorkspaceSettings,
|
||||
WorkspaceSettingsNameEnum,
|
||||
BuildSettingsNameEnum,
|
||||
ProjectSettings,
|
||||
BuildSettings,
|
||||
)
|
||||
|
||||
|
||||
class RemoveService(CommandABC):
|
||||
def __init__(self, config: ConfigurationABC, env: ApplicationEnvironmentABC):
|
||||
"""
|
||||
Service for CLI command remove
|
||||
:param config:
|
||||
:param env:
|
||||
"""
|
||||
CommandABC.__init__(self)
|
||||
|
||||
self._config = config
|
||||
self._env = env
|
||||
|
||||
self._workspace: WorkspaceSettings = self._config.get_configuration(WorkspaceSettings)
|
||||
self._is_simulation = False
|
||||
|
||||
@property
|
||||
def help_message(self) -> str:
|
||||
return textwrap.dedent(
|
||||
"""\
|
||||
Removes a project from workspace.
|
||||
Usage: cpl remove <project>
|
||||
|
||||
Arguments:
|
||||
project The name of the project to delete
|
||||
"""
|
||||
)
|
||||
|
||||
def _create_file(self, file_name: str, content: dict):
|
||||
if self._is_simulation:
|
||||
return
|
||||
|
||||
if not os.path.isabs(file_name):
|
||||
file_name = os.path.abspath(file_name)
|
||||
|
||||
path = os.path.dirname(file_name)
|
||||
if not os.path.isdir(path):
|
||||
os.makedirs(path)
|
||||
|
||||
with open(file_name, "w") as project_json:
|
||||
project_json.write(json.dumps(content, indent=2))
|
||||
project_json.close()
|
||||
|
||||
def _remove_sources(self, path: str):
|
||||
if self._is_simulation:
|
||||
return
|
||||
shutil.rmtree(path)
|
||||
|
||||
def _create_workspace(self, path: str):
|
||||
ws_dict = {
|
||||
WorkspaceSettings.__name__: {
|
||||
WorkspaceSettingsNameEnum.default_project.value: self._workspace.default_project,
|
||||
WorkspaceSettingsNameEnum.projects.value: self._workspace.projects,
|
||||
WorkspaceSettingsNameEnum.scripts.value: self._workspace.scripts,
|
||||
}
|
||||
}
|
||||
|
||||
self._create_file(path, ws_dict)
|
||||
|
||||
def _get_project_settings(self, project: str) -> dict:
|
||||
with open(os.path.join(os.getcwd(), self._workspace.projects[project]), "r", encoding="utf-8") as cfg:
|
||||
# load json
|
||||
project_json = json.load(cfg)
|
||||
cfg.close()
|
||||
|
||||
return project_json
|
||||
|
||||
def _write_project_settings(self, project: str, project_settings: dict, build_settings: dict):
|
||||
with open(os.path.join(os.getcwd(), self._workspace.projects[project]), "w", encoding="utf-8") as file:
|
||||
file.write(
|
||||
json.dumps(
|
||||
{ProjectSettings.__name__: project_settings, BuildSettings.__name__: build_settings}, indent=2
|
||||
)
|
||||
)
|
||||
file.close()
|
||||
|
||||
def _find_deps_in_projects(self, project_name: str, rel_path: str):
|
||||
for project in self._workspace.projects:
|
||||
if project == project_name:
|
||||
continue
|
||||
|
||||
project_settings = self._get_project_settings(project)
|
||||
if (
|
||||
BuildSettings.__name__ not in project_settings
|
||||
or BuildSettingsNameEnum.project_references.value not in project_settings[BuildSettings.__name__]
|
||||
):
|
||||
continue
|
||||
|
||||
ref_to_delete = ""
|
||||
for ref in project_settings[BuildSettings.__name__][BuildSettingsNameEnum.project_references.value]:
|
||||
if os.path.basename(ref) == f"{project_name}.json":
|
||||
ref_to_delete = ref
|
||||
|
||||
if (
|
||||
ref_to_delete
|
||||
not in project_settings[BuildSettings.__name__][BuildSettingsNameEnum.project_references.value]
|
||||
):
|
||||
continue
|
||||
|
||||
project_settings[BuildSettings.__name__][BuildSettingsNameEnum.project_references.value].remove(
|
||||
ref_to_delete
|
||||
)
|
||||
Console.spinner(
|
||||
f"Removing {project_name} from {project}",
|
||||
self._write_project_settings,
|
||||
project,
|
||||
project_settings[ProjectSettings.__name__],
|
||||
project_settings[BuildSettings.__name__],
|
||||
text_foreground_color=ForegroundColorEnum.green,
|
||||
spinner_foreground_color=ForegroundColorEnum.cyan,
|
||||
)
|
||||
|
||||
def execute(self, args: list[str]):
|
||||
"""
|
||||
Entry point of command
|
||||
:param args:
|
||||
:return:
|
||||
"""
|
||||
if "simulate" in args:
|
||||
args.remove("simulate")
|
||||
Console.write_line("Running in simulation mode:")
|
||||
self._is_simulation = True
|
||||
|
||||
project_name = args[0]
|
||||
if project_name not in self._workspace.projects:
|
||||
Console.error(f"Project {project_name} not found in workspace.")
|
||||
return
|
||||
|
||||
if project_name == self._workspace.default_project:
|
||||
Console.error(f"Project {project_name} is the default project.")
|
||||
return
|
||||
|
||||
src_path = os.path.dirname(self._workspace.projects[project_name])
|
||||
Console.spinner(
|
||||
f"Removing {src_path}",
|
||||
self._remove_sources,
|
||||
os.path.abspath(src_path),
|
||||
text_foreground_color=ForegroundColorEnum.green,
|
||||
spinner_foreground_color=ForegroundColorEnum.cyan,
|
||||
)
|
||||
|
||||
self._find_deps_in_projects(project_name, src_path)
|
||||
|
||||
del self._workspace.projects[project_name]
|
||||
path = "cpl-workspace.json"
|
||||
Console.spinner(
|
||||
f"Changing {path}",
|
||||
self._create_workspace,
|
||||
path,
|
||||
text_foreground_color=ForegroundColorEnum.green,
|
||||
spinner_foreground_color=ForegroundColorEnum.cyan,
|
||||
)
|
||||
125
src/cpl_cli/command/run_service.py
Normal file
125
src/cpl_cli/command/run_service.py
Normal file
@@ -0,0 +1,125 @@
|
||||
import os
|
||||
import sys
|
||||
import textwrap
|
||||
|
||||
from cpl_cli.error import Error
|
||||
from cpl_cli.command_abc import CommandABC
|
||||
from cpl_cli.configuration.workspace_settings import WorkspaceSettings
|
||||
from cpl_cli.configuration.build_settings import BuildSettings
|
||||
from cpl_cli.configuration.project_settings import ProjectSettings
|
||||
from cpl_cli.live_server.start_executable import StartExecutable
|
||||
from cpl_cli.publish.publisher_service import PublisherService
|
||||
from cpl_core.configuration.configuration_abc import ConfigurationABC
|
||||
from cpl_core.console.console import Console
|
||||
from cpl_core.dependency_injection.service_provider_abc import ServiceProviderABC
|
||||
from cpl_core.environment.application_environment_abc import ApplicationEnvironmentABC
|
||||
from cpl_core.utils.string import String
|
||||
|
||||
|
||||
class RunService(CommandABC):
|
||||
def __init__(
|
||||
self,
|
||||
config: ConfigurationABC,
|
||||
env: ApplicationEnvironmentABC,
|
||||
services: ServiceProviderABC,
|
||||
project_settings: ProjectSettings,
|
||||
build_settings: BuildSettings,
|
||||
workspace: WorkspaceSettings,
|
||||
publisher: PublisherService,
|
||||
):
|
||||
"""
|
||||
Service for the CLI command start
|
||||
:param config:
|
||||
:param env:
|
||||
:param services:
|
||||
:param project_settings:
|
||||
:param build_settings:
|
||||
:param workspace:
|
||||
"""
|
||||
CommandABC.__init__(self)
|
||||
|
||||
self._config = config
|
||||
self._env = env
|
||||
self._services = services
|
||||
self._project_settings = project_settings
|
||||
self._build_settings = build_settings
|
||||
self._workspace = workspace
|
||||
self._publisher = publisher
|
||||
|
||||
self._src_dir = os.path.join(self._env.working_directory, self._build_settings.source_path)
|
||||
self._is_dev = False
|
||||
|
||||
@property
|
||||
def help_message(self) -> str:
|
||||
return textwrap.dedent(
|
||||
"""\
|
||||
Starts your application.
|
||||
Usage: cpl run
|
||||
"""
|
||||
)
|
||||
|
||||
def _set_project_by_args(self, name: str):
|
||||
if self._workspace is None:
|
||||
Error.error("The command requires to be run in an CPL workspace, but a workspace could not be found.")
|
||||
sys.exit()
|
||||
|
||||
if name not in self._workspace.projects:
|
||||
Error.error(f"Project {name} not found in workspace")
|
||||
sys.exit()
|
||||
|
||||
project_path = self._workspace.projects[name]
|
||||
|
||||
self._config.add_configuration(ProjectSettings, None)
|
||||
self._config.add_configuration(BuildSettings, None)
|
||||
|
||||
working_directory = self._config.get_configuration("PATH_WORKSPACE")
|
||||
if working_directory is not None:
|
||||
self._env.set_working_directory(working_directory)
|
||||
|
||||
json_file = os.path.join(self._env.working_directory, project_path)
|
||||
self._config.add_json_file(json_file, optional=True, output=False)
|
||||
self._project_settings: ProjectSettings = self._config.get_configuration(ProjectSettings)
|
||||
self._build_settings: BuildSettings = self._config.get_configuration(BuildSettings)
|
||||
|
||||
if self._project_settings is None or self._build_settings is None:
|
||||
Error.error(f"Project {name} not found")
|
||||
sys.exit()
|
||||
|
||||
self._src_dir = os.path.dirname(json_file)
|
||||
|
||||
def _build(self):
|
||||
if self._is_dev:
|
||||
return
|
||||
|
||||
self._env.set_working_directory(self._src_dir)
|
||||
self._publisher.build()
|
||||
self._env.set_working_directory(self._src_dir)
|
||||
self._src_dir = os.path.abspath(
|
||||
os.path.join(
|
||||
self._src_dir,
|
||||
self._build_settings.output_path,
|
||||
self._project_settings.name,
|
||||
"build",
|
||||
String.convert_to_snake_case(self._project_settings.name),
|
||||
)
|
||||
)
|
||||
|
||||
def execute(self, args: list[str]):
|
||||
"""
|
||||
Entry point of command
|
||||
:param args:
|
||||
:return:
|
||||
"""
|
||||
if "dev" in args:
|
||||
self._is_dev = True
|
||||
args.remove("dev")
|
||||
|
||||
if len(args) >= 1:
|
||||
self._set_project_by_args(args[0])
|
||||
args.remove(args[0])
|
||||
|
||||
self._build()
|
||||
|
||||
start_service = StartExecutable(self._env, self._build_settings)
|
||||
start_service.run(args, self._project_settings.python_executable, self._src_dir, output=False)
|
||||
Console.write_line()
|
||||
32
src/cpl_cli/command/start_service.py
Normal file
32
src/cpl_cli/command/start_service.py
Normal file
@@ -0,0 +1,32 @@
|
||||
import textwrap
|
||||
|
||||
from cpl_cli.command_abc import CommandABC
|
||||
from cpl_cli.live_server.live_server_service import LiveServerService
|
||||
|
||||
|
||||
class StartService(CommandABC):
|
||||
def __init__(self, live_server: LiveServerService):
|
||||
"""
|
||||
Service for the CLI command start
|
||||
:param live_server:
|
||||
"""
|
||||
CommandABC.__init__(self)
|
||||
|
||||
self._live_server = live_server
|
||||
|
||||
@property
|
||||
def help_message(self) -> str:
|
||||
return textwrap.dedent(
|
||||
"""\
|
||||
Starts your application, restarting on file changes.
|
||||
Usage: cpl start
|
||||
"""
|
||||
)
|
||||
|
||||
def execute(self, args: list[str]):
|
||||
"""
|
||||
Entry point of command
|
||||
:param args:
|
||||
:return:
|
||||
"""
|
||||
self._live_server.start(args)
|
||||
140
src/cpl_cli/command/uninstall_service.py
Normal file
140
src/cpl_cli/command/uninstall_service.py
Normal file
@@ -0,0 +1,140 @@
|
||||
import json
|
||||
import os
|
||||
import subprocess
|
||||
import textwrap
|
||||
import time
|
||||
|
||||
from cpl_cli.configuration.venv_helper_service import VenvHelper
|
||||
from cpl_core.configuration.configuration_abc import ConfigurationABC
|
||||
from cpl_core.console.console import Console
|
||||
from cpl_core.console.foreground_color_enum import ForegroundColorEnum
|
||||
from cpl_core.environment.application_environment_abc import ApplicationEnvironmentABC
|
||||
from cpl_core.utils.pip import Pip
|
||||
from cpl_cli.command_abc import CommandABC
|
||||
from cpl_cli.configuration.build_settings import BuildSettings
|
||||
from cpl_cli.configuration.project_settings import ProjectSettings
|
||||
from cpl_cli.configuration.settings_helper import SettingsHelper
|
||||
|
||||
|
||||
class UninstallService(CommandABC):
|
||||
def __init__(
|
||||
self,
|
||||
config: ConfigurationABC,
|
||||
env: ApplicationEnvironmentABC,
|
||||
build_settings: BuildSettings,
|
||||
project_settings: ProjectSettings,
|
||||
):
|
||||
"""
|
||||
Service for the CLI command uninstall
|
||||
:param config:
|
||||
:param env:
|
||||
:param build_settings:
|
||||
:param project_settings:
|
||||
"""
|
||||
CommandABC.__init__(self)
|
||||
|
||||
self._config = config
|
||||
self._env = env
|
||||
self._build_settings = build_settings
|
||||
self._project_settings = project_settings
|
||||
|
||||
self._is_simulating = False
|
||||
self._is_virtual = False
|
||||
self._is_dev = False
|
||||
|
||||
self._project_file = f"{self._project_settings.name}.json"
|
||||
|
||||
@property
|
||||
def help_message(self) -> str:
|
||||
return textwrap.dedent(
|
||||
"""\
|
||||
Uninstalls given package via pip
|
||||
Usage: cpl uninstall <package>
|
||||
|
||||
Arguments:
|
||||
package The package to uninstall
|
||||
"""
|
||||
)
|
||||
|
||||
def _wait(self, t: int, *args, source: str = None, stdout=None, stderr=None):
|
||||
time.sleep(t)
|
||||
|
||||
def execute(self, args: list[str]):
|
||||
"""
|
||||
Entry point of command
|
||||
:param args:
|
||||
:return:
|
||||
"""
|
||||
if len(args) == 0:
|
||||
Console.error(f"Expected package")
|
||||
Console.error(f"Usage: cpl uninstall <package>")
|
||||
return
|
||||
|
||||
if "dev" in args:
|
||||
self._is_dev = True
|
||||
args.remove("dev")
|
||||
|
||||
if "--virtual" in args:
|
||||
self._is_virtual = True
|
||||
args.remove("--virtual")
|
||||
Console.write_line("Running in virtual mode:")
|
||||
|
||||
if "--simulate" in args:
|
||||
self._is_virtual = True
|
||||
args.remove("--simulate")
|
||||
Console.write_line("Running in simulation mode:")
|
||||
|
||||
VenvHelper.init_venv(self._is_virtual, self._env, self._project_settings.python_executable)
|
||||
|
||||
package = args[0]
|
||||
is_in_dependencies = False
|
||||
|
||||
if not self._is_virtual:
|
||||
pip_package = Pip.get_package(package)
|
||||
else:
|
||||
pip_package = package
|
||||
|
||||
deps = self._project_settings.dependencies
|
||||
if self._is_dev:
|
||||
deps = self._project_settings.dev_dependencies
|
||||
|
||||
for dependency in deps:
|
||||
if package in dependency:
|
||||
is_in_dependencies = True
|
||||
package = dependency
|
||||
|
||||
if not is_in_dependencies and pip_package is None:
|
||||
Console.error(f"Package {package} not found")
|
||||
return
|
||||
|
||||
elif not is_in_dependencies and pip_package is not None:
|
||||
package = pip_package
|
||||
|
||||
Console.spinner(
|
||||
f"Uninstalling: {package}" if not self._is_dev else f"Uninstalling dev: {package}",
|
||||
Pip.uninstall if not self._is_virtual else self._wait,
|
||||
package if not self._is_virtual else 2,
|
||||
stdout=subprocess.DEVNULL,
|
||||
stderr=subprocess.DEVNULL,
|
||||
text_foreground_color=ForegroundColorEnum.green,
|
||||
spinner_foreground_color=ForegroundColorEnum.cyan,
|
||||
)
|
||||
|
||||
deps = self._project_settings.dependencies
|
||||
if self._is_dev:
|
||||
deps = self._project_settings.dev_dependencies
|
||||
|
||||
if package in deps:
|
||||
deps.remove(package)
|
||||
if not self._is_simulating:
|
||||
config = {
|
||||
ProjectSettings.__name__: SettingsHelper.get_project_settings_dict(self._project_settings),
|
||||
BuildSettings.__name__: SettingsHelper.get_build_settings_dict(self._build_settings),
|
||||
}
|
||||
with open(os.path.join(self._env.working_directory, self._project_file), "w") as project_file:
|
||||
project_file.write(json.dumps(config, indent=2))
|
||||
project_file.close()
|
||||
|
||||
Console.write_line(f"Removed {package}")
|
||||
if not self._is_virtual:
|
||||
Pip.reset_executable()
|
||||
228
src/cpl_cli/command/update_service.py
Normal file
228
src/cpl_cli/command/update_service.py
Normal file
@@ -0,0 +1,228 @@
|
||||
import json
|
||||
import os
|
||||
import subprocess
|
||||
import textwrap
|
||||
|
||||
from cpl_cli.configuration.venv_helper_service import VenvHelper
|
||||
from cpl_cli.migrations.base.migration_service_abc import MigrationServiceABC
|
||||
from cpl_core.configuration.configuration_abc import ConfigurationABC
|
||||
from cpl_core.console.console import Console
|
||||
from cpl_core.console.foreground_color_enum import ForegroundColorEnum
|
||||
from cpl_core.environment.application_environment_abc import ApplicationEnvironmentABC
|
||||
from cpl_core.utils.pip import Pip
|
||||
from cpl_cli.cli_settings import CLISettings
|
||||
from cpl_cli.command_abc import CommandABC
|
||||
from cpl_cli.configuration import BuildSettings
|
||||
from cpl_cli.configuration.project_settings import ProjectSettings
|
||||
from cpl_cli.configuration.settings_helper import SettingsHelper
|
||||
|
||||
|
||||
class UpdateService(CommandABC):
|
||||
def __init__(
|
||||
self,
|
||||
config: ConfigurationABC,
|
||||
env: ApplicationEnvironmentABC,
|
||||
build_settings: BuildSettings,
|
||||
project_settings: ProjectSettings,
|
||||
cli_settings: CLISettings,
|
||||
migrations: MigrationServiceABC,
|
||||
):
|
||||
"""
|
||||
Service for the CLI command update
|
||||
:param config:
|
||||
:param env:
|
||||
:param build_settings:
|
||||
:param project_settings:
|
||||
:param cli_settings:
|
||||
"""
|
||||
CommandABC.__init__(self)
|
||||
|
||||
self._config = config
|
||||
self._env = env
|
||||
self._build_settings = build_settings
|
||||
self._project_settings = project_settings
|
||||
self._cli_settings = cli_settings
|
||||
self._migrations = migrations
|
||||
self._is_simulation = False
|
||||
|
||||
self._project_file = f"{self._project_settings.name}.json"
|
||||
|
||||
@property
|
||||
def help_message(self) -> str:
|
||||
return textwrap.dedent(
|
||||
"""\
|
||||
Updates the CPL and project dependencies.
|
||||
Usage: cpl update
|
||||
"""
|
||||
)
|
||||
|
||||
def _collect_project_dependencies(self) -> list[tuple]:
|
||||
"""
|
||||
Collects project dependencies
|
||||
:return:
|
||||
"""
|
||||
dependencies = []
|
||||
for package in [*self._project_settings.dependencies, *self._project_settings.dev_dependencies]:
|
||||
name = package
|
||||
if "==" in package:
|
||||
name = package.split("==")[0]
|
||||
elif ">=" in package:
|
||||
name = package.split(">=")[0]
|
||||
elif "<=" in package:
|
||||
name = package.split("<=")[0]
|
||||
|
||||
dependencies.append((package, name))
|
||||
|
||||
return dependencies
|
||||
|
||||
def _update_project_dependencies(self, dependencies):
|
||||
"""
|
||||
Updates project dependencies
|
||||
:return:
|
||||
"""
|
||||
for package, name in dependencies:
|
||||
Pip.install(
|
||||
name,
|
||||
"--upgrade",
|
||||
"--upgrade-strategy",
|
||||
"eager",
|
||||
source=self._cli_settings.pip_path,
|
||||
stdout=subprocess.DEVNULL,
|
||||
stderr=subprocess.DEVNULL,
|
||||
)
|
||||
|
||||
new_package = Pip.get_package(name)
|
||||
if new_package is None:
|
||||
Console.error(f"Update for package {package} failed")
|
||||
continue
|
||||
|
||||
self._project_json_update_dependency(package, new_package)
|
||||
|
||||
def _check_project_dependencies(self):
|
||||
"""
|
||||
Checks project dependencies for updates
|
||||
:return:
|
||||
"""
|
||||
dependencies = Console.spinner(
|
||||
"Collecting installed dependencies",
|
||||
self._collect_project_dependencies,
|
||||
text_foreground_color=ForegroundColorEnum.green,
|
||||
spinner_foreground_color=ForegroundColorEnum.cyan,
|
||||
)
|
||||
|
||||
Console.spinner(
|
||||
"Updating installed dependencies",
|
||||
self._update_project_dependencies,
|
||||
dependencies,
|
||||
text_foreground_color=ForegroundColorEnum.green,
|
||||
spinner_foreground_color=ForegroundColorEnum.cyan,
|
||||
)
|
||||
|
||||
if "cpl-cli" in [y for x, y in dependencies]:
|
||||
import cpl_cli
|
||||
|
||||
Console.spinner(
|
||||
"Running migrations",
|
||||
self._migrations.migrate_from,
|
||||
cpl_cli.__version__,
|
||||
text_foreground_color=ForegroundColorEnum.green,
|
||||
spinner_foreground_color=ForegroundColorEnum.cyan,
|
||||
)
|
||||
|
||||
Console.write_line(f"Found {len(self._project_settings.dependencies)} dependencies.")
|
||||
|
||||
@staticmethod
|
||||
def _check_outdated():
|
||||
"""
|
||||
Checks for outdated packages in project
|
||||
:return:
|
||||
"""
|
||||
table_str: bytes = Console.spinner(
|
||||
"Analyzing for available package updates",
|
||||
Pip.get_outdated,
|
||||
text_foreground_color=ForegroundColorEnum.green,
|
||||
spinner_foreground_color=ForegroundColorEnum.cyan,
|
||||
)
|
||||
|
||||
table = str(table_str, "utf-8").split("\n")
|
||||
if len(table) > 1 and table[0] != "":
|
||||
Console.write_line("\tAvailable updates for packages:")
|
||||
for row in table:
|
||||
Console.write_line(f"\t{row}")
|
||||
|
||||
Console.set_foreground_color(ForegroundColorEnum.yellow)
|
||||
Console.write_line(f"\tUpdate with {Pip.get_executable()} -m pip install --upgrade <package>")
|
||||
Console.set_foreground_color(ForegroundColorEnum.default)
|
||||
|
||||
def _save_formatted_package_name_to_deps_collection(self, deps: [str], old_package: str, new_package: str):
|
||||
if old_package not in deps:
|
||||
return
|
||||
|
||||
initial_package = new_package
|
||||
|
||||
if "/" in new_package:
|
||||
new_package = new_package.split("/")[0]
|
||||
|
||||
if "\r" in new_package:
|
||||
new_package = new_package.replace("\r", "")
|
||||
|
||||
if new_package == old_package:
|
||||
return
|
||||
|
||||
index = deps.index(old_package)
|
||||
deps[index] = new_package
|
||||
|
||||
def _project_json_update_dependency(self, old_package: str, new_package: str):
|
||||
"""
|
||||
Writes new package version to project.json
|
||||
:param old_package:
|
||||
:param new_package:
|
||||
:return:
|
||||
"""
|
||||
if self._is_simulation:
|
||||
return
|
||||
|
||||
self._save_formatted_package_name_to_deps_collection(
|
||||
self._project_settings.dependencies, old_package, new_package
|
||||
)
|
||||
self._save_formatted_package_name_to_deps_collection(
|
||||
self._project_settings.dev_dependencies, old_package, new_package
|
||||
)
|
||||
|
||||
config = {
|
||||
ProjectSettings.__name__: SettingsHelper.get_project_settings_dict(self._project_settings),
|
||||
BuildSettings.__name__: SettingsHelper.get_build_settings_dict(self._build_settings),
|
||||
}
|
||||
|
||||
with open(os.path.join(self._env.working_directory, self._project_file), "w") as project:
|
||||
project.write(json.dumps(config, indent=2))
|
||||
project.close()
|
||||
|
||||
def execute(self, args: list[str]):
|
||||
"""
|
||||
Entry point of command
|
||||
:param args:
|
||||
:return:
|
||||
"""
|
||||
if "simulate" in args:
|
||||
args.remove("simulate")
|
||||
Console.write_line("Running in simulation mode:")
|
||||
self._is_simulation = True
|
||||
|
||||
if "cpl-prod" in args:
|
||||
args.remove("cpl-prod")
|
||||
self._cli_settings.from_dict({"PipPath": "https://pip.sh-edraft.de"})
|
||||
|
||||
if "cpl-exp" in args:
|
||||
args.remove("cpl-exp")
|
||||
self._cli_settings.from_dict({"PipPath": "https://pip-exp.sh-edraft.de"})
|
||||
|
||||
if "cpl-dev" in args:
|
||||
args.remove("cpl-dev")
|
||||
self._cli_settings.from_dict({"PipPath": "https://pip-dev.sh-edraft.de"})
|
||||
|
||||
VenvHelper.init_venv(False, self._env, self._project_settings.python_executable)
|
||||
|
||||
self._check_project_dependencies()
|
||||
self._check_outdated()
|
||||
Pip.reset_executable()
|
||||
49
src/cpl_cli/command/version_service.py
Normal file
49
src/cpl_cli/command/version_service.py
Normal file
@@ -0,0 +1,49 @@
|
||||
import pkgutil
|
||||
import sys
|
||||
import platform
|
||||
import pkg_resources
|
||||
import textwrap
|
||||
|
||||
import cpl_cli
|
||||
from cpl_cli.helper.dependencies import Dependencies
|
||||
from cpl_core.console.console import Console
|
||||
from cpl_core.console.foreground_color_enum import ForegroundColorEnum
|
||||
from cpl_cli.command_abc import CommandABC
|
||||
|
||||
|
||||
class VersionService(CommandABC):
|
||||
def __init__(self):
|
||||
"""
|
||||
Service for the CLI command version
|
||||
"""
|
||||
CommandABC.__init__(self)
|
||||
|
||||
@property
|
||||
def help_message(self) -> str:
|
||||
return textwrap.dedent(
|
||||
"""\
|
||||
Lists the version of CPL, CPL CLI and all installed packages from pip.
|
||||
Usage: cpl version
|
||||
"""
|
||||
)
|
||||
|
||||
def execute(self, args: list[str]):
|
||||
"""
|
||||
Entry point of command
|
||||
:param args:
|
||||
:return:
|
||||
"""
|
||||
Console.set_foreground_color(ForegroundColorEnum.yellow)
|
||||
Console.banner("CPL CLI")
|
||||
Console.set_foreground_color(ForegroundColorEnum.default)
|
||||
if "__version__" in dir(cpl_cli):
|
||||
Console.write_line(f"Common Python library CLI: ")
|
||||
Console.write(cpl_cli.__version__)
|
||||
|
||||
Console.write_line(f"Python: ")
|
||||
Console.write(f"{sys.version_info.major}.{sys.version_info.minor}.{sys.version_info.micro}")
|
||||
Console.write_line(f"OS: {platform.system()} {platform.processor()}")
|
||||
Console.write_line("\nCPL packages:")
|
||||
Console.table(["Name", "Version"], Dependencies.get_cpl_packages())
|
||||
Console.write_line("\nPython packages:")
|
||||
Console.table(["Name", "Version"], Dependencies.get_packages())
|
||||
26
src/cpl_cli/command_abc.py
Normal file
26
src/cpl_cli/command_abc.py
Normal file
@@ -0,0 +1,26 @@
|
||||
from abc import abstractmethod, ABC
|
||||
|
||||
from cpl_core.configuration.argument_executable_abc import ArgumentExecutableABC
|
||||
from cpl_core.console import Console
|
||||
|
||||
|
||||
class CommandABC(ArgumentExecutableABC):
|
||||
@abstractmethod
|
||||
def __init__(self):
|
||||
ABC.__init__(self)
|
||||
|
||||
@property
|
||||
@abstractmethod
|
||||
def help_message(self) -> str:
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def execute(self, args: list[str]):
|
||||
pass
|
||||
|
||||
def run(self, args: list[str]):
|
||||
if "help" in args:
|
||||
Console.write_line(self.help_message)
|
||||
return
|
||||
|
||||
self.execute(args)
|
||||
34
src/cpl_cli/configuration/__init__.py
Normal file
34
src/cpl_cli/configuration/__init__.py
Normal file
@@ -0,0 +1,34 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
"""
|
||||
cpl-cli CPL CLI
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
CPL Command Line Interface
|
||||
|
||||
:copyright: (c) 2020 - 2024 sh-edraft.de
|
||||
:license: MIT, see LICENSE for more details.
|
||||
|
||||
"""
|
||||
|
||||
__title__ = "cpl_cli.configuration"
|
||||
__author__ = "Sven Heidemann"
|
||||
__license__ = "MIT"
|
||||
__copyright__ = "Copyright (c) 2020 - 2024 sh-edraft.de"
|
||||
__version__ = "2024.10.0"
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
|
||||
# imports:
|
||||
from .build_settings import BuildSettings
|
||||
from .build_settings_name_enum import BuildSettingsNameEnum
|
||||
from .project_settings import ProjectSettings
|
||||
from .project_settings_name_enum import ProjectSettingsNameEnum
|
||||
from .version_settings import VersionSettings
|
||||
from .version_settings_name_enum import VersionSettingsNameEnum
|
||||
from .workspace_settings import WorkspaceSettings
|
||||
from .workspace_settings_name_enum import WorkspaceSettingsNameEnum
|
||||
|
||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||
version_info = VersionInfo(major="2024", minor="10", micro="0")
|
||||
95
src/cpl_cli/configuration/build_settings.py
Normal file
95
src/cpl_cli/configuration/build_settings.py
Normal file
@@ -0,0 +1,95 @@
|
||||
import sys
|
||||
import traceback
|
||||
from typing import Optional
|
||||
|
||||
from cpl_cli.configuration.build_settings_name_enum import BuildSettingsNameEnum
|
||||
from cpl_cli.configuration.project_type_enum import ProjectTypeEnum
|
||||
from cpl_core.configuration.configuration_model_abc import ConfigurationModelABC
|
||||
from cpl_core.console.console import Console
|
||||
from cpl_core.console.foreground_color_enum import ForegroundColorEnum
|
||||
|
||||
|
||||
class BuildSettings(ConfigurationModelABC):
|
||||
def __init__(
|
||||
self,
|
||||
project_type: ProjectTypeEnum = None,
|
||||
source_path: str = None,
|
||||
output_path: str = None,
|
||||
main: str = None,
|
||||
entry_point: str = None,
|
||||
include_package_data: bool = None,
|
||||
included: list = None,
|
||||
excluded: list = None,
|
||||
package_data: dict = None,
|
||||
project_references: list = None,
|
||||
):
|
||||
ConfigurationModelABC.__init__(self)
|
||||
|
||||
self._project_type: Optional[ProjectTypeEnum] = project_type
|
||||
self._source_path: Optional[str] = source_path
|
||||
self._output_path: Optional[str] = output_path
|
||||
self._main: Optional[str] = main
|
||||
self._entry_point: Optional[str] = entry_point
|
||||
self._include_package_data: Optional[bool] = include_package_data
|
||||
self._included: Optional[list[str]] = included
|
||||
self._excluded: Optional[list[str]] = excluded
|
||||
self._package_data: Optional[dict[str, list[str]]] = package_data
|
||||
self._project_references: Optional[list[str]] = [] if project_references is None else project_references
|
||||
|
||||
if sys.platform == "win32":
|
||||
self._source_path = str(self._source_path).replace("/", "\\")
|
||||
self._output_path = str(self._output_path).replace("/", "\\")
|
||||
|
||||
# windows paths for excluded files
|
||||
excluded = []
|
||||
for ex in self._excluded:
|
||||
excluded.append(str(ex).replace("/", "\\"))
|
||||
|
||||
self._excluded = excluded
|
||||
|
||||
# windows paths for included files
|
||||
included = []
|
||||
for inc in self._included:
|
||||
included.append(str(inc).replace("/", "\\"))
|
||||
|
||||
self._included = included
|
||||
|
||||
@property
|
||||
def project_type(self):
|
||||
return self._project_type
|
||||
|
||||
@property
|
||||
def source_path(self) -> str:
|
||||
return self._source_path
|
||||
|
||||
@property
|
||||
def output_path(self) -> str:
|
||||
return self._output_path
|
||||
|
||||
@property
|
||||
def main(self) -> str:
|
||||
return self._main
|
||||
|
||||
@property
|
||||
def entry_point(self) -> str:
|
||||
return self._entry_point
|
||||
|
||||
@property
|
||||
def include_package_data(self) -> bool:
|
||||
return self._include_package_data
|
||||
|
||||
@property
|
||||
def included(self) -> list[str]:
|
||||
return self._included
|
||||
|
||||
@property
|
||||
def excluded(self) -> list[str]:
|
||||
return self._excluded
|
||||
|
||||
@property
|
||||
def package_data(self) -> dict[str, list[str]]:
|
||||
return self._package_data
|
||||
|
||||
@property
|
||||
def project_references(self) -> list[str]:
|
||||
return self._project_references
|
||||
14
src/cpl_cli/configuration/build_settings_name_enum.py
Normal file
14
src/cpl_cli/configuration/build_settings_name_enum.py
Normal file
@@ -0,0 +1,14 @@
|
||||
from enum import Enum
|
||||
|
||||
|
||||
class BuildSettingsNameEnum(Enum):
|
||||
project_type = "ProjectType"
|
||||
source_path = "SourcePath"
|
||||
output_path = "OutputPath"
|
||||
main = "Main"
|
||||
entry_point = "EntryPoint"
|
||||
include_package_data = "IncludePackageData"
|
||||
included = "Included"
|
||||
excluded = "Excluded"
|
||||
package_data = "PackageData"
|
||||
project_references = "ProjectReferences"
|
||||
132
src/cpl_cli/configuration/project_settings.py
Normal file
132
src/cpl_cli/configuration/project_settings.py
Normal file
@@ -0,0 +1,132 @@
|
||||
import os
|
||||
import sys
|
||||
from typing import Optional
|
||||
|
||||
from cpl_cli.configuration.project_settings_name_enum import ProjectSettingsNameEnum
|
||||
from cpl_cli.configuration.version_settings import VersionSettings
|
||||
from cpl_cli.error import Error
|
||||
from cpl_core.configuration.configuration_model_abc import ConfigurationModelABC
|
||||
|
||||
|
||||
class ProjectSettings(ConfigurationModelABC):
|
||||
def __init__(
|
||||
self,
|
||||
name: str = None,
|
||||
version: VersionSettings = None,
|
||||
author: str = None,
|
||||
author_email: str = None,
|
||||
description: str = None,
|
||||
long_description: str = None,
|
||||
url: str = None,
|
||||
copyright_date: str = None,
|
||||
copyright_name: str = None,
|
||||
license_name: str = None,
|
||||
license_description: str = None,
|
||||
dependencies: list = None,
|
||||
dev_dependencies: list = None,
|
||||
python_version: str = None,
|
||||
python_path: dict = None,
|
||||
python_executable: str = None,
|
||||
classifiers: list = None,
|
||||
):
|
||||
ConfigurationModelABC.__init__(self)
|
||||
|
||||
self._name: Optional[str] = name
|
||||
self._version: Optional[VersionSettings] = version
|
||||
self._author: Optional[str] = author
|
||||
self._author_email: Optional[str] = author_email
|
||||
self._description: Optional[str] = description
|
||||
self._long_description: Optional[str] = long_description
|
||||
self._url: Optional[str] = url
|
||||
self._copyright_date: Optional[str] = copyright_date
|
||||
self._copyright_name: Optional[str] = copyright_name
|
||||
self._license_name: Optional[str] = license_name
|
||||
self._license_description: Optional[str] = license_description
|
||||
self._dependencies: Optional[list[str]] = [] if dependencies is None else dependencies
|
||||
self._dev_dependencies: Optional[list[str]] = [] if dev_dependencies is None else dev_dependencies
|
||||
self._python_version: Optional[str] = python_version
|
||||
self._python_path: Optional[str] = python_path
|
||||
self._python_executable: Optional[str] = python_executable
|
||||
self._classifiers: Optional[list[str]] = [] if classifiers is None else classifiers
|
||||
|
||||
if python_path is not None and sys.platform in python_path:
|
||||
path = f"{python_path[sys.platform]}"
|
||||
|
||||
if path == "" or path is None:
|
||||
Error.warn(f"{ProjectSettingsNameEnum.python_path.value} not set")
|
||||
path = sys.executable
|
||||
else:
|
||||
if not path.endswith("bin/python"):
|
||||
path = os.path.join(path, "bin/python")
|
||||
else:
|
||||
path = sys.executable
|
||||
|
||||
self._python_executable = path
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
return self._name
|
||||
|
||||
@property
|
||||
def version(self) -> VersionSettings:
|
||||
return self._version
|
||||
|
||||
@property
|
||||
def author(self) -> str:
|
||||
return self._author
|
||||
|
||||
@property
|
||||
def author_email(self) -> str:
|
||||
return self._author_email
|
||||
|
||||
@property
|
||||
def description(self) -> str:
|
||||
return self._description
|
||||
|
||||
@property
|
||||
def long_description(self) -> str:
|
||||
return self._long_description
|
||||
|
||||
@property
|
||||
def url(self) -> str:
|
||||
return self._url
|
||||
|
||||
@property
|
||||
def copyright_date(self) -> str:
|
||||
return self._copyright_date
|
||||
|
||||
@property
|
||||
def copyright_name(self) -> str:
|
||||
return self._copyright_name
|
||||
|
||||
@property
|
||||
def license_name(self) -> str:
|
||||
return self._license_name
|
||||
|
||||
@property
|
||||
def license_description(self) -> str:
|
||||
return self._license_description
|
||||
|
||||
@property
|
||||
def dependencies(self) -> list[str]:
|
||||
return self._dependencies
|
||||
|
||||
@property
|
||||
def dev_dependencies(self) -> list[str]:
|
||||
return self._dev_dependencies
|
||||
|
||||
@property
|
||||
def python_version(self) -> str:
|
||||
return self._python_version
|
||||
|
||||
@property
|
||||
def python_path(self) -> str:
|
||||
return self._python_path
|
||||
|
||||
@property
|
||||
def python_executable(self) -> str:
|
||||
return self._python_executable
|
||||
|
||||
@property
|
||||
def classifiers(self) -> list[str]:
|
||||
return self._classifiers
|
||||
20
src/cpl_cli/configuration/project_settings_name_enum.py
Normal file
20
src/cpl_cli/configuration/project_settings_name_enum.py
Normal file
@@ -0,0 +1,20 @@
|
||||
from enum import Enum
|
||||
|
||||
|
||||
class ProjectSettingsNameEnum(Enum):
|
||||
name = "Name"
|
||||
version = "Version"
|
||||
author = "Author"
|
||||
author_email = "AuthorEmail"
|
||||
description = "Description"
|
||||
long_description = "LongDescription"
|
||||
url = "URL"
|
||||
copyright_date = "CopyrightDate"
|
||||
copyright_name = "CopyrightName"
|
||||
license_name = "LicenseName"
|
||||
license_description = "LicenseDescription"
|
||||
dependencies = "Dependencies"
|
||||
dev_dependencies = "DevDependencies"
|
||||
python_version = "PythonVersion"
|
||||
python_path = "PythonPath"
|
||||
classifiers = "Classifiers"
|
||||
8
src/cpl_cli/configuration/project_type_enum.py
Normal file
8
src/cpl_cli/configuration/project_type_enum.py
Normal file
@@ -0,0 +1,8 @@
|
||||
from enum import Enum
|
||||
|
||||
|
||||
class ProjectTypeEnum(Enum):
|
||||
console = "console"
|
||||
library = "library"
|
||||
unittest = "unittest"
|
||||
discord_bot = "discord-bot"
|
||||
13
src/cpl_cli/configuration/schematic_collection.py
Normal file
13
src/cpl_cli/configuration/schematic_collection.py
Normal file
@@ -0,0 +1,13 @@
|
||||
from cpl_core.utils import String
|
||||
|
||||
|
||||
class SchematicCollection:
|
||||
_schematics: dict = {}
|
||||
|
||||
@classmethod
|
||||
def register(cls, template: type, schematic: str, aliases: list[str]):
|
||||
cls._schematics[schematic] = {"Template": template, "Aliases": aliases}
|
||||
|
||||
@classmethod
|
||||
def get_schematics(cls) -> dict:
|
||||
return cls._schematics
|
||||
47
src/cpl_cli/configuration/settings_helper.py
Normal file
47
src/cpl_cli/configuration/settings_helper.py
Normal file
@@ -0,0 +1,47 @@
|
||||
from cpl_cli.configuration.version_settings_name_enum import VersionSettingsNameEnum
|
||||
from cpl_cli.configuration.build_settings import BuildSettings
|
||||
from cpl_cli.configuration.build_settings_name_enum import BuildSettingsNameEnum
|
||||
from cpl_cli.configuration.project_settings import ProjectSettings
|
||||
from cpl_cli.configuration.project_settings_name_enum import ProjectSettingsNameEnum
|
||||
|
||||
|
||||
class SettingsHelper:
|
||||
@staticmethod
|
||||
def get_project_settings_dict(project: ProjectSettings) -> dict:
|
||||
return {
|
||||
ProjectSettingsNameEnum.name.value: project.name,
|
||||
ProjectSettingsNameEnum.version.value: {
|
||||
VersionSettingsNameEnum.major.value: project.version.major,
|
||||
VersionSettingsNameEnum.minor.value: project.version.minor,
|
||||
VersionSettingsNameEnum.micro.value: project.version.micro,
|
||||
},
|
||||
ProjectSettingsNameEnum.author.value: project.author,
|
||||
ProjectSettingsNameEnum.author_email.value: project.author_email,
|
||||
ProjectSettingsNameEnum.description.value: project.description,
|
||||
ProjectSettingsNameEnum.long_description.value: project.long_description,
|
||||
ProjectSettingsNameEnum.url.value: project.url,
|
||||
ProjectSettingsNameEnum.copyright_date.value: project.copyright_date,
|
||||
ProjectSettingsNameEnum.copyright_name.value: project.copyright_name,
|
||||
ProjectSettingsNameEnum.license_name.value: project.license_name,
|
||||
ProjectSettingsNameEnum.license_description.value: project.license_description,
|
||||
ProjectSettingsNameEnum.dependencies.value: project.dependencies,
|
||||
ProjectSettingsNameEnum.dev_dependencies.value: project.dev_dependencies,
|
||||
ProjectSettingsNameEnum.python_version.value: project.python_version,
|
||||
ProjectSettingsNameEnum.python_path.value: project.python_path,
|
||||
ProjectSettingsNameEnum.classifiers.value: project.classifiers,
|
||||
}
|
||||
|
||||
@staticmethod
|
||||
def get_build_settings_dict(build: BuildSettings) -> dict:
|
||||
return {
|
||||
BuildSettingsNameEnum.project_type.value: build.project_type.value,
|
||||
BuildSettingsNameEnum.source_path.value: build.source_path,
|
||||
BuildSettingsNameEnum.output_path.value: build.output_path,
|
||||
BuildSettingsNameEnum.main.value: build.main,
|
||||
BuildSettingsNameEnum.entry_point.value: build.entry_point,
|
||||
BuildSettingsNameEnum.include_package_data.value: build.include_package_data,
|
||||
BuildSettingsNameEnum.included.value: build.included,
|
||||
BuildSettingsNameEnum.excluded.value: build.excluded,
|
||||
BuildSettingsNameEnum.package_data.value: build.package_data,
|
||||
BuildSettingsNameEnum.project_references.value: build.project_references,
|
||||
}
|
||||
42
src/cpl_cli/configuration/venv_helper_service.py
Normal file
42
src/cpl_cli/configuration/venv_helper_service.py
Normal file
@@ -0,0 +1,42 @@
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
from cpl_cli.configuration import ProjectSettings
|
||||
from cpl_core.environment import ApplicationEnvironmentABC
|
||||
|
||||
from cpl_core.utils import Pip
|
||||
|
||||
from cpl_core.console import Console, ForegroundColorEnum
|
||||
|
||||
|
||||
class VenvHelper:
|
||||
@staticmethod
|
||||
def init_venv(is_virtual: bool, env: ApplicationEnvironmentABC, python_executable: str, explicit_path=None):
|
||||
if is_virtual:
|
||||
return
|
||||
|
||||
venv_path = os.path.abspath(os.path.join(env.working_directory, python_executable, "../../"))
|
||||
|
||||
if explicit_path is not None:
|
||||
venv_path = os.path.abspath(explicit_path)
|
||||
|
||||
if not os.path.exists(venv_path):
|
||||
Console.spinner(
|
||||
f"Creating venv: {venv_path}",
|
||||
VenvHelper.create_venv,
|
||||
venv_path,
|
||||
text_foreground_color=ForegroundColorEnum.green,
|
||||
spinner_foreground_color=ForegroundColorEnum.cyan,
|
||||
)
|
||||
|
||||
Pip.set_executable(python_executable)
|
||||
|
||||
@staticmethod
|
||||
def create_venv(path):
|
||||
subprocess.run(
|
||||
[sys.executable, "-m", "venv", os.path.abspath(os.path.join(path, "../../"))],
|
||||
stdout=subprocess.DEVNULL,
|
||||
stderr=subprocess.DEVNULL,
|
||||
stdin=subprocess.DEVNULL,
|
||||
)
|
||||
42
src/cpl_cli/configuration/version_settings.py
Normal file
42
src/cpl_cli/configuration/version_settings.py
Normal file
@@ -0,0 +1,42 @@
|
||||
from typing import Optional
|
||||
|
||||
from cpl_core.configuration.configuration_model_abc import ConfigurationModelABC
|
||||
from cpl_cli.configuration.version_settings_name_enum import VersionSettingsNameEnum
|
||||
|
||||
|
||||
class VersionSettings(ConfigurationModelABC):
|
||||
def __init__(self, major: str = None, minor: str = None, micro: str = None):
|
||||
ConfigurationModelABC.__init__(self)
|
||||
|
||||
self._major: Optional[str] = major
|
||||
self._minor: Optional[str] = minor
|
||||
self._micro: Optional[str] = micro if micro != "" else None
|
||||
|
||||
@property
|
||||
def major(self) -> str:
|
||||
return self._major
|
||||
|
||||
@property
|
||||
def minor(self) -> str:
|
||||
return self._minor
|
||||
|
||||
@property
|
||||
def micro(self) -> str:
|
||||
return self._micro
|
||||
|
||||
def to_str(self) -> str:
|
||||
if self._micro is None:
|
||||
return f"{self._major}.{self._minor}"
|
||||
else:
|
||||
return f"{self._major}.{self._minor}.{self._micro}"
|
||||
|
||||
def to_dict(self) -> dict:
|
||||
version = {
|
||||
VersionSettingsNameEnum.major.value: self._major,
|
||||
VersionSettingsNameEnum.minor.value: self._minor,
|
||||
}
|
||||
|
||||
if self._micro is not None:
|
||||
version[VersionSettingsNameEnum.micro.value] = self._micro
|
||||
|
||||
return version
|
||||
7
src/cpl_cli/configuration/version_settings_name_enum.py
Normal file
7
src/cpl_cli/configuration/version_settings_name_enum.py
Normal file
@@ -0,0 +1,7 @@
|
||||
from enum import Enum
|
||||
|
||||
|
||||
class VersionSettingsNameEnum(Enum):
|
||||
major = "Major"
|
||||
minor = "Minor"
|
||||
micro = "Micro"
|
||||
32
src/cpl_cli/configuration/workspace_settings.py
Normal file
32
src/cpl_cli/configuration/workspace_settings.py
Normal file
@@ -0,0 +1,32 @@
|
||||
import traceback
|
||||
from typing import Optional
|
||||
|
||||
from cpl_cli.configuration.workspace_settings_name_enum import WorkspaceSettingsNameEnum
|
||||
from cpl_core.configuration.configuration_model_abc import ConfigurationModelABC
|
||||
from cpl_core.console import Console
|
||||
|
||||
|
||||
class WorkspaceSettings(ConfigurationModelABC):
|
||||
def __init__(
|
||||
self,
|
||||
default_project: str = None,
|
||||
projects: dict = None,
|
||||
scripts: dict = None,
|
||||
):
|
||||
ConfigurationModelABC.__init__(self)
|
||||
|
||||
self._default_project: Optional[str] = default_project
|
||||
self._projects: dict[str, str] = {} if projects is None else projects
|
||||
self._scripts: dict[str, str] = {} if scripts is None else scripts
|
||||
|
||||
@property
|
||||
def default_project(self) -> str:
|
||||
return self._default_project
|
||||
|
||||
@property
|
||||
def projects(self) -> dict[str, str]:
|
||||
return self._projects
|
||||
|
||||
@property
|
||||
def scripts(self):
|
||||
return self._scripts
|
||||
@@ -0,0 +1,7 @@
|
||||
from enum import Enum
|
||||
|
||||
|
||||
class WorkspaceSettingsNameEnum(Enum):
|
||||
default_project = "DefaultProject"
|
||||
projects = "Projects"
|
||||
scripts = "Scripts"
|
||||
51
src/cpl_cli/cpl-cli.json
Normal file
51
src/cpl_cli/cpl-cli.json
Normal file
@@ -0,0 +1,51 @@
|
||||
{
|
||||
"ProjectSettings": {
|
||||
"Name": "cpl-cli",
|
||||
"Version": {
|
||||
"Major": "2024",
|
||||
"Minor": "7",
|
||||
"Micro": "0"
|
||||
},
|
||||
"Author": "Sven Heidemann",
|
||||
"AuthorEmail": "sven.heidemann@sh-edraft.de",
|
||||
"Description": "CPL CLI",
|
||||
"LongDescription": "CPL Command Line Interface",
|
||||
"URL": "https://www.sh-edraft.de",
|
||||
"CopyrightDate": "2020 - 2024",
|
||||
"CopyrightName": "sh-edraft.de",
|
||||
"LicenseName": "MIT",
|
||||
"LicenseDescription": "MIT, see LICENSE for more details.",
|
||||
"Dependencies": [
|
||||
"cpl-core>=2024.6.2024.07.0"
|
||||
],
|
||||
"DevDependencies": [],
|
||||
"PythonVersion": ">=3.12",
|
||||
"PythonPath": {
|
||||
"linux": "../../venv"
|
||||
},
|
||||
"Classifiers": []
|
||||
},
|
||||
"BuildSettings": {
|
||||
"ProjectType": "console",
|
||||
"SourcePath": "",
|
||||
"OutputPath": "../../dist",
|
||||
"Main": "cpl_cli.main",
|
||||
"EntryPoint": "cpl",
|
||||
"IncludePackageData": true,
|
||||
"Included": [
|
||||
"*/_templates"
|
||||
],
|
||||
"Excluded": [
|
||||
"*/__pycache__",
|
||||
"*/logs",
|
||||
"*/tests"
|
||||
],
|
||||
"PackageData": {
|
||||
"cpl_cli": [
|
||||
"*.json",
|
||||
".cpl/*.py"
|
||||
]
|
||||
},
|
||||
"ProjectReferences": []
|
||||
}
|
||||
}
|
||||
15
src/cpl_cli/error.py
Normal file
15
src/cpl_cli/error.py
Normal file
@@ -0,0 +1,15 @@
|
||||
from cpl_core.console.foreground_color_enum import ForegroundColorEnum
|
||||
from cpl_core.console.console import Console
|
||||
|
||||
|
||||
class Error:
|
||||
@staticmethod
|
||||
def error(message: str):
|
||||
Console.error(message)
|
||||
Console.error("Run 'cpl help'\n")
|
||||
|
||||
@staticmethod
|
||||
def warn(message: str):
|
||||
Console.set_foreground_color(ForegroundColorEnum.yellow)
|
||||
Console.write_line(message, "\n")
|
||||
Console.set_foreground_color(ForegroundColorEnum.default)
|
||||
26
src/cpl_cli/helper/__init__.py
Normal file
26
src/cpl_cli/helper/__init__.py
Normal file
@@ -0,0 +1,26 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
"""
|
||||
cpl-cli CPL CLI
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
CPL Command Line Interface
|
||||
|
||||
:copyright: (c) 2020 - 2024 sh-edraft.de
|
||||
:license: MIT, see LICENSE for more details.
|
||||
|
||||
"""
|
||||
|
||||
__title__ = "cpl_cli.helper"
|
||||
__author__ = "Sven Heidemann"
|
||||
__license__ = "MIT"
|
||||
__copyright__ = "Copyright (c) 2020 - 2024 sh-edraft.de"
|
||||
__version__ = "2024.10.0"
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
|
||||
# imports:
|
||||
|
||||
VersionInfo = namedtuple("VersionInfo", "major minor micro")
|
||||
version_info = VersionInfo(major="2024", minor="10", micro="0")
|
||||
22
src/cpl_cli/helper/dependencies.py
Normal file
22
src/cpl_cli/helper/dependencies.py
Normal file
@@ -0,0 +1,22 @@
|
||||
import pkg_resources
|
||||
|
||||
|
||||
class Dependencies:
|
||||
_packages = []
|
||||
_cpl_packages = []
|
||||
|
||||
_dependencies = dict(tuple(str(ws).split()) for ws in pkg_resources.working_set)
|
||||
for p in _dependencies:
|
||||
if str(p).startswith("cpl-"):
|
||||
_cpl_packages.append([p, _dependencies[p]])
|
||||
continue
|
||||
|
||||
_packages.append([p, _dependencies[p]])
|
||||
|
||||
@classmethod
|
||||
def get_cpl_packages(cls) -> list[list]:
|
||||
return cls._cpl_packages
|
||||
|
||||
@classmethod
|
||||
def get_packages(cls) -> list[list]:
|
||||
return cls._packages
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user