lash 1.3.1.2__tar.gz → 1.3.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (201) hide show
  1. {lash-1.3.1.2 → lash-1.3.2}/PKG-INFO +19 -8
  2. {lash-1.3.1.2 → lash-1.3.2}/lash/__init__.py +4 -1
  3. {lash-1.3.1.2 → lash-1.3.2}/lash/core/lazy_group.py +13 -4
  4. lash-1.3.2/lash/core/net.py +7 -0
  5. lash-1.3.2/lash/core/plugin_manager.py +480 -0
  6. {lash-1.3.1.2 → lash-1.3.2}/lash/plugins/__init__.py +30 -27
  7. {lash-1.3.1.2 → lash-1.3.2}/lash/plugins/audio/manifest.json +4 -2
  8. lash-1.3.2/lash/plugins/backup/cli.py +255 -0
  9. lash-1.3.2/lash/plugins/backup/core.py +272 -0
  10. lash-1.3.2/lash/plugins/backup/helpers.py +93 -0
  11. lash-1.3.2/lash/plugins/backup/manifest.json +14 -0
  12. lash-1.3.2/lash/plugins/backup/tests/test_cli.py +127 -0
  13. lash-1.3.2/lash/plugins/backup/tests/test_core.py +313 -0
  14. lash-1.3.2/lash/plugins/backup/tests/test_helpers.py +49 -0
  15. lash-1.3.2/lash/plugins/crack/cli.py +103 -0
  16. {lash-1.3.1.2 → lash-1.3.2}/lash/plugins/crack/core.py +8 -0
  17. {lash-1.3.1.2 → lash-1.3.2}/lash/plugins/crack/manifest.json +1 -1
  18. lash-1.3.2/lash/plugins/device/cli.py +86 -0
  19. lash-1.3.2/lash/plugins/device/core.py +64 -0
  20. lash-1.3.2/lash/plugins/device/manifest.json +15 -0
  21. lash-1.3.2/lash/plugins/device/tests/test_device.py +140 -0
  22. lash-1.3.2/lash/plugins/file/cli.py +212 -0
  23. lash-1.3.2/lash/plugins/file/core.py +41 -0
  24. lash-1.3.2/lash/plugins/file/manifest.json +14 -0
  25. lash-1.3.2/lash/plugins/file/tests/test_cli.py +163 -0
  26. lash-1.3.2/lash/plugins/file/tests/test_helpers.py +35 -0
  27. lash-1.3.2/lash/plugins/github/cli.py +65 -0
  28. lash-1.3.2/lash/plugins/github/manifest.json +15 -0
  29. lash-1.3.2/lash/plugins/github/tests/test_cli.py +12 -0
  30. lash-1.3.2/lash/plugins/gnews/cli.py +51 -0
  31. lash-1.3.2/lash/plugins/gnews/core.py +6 -0
  32. lash-1.3.2/lash/plugins/gnews/manifest.json +14 -0
  33. lash-1.3.2/lash/plugins/gnews/tests/test_cli.py +2 -0
  34. lash-1.3.2/lash/plugins/gnews/tests/test_core.py +26 -0
  35. lash-1.3.2/lash/plugins/image/cli.py +550 -0
  36. {lash-1.3.1.2 → lash-1.3.2}/lash/plugins/image/core.py +83 -69
  37. {lash-1.3.1.2 → lash-1.3.2}/lash/plugins/image/manifest.json +6 -2
  38. {lash-1.3.1.2 → lash-1.3.2}/lash/plugins/image/tests/test_image.py +124 -84
  39. lash-1.3.2/lash/plugins/keylogger/cli.py +22 -0
  40. lash-1.3.2/lash/plugins/keylogger/core.py +26 -0
  41. lash-1.3.2/lash/plugins/keylogger/manifest.json +14 -0
  42. {lash-1.3.1.2/lash/plugins/device → lash-1.3.2/lash/plugins/keylogger}/tests/conftest.py +3 -3
  43. lash-1.3.2/lash/plugins/keylogger/tests/test_keylogger.py +129 -0
  44. lash-1.3.2/lash/plugins/macro/cli.py +116 -0
  45. lash-1.3.2/lash/plugins/macro/core.py +325 -0
  46. lash-1.3.2/lash/plugins/macro/helpers.py +141 -0
  47. lash-1.3.2/lash/plugins/macro/manifest.json +15 -0
  48. lash-1.3.2/lash/plugins/macro/tests/test_cli.py +200 -0
  49. lash-1.3.2/lash/plugins/macro/tests/test_core.py +717 -0
  50. lash-1.3.2/lash/plugins/macro/tests/test_shortcuts.py +310 -0
  51. {lash-1.3.1.2 → lash-1.3.2}/lash/plugins/monitor/cli.py +8 -6
  52. {lash-1.3.1.2 → lash-1.3.2}/lash/plugins/monitor/manifest.json +5 -2
  53. {lash-1.3.1.2 → lash-1.3.2}/lash/plugins/monitor/tests/test_monitor.py +17 -1
  54. {lash-1.3.1.2 → lash-1.3.2}/lash/plugins/random/cli.py +37 -8
  55. {lash-1.3.1.2 → lash-1.3.2}/lash/plugins/random/manifest.json +1 -1
  56. {lash-1.3.1.2 → lash-1.3.2}/lash/plugins/random/tests/test_cli.py +5 -5
  57. lash-1.3.2/lash/plugins/sched/cli.py +158 -0
  58. {lash-1.3.1.2 → lash-1.3.2}/lash/plugins/sched/core.py +5 -0
  59. {lash-1.3.1.2 → lash-1.3.2}/lash/plugins/sched/manifest.json +1 -1
  60. lash-1.3.2/lash/plugins/sched/tests/test_cli.py +87 -0
  61. lash-1.3.2/lash/plugins/share/cli.py +94 -0
  62. lash-1.3.2/lash/plugins/share/core.py +728 -0
  63. lash-1.3.2/lash/plugins/share/helpers.py +125 -0
  64. lash-1.3.2/lash/plugins/share/manifest.json +15 -0
  65. lash-1.3.2/lash/plugins/share/static/index.html +532 -0
  66. lash-1.3.2/lash/plugins/share/tests/test_cli.py +204 -0
  67. lash-1.3.2/lash/plugins/share/tests/test_core.py +374 -0
  68. lash-1.3.2/lash/plugins/share/tests/test_helpers.py +196 -0
  69. lash-1.3.2/lash/plugins/share/tests/test_server.py +455 -0
  70. lash-1.3.2/lash/plugins/spider/__init__.py +0 -0
  71. lash-1.3.2/lash/plugins/spider/cli.py +118 -0
  72. {lash-1.3.1.2 → lash-1.3.2}/lash/plugins/spider/core.py +296 -56
  73. {lash-1.3.1.2 → lash-1.3.2}/lash/plugins/spider/helpers.py +3 -1
  74. {lash-1.3.1.2 → lash-1.3.2}/lash/plugins/spider/manifest.json +2 -2
  75. lash-1.3.2/lash/plugins/spider/tests/__init__.py +0 -0
  76. lash-1.3.2/lash/plugins/spider/tests/test_discovery.py +194 -0
  77. {lash-1.3.1.2 → lash-1.3.2}/lash/plugins/spider/tests/test_server.py +103 -39
  78. lash-1.3.2/lash/plugins/todo/__init__.py +0 -0
  79. lash-1.3.2/lash/plugins/todo/cli.py +8 -0
  80. {lash-1.3.1.2/lash/plugins/work → lash-1.3.2/lash/plugins/todo}/core.py +31 -24
  81. lash-1.3.2/lash/plugins/todo/helpers.py +110 -0
  82. lash-1.3.2/lash/plugins/todo/manifest.json +15 -0
  83. lash-1.3.2/lash/plugins/todo/tests/__init__.py +0 -0
  84. lash-1.3.2/lash/plugins/todo/tests/test_core.py +123 -0
  85. lash-1.3.2/lash/plugins/todo/tui.py +736 -0
  86. lash-1.3.2/lash/plugins/video/__init__.py +0 -0
  87. lash-1.3.2/lash/plugins/video/cli.py +285 -0
  88. lash-1.3.2/lash/plugins/video/core.py +106 -0
  89. lash-1.3.2/lash/plugins/video/manifest.json +19 -0
  90. lash-1.3.2/lash/plugins/video/tests/__init__.py +0 -0
  91. {lash-1.3.1.2 → lash-1.3.2}/lash/plugins/video/tests/test_video.py +108 -45
  92. lash-1.3.2/lash/plugins/wikip/__init__.py +0 -0
  93. lash-1.3.2/lash/plugins/wikip/cli.py +35 -0
  94. lash-1.3.2/lash/plugins/wikip/manifest.json +14 -0
  95. lash-1.3.2/lash/plugins/wikip/tests/__init__.py +0 -0
  96. lash-1.3.2/lash/plugins/wikip/tests/test_cli.py +12 -0
  97. lash-1.3.2/lash/plugins/yt/__init__.py +0 -0
  98. lash-1.3.2/lash/plugins/yt/cli.py +71 -0
  99. lash-1.3.2/lash/plugins/yt/core.py +24 -0
  100. lash-1.3.2/lash/plugins/yt/manifest.json +14 -0
  101. lash-1.3.2/lash/plugins/yt/tests/__init__.py +0 -0
  102. {lash-1.3.1.2 → lash-1.3.2}/lash.egg-info/PKG-INFO +19 -8
  103. {lash-1.3.1.2 → lash-1.3.2}/lash.egg-info/SOURCES.txt +68 -26
  104. {lash-1.3.1.2 → lash-1.3.2}/lash.egg-info/requires.txt +7 -4
  105. {lash-1.3.1.2 → lash-1.3.2}/pyproject.toml +37 -8
  106. lash-1.3.2/tests/__init__.py +0 -0
  107. lash-1.3.2/tests/core/__init__.py +0 -0
  108. lash-1.3.2/tests/core/test_downloader.py +254 -0
  109. lash-1.3.2/tests/core/test_fixer.py +310 -0
  110. {lash-1.3.1.2 → lash-1.3.2}/tests/core/test_lazy_group.py +12 -4
  111. lash-1.3.2/tests/core/test_plugin_list.py +307 -0
  112. lash-1.3.2/tests/core/test_plugin_registry.py +213 -0
  113. lash-1.3.2/tests/core/test_remover.py +257 -0
  114. {lash-1.3.1.2 → lash-1.3.2}/tests/test_lazy_group.py +24 -7
  115. lash-1.3.1.2/lash/core/plugin_manager.py +0 -312
  116. lash-1.3.1.2/lash/plugins/calc/cli.py +0 -113
  117. lash-1.3.1.2/lash/plugins/calc/core.py +0 -45
  118. lash-1.3.1.2/lash/plugins/calc/helpers.py +0 -12
  119. lash-1.3.1.2/lash/plugins/calc/manifest.json +0 -12
  120. lash-1.3.1.2/lash/plugins/calc/tests/test_cli.py +0 -63
  121. lash-1.3.1.2/lash/plugins/calc/tests/test_core.py +0 -78
  122. lash-1.3.1.2/lash/plugins/crack/cli.py +0 -72
  123. lash-1.3.1.2/lash/plugins/device/cli.py +0 -171
  124. lash-1.3.1.2/lash/plugins/device/core.py +0 -305
  125. lash-1.3.1.2/lash/plugins/device/helpers.py +0 -93
  126. lash-1.3.1.2/lash/plugins/device/manifest.json +0 -12
  127. lash-1.3.1.2/lash/plugins/device/tests/test_device.py +0 -228
  128. lash-1.3.1.2/lash/plugins/device/tests/test_macro.py +0 -621
  129. lash-1.3.1.2/lash/plugins/file/cli.py +0 -327
  130. lash-1.3.1.2/lash/plugins/file/core.py +0 -65
  131. lash-1.3.1.2/lash/plugins/file/manifest.json +0 -12
  132. lash-1.3.1.2/lash/plugins/file/tests/test_cli.py +0 -119
  133. lash-1.3.1.2/lash/plugins/file/tests/test_helpers.py +0 -46
  134. lash-1.3.1.2/lash/plugins/image/cli.py +0 -326
  135. lash-1.3.1.2/lash/plugins/sched/cli.py +0 -81
  136. lash-1.3.1.2/lash/plugins/sched/tests/test_cli.py +0 -37
  137. lash-1.3.1.2/lash/plugins/spider/cli.py +0 -94
  138. lash-1.3.1.2/lash/plugins/video/cli.py +0 -292
  139. lash-1.3.1.2/lash/plugins/video/core.py +0 -108
  140. lash-1.3.1.2/lash/plugins/video/manifest.json +0 -12
  141. lash-1.3.1.2/lash/plugins/web/cli.py +0 -192
  142. lash-1.3.1.2/lash/plugins/web/core.py +0 -37
  143. lash-1.3.1.2/lash/plugins/web/manifest.json +0 -12
  144. lash-1.3.1.2/lash/plugins/web/tests/test_cli.py +0 -33
  145. lash-1.3.1.2/lash/plugins/web/tests/test_helpers.py +0 -10
  146. lash-1.3.1.2/lash/plugins/work/cli.py +0 -261
  147. lash-1.3.1.2/lash/plugins/work/helpers.py +0 -40
  148. lash-1.3.1.2/lash/plugins/work/manifest.json +0 -12
  149. lash-1.3.1.2/lash/plugins/work/tests/test_cli.py +0 -275
  150. lash-1.3.1.2/lash/plugins/work/tests/test_core.py +0 -366
  151. lash-1.3.1.2/tests/core/test_downloader.py +0 -113
  152. lash-1.3.1.2/tests/core/test_fixer.py +0 -168
  153. lash-1.3.1.2/tests/core/test_plugin_list.py +0 -114
  154. lash-1.3.1.2/tests/core/test_plugin_registry.py +0 -141
  155. lash-1.3.1.2/tests/core/test_remover.py +0 -113
  156. {lash-1.3.1.2 → lash-1.3.2}/LICENSE +0 -0
  157. {lash-1.3.1.2 → lash-1.3.2}/README.md +0 -0
  158. {lash-1.3.1.2 → lash-1.3.2}/lash/__main__.py +0 -0
  159. {lash-1.3.1.2 → lash-1.3.2}/lash/core/__init__.py +0 -0
  160. {lash-1.3.1.2 → lash-1.3.2}/lash/plugins/audio/__init__.py +0 -0
  161. {lash-1.3.1.2 → lash-1.3.2}/lash/plugins/audio/cli.py +0 -0
  162. {lash-1.3.1.2 → lash-1.3.2}/lash/plugins/audio/core.py +0 -0
  163. {lash-1.3.1.2 → lash-1.3.2}/lash/plugins/audio/tests/__init__.py +0 -0
  164. {lash-1.3.1.2 → lash-1.3.2}/lash/plugins/audio/tests/test_audio.py +0 -0
  165. {lash-1.3.1.2/lash/plugins/calc → lash-1.3.2/lash/plugins/backup}/__init__.py +0 -0
  166. {lash-1.3.1.2/lash/plugins/calc → lash-1.3.2/lash/plugins/backup}/tests/__init__.py +0 -0
  167. {lash-1.3.1.2 → lash-1.3.2}/lash/plugins/crack/__init__.py +0 -0
  168. {lash-1.3.1.2 → lash-1.3.2}/lash/plugins/crack/tests/__init__.py +0 -0
  169. {lash-1.3.1.2 → lash-1.3.2}/lash/plugins/crack/tests/test_crack.py +0 -0
  170. {lash-1.3.1.2 → lash-1.3.2}/lash/plugins/device/__init__.py +0 -0
  171. {lash-1.3.1.2 → lash-1.3.2}/lash/plugins/device/tests/__init__.py +0 -0
  172. {lash-1.3.1.2 → lash-1.3.2}/lash/plugins/file/__init__.py +0 -0
  173. {lash-1.3.1.2 → lash-1.3.2}/lash/plugins/file/helpers.py +0 -0
  174. {lash-1.3.1.2 → lash-1.3.2}/lash/plugins/file/tests/__init__.py +0 -0
  175. {lash-1.3.1.2/lash/plugins/image → lash-1.3.2/lash/plugins/github}/__init__.py +0 -0
  176. {lash-1.3.1.2/lash/plugins/image → lash-1.3.2/lash/plugins/github}/tests/__init__.py +0 -0
  177. {lash-1.3.1.2/lash/plugins/monitor → lash-1.3.2/lash/plugins/gnews}/__init__.py +0 -0
  178. {lash-1.3.1.2/lash/plugins/monitor → lash-1.3.2/lash/plugins/gnews}/tests/__init__.py +0 -0
  179. {lash-1.3.1.2/lash/plugins/random → lash-1.3.2/lash/plugins/image}/__init__.py +0 -0
  180. {lash-1.3.1.2/lash/plugins/random → lash-1.3.2/lash/plugins/image}/tests/__init__.py +0 -0
  181. {lash-1.3.1.2/lash/plugins/sched → lash-1.3.2/lash/plugins/keylogger}/__init__.py +0 -0
  182. {lash-1.3.1.2/lash/plugins/sched → lash-1.3.2/lash/plugins/keylogger}/tests/__init__.py +0 -0
  183. {lash-1.3.1.2/lash/plugins/spider → lash-1.3.2/lash/plugins/macro}/__init__.py +0 -0
  184. {lash-1.3.1.2/lash/plugins/spider → lash-1.3.2/lash/plugins/macro}/tests/__init__.py +0 -0
  185. {lash-1.3.1.2/lash/plugins/video → lash-1.3.2/lash/plugins/monitor}/__init__.py +0 -0
  186. {lash-1.3.1.2 → lash-1.3.2}/lash/plugins/monitor/core.py +0 -0
  187. {lash-1.3.1.2/lash/plugins/video → lash-1.3.2/lash/plugins/monitor}/tests/__init__.py +0 -0
  188. {lash-1.3.1.2/lash/plugins/web → lash-1.3.2/lash/plugins/random}/__init__.py +0 -0
  189. {lash-1.3.1.2 → lash-1.3.2}/lash/plugins/random/core.py +0 -0
  190. {lash-1.3.1.2/lash/plugins/web → lash-1.3.2/lash/plugins/random}/tests/__init__.py +0 -0
  191. {lash-1.3.1.2 → lash-1.3.2}/lash/plugins/random/tests/test_core.py +0 -0
  192. {lash-1.3.1.2/lash/plugins/work → lash-1.3.2/lash/plugins/sched}/__init__.py +0 -0
  193. {lash-1.3.1.2/lash/plugins/work → lash-1.3.2/lash/plugins/sched}/tests/__init__.py +0 -0
  194. {lash-1.3.1.2 → lash-1.3.2}/lash/plugins/sched/tests/test_core.py +0 -0
  195. {lash-1.3.1.2/tests → lash-1.3.2/lash/plugins/share}/__init__.py +0 -0
  196. {lash-1.3.1.2/tests/core → lash-1.3.2/lash/plugins/share/tests}/__init__.py +0 -0
  197. {lash-1.3.1.2 → lash-1.3.2}/lash/plugins/spider/tests/conftest.py +0 -0
  198. {lash-1.3.1.2 → lash-1.3.2}/lash.egg-info/dependency_links.txt +0 -0
  199. {lash-1.3.1.2 → lash-1.3.2}/lash.egg-info/entry_points.txt +0 -0
  200. {lash-1.3.1.2 → lash-1.3.2}/lash.egg-info/top_level.txt +0 -0
  201. {lash-1.3.1.2 → lash-1.3.2}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lash
3
- Version: 1.3.1.2
3
+ Version: 1.3.2
4
4
  Summary: CLI tools package to desktop
5
5
  Author-email: Kevin Pontes <kevboyz@pm.me>
6
6
  License: GNU GENERAL PUBLIC LICENSE
@@ -680,35 +680,44 @@ License: GNU GENERAL PUBLIC LICENSE
680
680
 
681
681
  Project-URL: Homepage, https://github.com/KevBoyz/Lash
682
682
  Project-URL: Documentation, https://kevboyz.github.io/KevBoyz-Docs/sub-pages/documentations/lash/index.html
683
- Keywords: toolkit,keylogger,auto-clicker,zip,organize,files,file-handler,os,random,schedule,spy,crypt,encrypt,system,utility,images,cli,utilities,wikipedia,youtube,download,music,email,github
683
+ Keywords: toolkit,keylogger,auto-clicker,zip,organize,files,file-handler,os,random,schedule,spy,crypt,encrypt,system,utility,images,cli,utilities,wikipedia,youtube,music,email,github,audio,video,screen-recorder,macro,automation,device,monitor,calculator,productivity,news,rss,web-scraping,crawler,remote,tasks,calendar,multimedia,security,hacking,share
684
684
  Classifier: Development Status :: 5 - Production/Stable
685
- Classifier: Programming Language :: Python :: 3.11
685
+ Classifier: Programming Language :: Python :: 3.12
686
+ Classifier: Programming Language :: Python :: 3.13
686
687
  Classifier: Intended Audience :: End Users/Desktop
687
688
  Classifier: Natural Language :: English
688
689
  Classifier: Operating System :: OS Independent
689
690
  Classifier: Topic :: Desktop Environment :: File Managers
691
+ Classifier: Topic :: Internet :: WWW/HTTP
692
+ Classifier: Topic :: Multimedia :: Graphics
693
+ Classifier: Topic :: Multimedia :: Sound/Audio
694
+ Classifier: Topic :: Multimedia :: Video
695
+ Classifier: Topic :: Scientific/Engineering :: Mathematics
696
+ Classifier: Topic :: Security
690
697
  Classifier: Topic :: Software Development :: Build Tools
691
698
  Classifier: Topic :: System :: Archiving :: Compression
699
+ Classifier: Topic :: System :: Hardware
692
700
  Classifier: Topic :: System :: Monitoring
693
701
  Classifier: Topic :: Utilities
694
702
  Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
695
- Requires-Python: >=3.11
703
+ Requires-Python: >=3.12
696
704
  Description-Content-Type: text/markdown
697
705
  License-File: LICENSE
698
706
  Requires-Dist: click>=8.1.3
699
707
  Requires-Dist: rich>=12.6.0
700
708
  Provides-Extra: all
701
709
  Requires-Dist: rich>=12.6.0; extra == "all"
702
- Requires-Dist: pyminizip>=0.2.6; extra == "all"
710
+ Requires-Dist: pyzipper>=0.3.6; extra == "all"
703
711
  Requires-Dist: Pillow>=9.3.0; extra == "all"
704
712
  Requires-Dist: tqdm>=4.64.1; extra == "all"
705
713
  Requires-Dist: opencv-python>=4.6.0.66; extra == "all"
706
714
  Requires-Dist: numpy>=1.23.4; extra == "all"
707
715
  Requires-Dist: mss>=7.0.1; extra == "all"
708
- Requires-Dist: moviepy>=1.0.3; extra == "all"
716
+ Requires-Dist: moviepy>=2.0.0; extra == "all"
717
+ Requires-Dist: imageio-ffmpeg>=0.6.0; extra == "all"
709
718
  Requires-Dist: pyautogui>=0.9.53; extra == "all"
710
719
  Requires-Dist: keyboard>=0.13.5; extra == "all"
711
- Requires-Dist: bs4>=0.0.1; extra == "all"
720
+ Requires-Dist: beautifulsoup4>=4.11.1; extra == "all"
712
721
  Requires-Dist: requests>=2.28.0; extra == "all"
713
722
  Requires-Dist: wikipedia>=1.4.0; extra == "all"
714
723
  Requires-Dist: yt-dlp>=2024.1.0; extra == "all"
@@ -718,8 +727,10 @@ Requires-Dist: pynput>=1.7.6; extra == "all"
718
727
  Requires-Dist: matplotlib>=3.6.1; extra == "all"
719
728
  Requires-Dist: PyQt5>=5.15.0; extra == "all"
720
729
  Requires-Dist: psutil>=5.9.3; extra == "all"
721
- Requires-Dist: dashing>=0.1.0; extra == "all"
730
+ Requires-Dist: dashing>=0.2.0; extra == "all"
722
731
  Requires-Dist: plyer>=2.1.0; extra == "all"
732
+ Requires-Dist: textual>=0.80.0; extra == "all"
733
+ Requires-Dist: qrcode>=7.4; extra == "all"
723
734
  Dynamic: license-file
724
735
 
725
736
  # Lash, the py-package ![](Images/desktop.png)![](Images/lash_gif.gif)
@@ -6,8 +6,11 @@ import click
6
6
 
7
7
  import lash.plugins as plugin_registry
8
8
  from lash.core.lazy_group import LazyGroup
9
+ from lash.core.net import install_default_timeout
9
10
  from lash.core.plugin_manager import plugin
10
11
 
12
+ install_default_timeout()
13
+
11
14
  try:
12
15
  __version__ = importlib.metadata.version("lash")
13
16
  except importlib.metadata.PackageNotFoundError:
@@ -16,7 +19,7 @@ except importlib.metadata.PackageNotFoundError:
16
19
 
17
20
 
18
21
  @click.group(
19
- name='lash',
22
+ name="lash",
20
23
  cls=LazyGroup,
21
24
  lazy_subcommands=plugin_registry.get_lazy_commands(),
22
25
  help=f"\b\n - Lash {__version__} by KevBoyz ~ https://github.com/KevBoyz/Lash\n",
@@ -34,9 +34,13 @@ class LazyGroup(click.Group):
34
34
 
35
35
  def _broken_cb():
36
36
  click.echo(
37
- f"Error: Command '{cmd_name}' requires missing dependency: {missing_name}.\n"
38
- f"Run 'lash plugin fix' to automatically install required packages.",
39
- err=True
37
+ (
38
+ f"Error: Command '{cmd_name}' requires missing "
39
+ f"dependency: {missing_name}.\n"
40
+ "Run 'lash plugin fix' to automatically install "
41
+ "required packages."
42
+ ),
43
+ err=True,
40
44
  )
41
45
  return click.Command(cmd_name, callback=_broken_cb)
42
46
  return super().get_command(ctx, cmd_name)
@@ -50,7 +54,12 @@ class LazyGroup(click.Group):
50
54
  cmd = super().get_command(ctx, cmd_name)
51
55
  if cmd is None or cmd.hidden:
52
56
  continue
53
- rows.append((cmd_name, cmd.get_short_help_str(limit=formatter.width)))
57
+ rows.append(
58
+ (
59
+ cmd_name,
60
+ cmd.get_short_help_str(limit=formatter.width),
61
+ )
62
+ )
54
63
  if rows:
55
64
  with formatter.section('Commands'):
56
65
  formatter.write_dl(rows)
@@ -0,0 +1,7 @@
1
+ import socket
2
+
3
+ REQUEST_TIMEOUT = 60
4
+
5
+
6
+ def install_default_timeout():
7
+ socket.setdefaulttimeout(REQUEST_TIMEOUT)
@@ -0,0 +1,480 @@
1
+ import re
2
+ import shutil
3
+ import subprocess
4
+ import sys
5
+ from collections import defaultdict
6
+ import click
7
+ from rich.console import Console
8
+ from lash import plugins as plugin_registry
9
+
10
+ _console = Console()
11
+
12
+
13
+ def _package_name(requirement):
14
+ return re.split(r"[><=!]", requirement)[0].strip()
15
+
16
+
17
+ def _detect_installer(requires):
18
+ probe = subprocess.run(
19
+ [sys.executable, "-m", "pip", "--version"],
20
+ capture_output=True,
21
+ text=True,
22
+ )
23
+ if probe.returncode == 0:
24
+ return "pip"
25
+ if shutil.which("uv"):
26
+ return "uv"
27
+ raise RuntimeError(
28
+ "No package installer found: 'pip' module missing and "
29
+ "'uv' not in PATH.\n"
30
+ "Install these dependencies manually with any Python package tool:\n"
31
+ f" pip install {' '.join(requires)}"
32
+ )
33
+
34
+
35
+ def _install_cmd(requires, installer):
36
+ if installer == "uv":
37
+ return (
38
+ ["uv", "pip", "install", "--python", sys.executable] + requires
39
+ )
40
+ return [sys.executable, "-m", "pip", "install"] + requires
41
+
42
+
43
+ def _uninstall_cmd(pkg_names, installer):
44
+ if installer == "uv":
45
+ return [
46
+ "uv",
47
+ "pip",
48
+ "uninstall",
49
+ "--python",
50
+ sys.executable] + pkg_names
51
+ return [sys.executable, "-m", "pip", "uninstall", "-y"] + pkg_names
52
+
53
+
54
+ def make_download_command(*, plugins_dir=None, state_file=None): # noqa: C901
55
+ @click.command("add")
56
+ @click.argument("plugins", nargs=-1, required=False)
57
+ @click.option("-a", "--all", "install_all", is_flag=True,
58
+ help="Install all missing plugins")
59
+ def add(plugins, install_all):
60
+ """Add one or more plugins."""
61
+ available = plugin_registry.get_available_plugins(
62
+ plugins_dir=plugins_dir)
63
+
64
+ if install_all:
65
+ plugins = list(available.keys())
66
+ elif not plugins:
67
+ raise click.UsageError(
68
+ "Missing argument 'PLUGIN' or use -a to install all."
69
+ )
70
+
71
+ for plugin_name in plugins:
72
+ if plugin_name not in available:
73
+ click.echo(f"Unknown plugin: {plugin_name}")
74
+ click.echo(f"Available: {', '.join(sorted(available.keys()))}")
75
+ raise SystemExit(1)
76
+
77
+ installed_count = 0
78
+ for plugin_name in plugins:
79
+ try:
80
+ _install_plugin(plugin_name, available, state_file)
81
+ installed_count += 1
82
+ except Exception as e:
83
+ click.echo(f"Failed to install {plugin_name}: {e}")
84
+
85
+ if installed_count:
86
+ click.echo("Done. Try: lash <command> --help")
87
+ else:
88
+ click.echo("No plugins were installed.")
89
+
90
+ return add
91
+
92
+
93
+ def _install_plugin(plugin_name, available, state_file): # noqa: C901
94
+ already_installed = set(
95
+ plugin_registry._load_state(state_file).get(
96
+ "installed_commands", {}).keys())
97
+ commands_to_install = {
98
+ cmd_name: cmd_info
99
+ for cmd_name, cmd_info in available[plugin_name]["commands"].items()
100
+ if cmd_name not in already_installed
101
+ }
102
+ if not commands_to_install:
103
+ click.echo(f"Plugin '{plugin_name}' already installed.")
104
+ return
105
+
106
+ requires = list(
107
+ {
108
+ req
109
+ for cmd_info in commands_to_install.values()
110
+ for req in cmd_info.get("requires", [])
111
+ }
112
+ )
113
+
114
+ if requires:
115
+ installer = _detect_installer(requires)
116
+ with _console.status(
117
+ (
118
+ f"Installing dependencies for {plugin_name}: "
119
+ f"{', '.join(requires)}"
120
+ ),
121
+ spinner="dots",
122
+ ):
123
+ result = subprocess.run(
124
+ _install_cmd(requires, installer),
125
+ capture_output=True,
126
+ text=True,
127
+ )
128
+ if result.returncode != 0:
129
+ raise RuntimeError(
130
+ f"Dependency install failed:\n{result.stderr}"
131
+ )
132
+
133
+ for cmd_name, cmd_info in commands_to_install.items():
134
+ plugin_registry.mark_command_installed(
135
+ cmd_name,
136
+ plugin_name,
137
+ cmd_info.get("requires", []),
138
+ state_file=state_file,
139
+ )
140
+ click.echo(f"Installed: {plugin_name}")
141
+
142
+
143
+ download = make_download_command()
144
+
145
+
146
+ def _list_installed_plugins(available, state_file):
147
+ state = plugin_registry._load_state(state_file)
148
+ installed_cmds = state.get("installed_commands", {})
149
+ removed_cmds = set(state.get("removed_commands", []))
150
+ installed = []
151
+ for name, manifest in available.items():
152
+ is_core = manifest.get("core", False)
153
+ if is_core:
154
+ any_installed = any(
155
+ cmd not in removed_cmds for cmd in manifest["commands"])
156
+ if any_installed:
157
+ installed.append(name)
158
+ else:
159
+ any_installed = any(
160
+ cmd in installed_cmds for cmd in manifest["commands"])
161
+ if any_installed:
162
+ installed.append(name)
163
+ if installed:
164
+ click.echo(f"Installed: {', '.join(sorted(installed))}")
165
+ else:
166
+ click.echo("No plugins installed.")
167
+
168
+
169
+ def make_remove_command(*, plugins_dir=None, state_file=None):
170
+ @click.command("remove")
171
+ @click.argument("plugins", nargs=-1, required=False)
172
+ @click.option("-a", "--all", "remove_all", is_flag=True,
173
+ help="Remove all installed plugins")
174
+ def remove(plugins, remove_all):
175
+ """Remove one or more plugins."""
176
+ available = plugin_registry.get_available_plugins(
177
+ plugins_dir=plugins_dir)
178
+
179
+ if remove_all:
180
+ plugins = list(available.keys())
181
+ elif not plugins:
182
+ raise click.UsageError(
183
+ "Missing argument 'PLUGIN' or use -a to remove all.")
184
+
185
+ commands_to_remove = _collect_remove_commands(
186
+ available, plugins, state_file)
187
+
188
+ if not commands_to_remove:
189
+ click.echo("Nothing to remove — no commands are installed.")
190
+ return
191
+
192
+ _execute_remove(commands_to_remove, state_file, plugins_dir)
193
+ click.echo("Done.")
194
+
195
+ return remove
196
+
197
+
198
+ def _collect_remove_commands(available, plugins, state_file):
199
+ state = plugin_registry._load_state(state_file)
200
+ installed_cmds = state.get("installed_commands", {})
201
+ removed_cmds = set(state.get("removed_commands", []))
202
+ commands_to_remove = set()
203
+ for plugin_name in plugins:
204
+ if plugin_name not in available:
205
+ click.echo(f"Unknown plugin: {plugin_name}")
206
+ _list_installed_plugins(available, state_file)
207
+ raise SystemExit(1)
208
+ manifest = available[plugin_name]
209
+ if manifest.get("core", False):
210
+ plugin_installed = {
211
+ c for c in manifest["commands"].keys() if c not in removed_cmds
212
+ }
213
+ else:
214
+ plugin_installed = {
215
+ k for k, v in installed_cmds.items() if v["plugin"] == plugin_name}
216
+ commands_to_remove.update(plugin_installed)
217
+ return commands_to_remove
218
+
219
+
220
+ def _execute_remove(commands_to_remove, state_file, plugins_dir):
221
+ all_orphaned = set()
222
+ for cmd_name in commands_to_remove:
223
+ orphaned = plugin_registry.remove_command(
224
+ cmd_name, state_file=state_file, plugins_dir=plugins_dir
225
+ )
226
+ all_orphaned.update(orphaned)
227
+ click.echo(f" - {cmd_name}")
228
+ if all_orphaned:
229
+ pkg_names = [_package_name(r) for r in all_orphaned]
230
+ click.echo(
231
+ f"Uninstalling orphaned dependencies: {
232
+ ', '.join(pkg_names)}")
233
+ installer = _detect_installer(pkg_names)
234
+ result = subprocess.run(
235
+ _uninstall_cmd(pkg_names, installer),
236
+ capture_output=True,
237
+ text=True,
238
+ )
239
+ if result.returncode != 0:
240
+ click.echo(
241
+ f"Warning: dependency uninstall failed:\n{
242
+ result.stderr}")
243
+
244
+
245
+ remove = make_remove_command()
246
+
247
+
248
+ def _render_category_panel(category, commands, active_cmds, width=None):
249
+ from rich.box import SQUARE
250
+ from rich.console import Group
251
+ from rich.panel import Panel
252
+ from rich.text import Text
253
+
254
+ active_count = sum(1 for c in commands if c in active_cmds)
255
+ total = len(commands)
256
+ if active_count == total:
257
+ panel_color = "green"
258
+ elif active_count == 0:
259
+ panel_color = "red"
260
+ else:
261
+ panel_color = "hot_pink"
262
+
263
+ lines = []
264
+ for cmd_name, cmd_info in commands.items():
265
+ marker = "+" if cmd_name in active_cmds else "-"
266
+ status_color = "green" if cmd_name in active_cmds else "red"
267
+ line = Text()
268
+ line.append(f"{marker} {cmd_name}: ", style=status_color)
269
+ line.append(cmd_info["description"], style="white")
270
+ lines.append(line)
271
+ return Panel(
272
+ Group(*lines),
273
+ title=Text(category.title(), style=panel_color),
274
+ title_align="left",
275
+ border_style=panel_color,
276
+ box=SQUARE,
277
+ width=width,
278
+ )
279
+
280
+
281
+ def _layout_panels(panels, per_row=2):
282
+ from rich.columns import Columns
283
+ from rich.text import Text
284
+
285
+ for i in range(0, len(panels), per_row):
286
+ row = panels[i: i + per_row]
287
+ heights = [len(panel.renderable.renderables) for panel in row]
288
+ max_height = max(heights)
289
+ for panel, height in zip(row, heights):
290
+ for _ in range(max_height - height):
291
+ panel.renderable.renderables.append(Text(""))
292
+ _console.print(Columns(row, equal=True, expand=True))
293
+
294
+
295
+ def make_plugin_list_command( # noqa: C901
296
+ *, plugins_dir=None, state_file=None
297
+ ):
298
+ @click.command("list")
299
+ @click.option(
300
+ "--installed", "-i", is_flag=True, help="Show only installed plugins."
301
+ )
302
+ @click.option(
303
+ "--not-installed",
304
+ "-ni",
305
+ "not_installed",
306
+ is_flag=True,
307
+ help="Show only uninstalled plugins.",
308
+ )
309
+ def plugin_list(installed, not_installed):
310
+ """List plugins and their install status."""
311
+ available = plugin_registry.get_available_plugins(
312
+ plugins_dir=plugins_dir)
313
+ active_cmds = set(
314
+ plugin_registry.get_lazy_commands(
315
+ plugins_dir=plugins_dir, state_file=state_file
316
+ ).keys()
317
+ )
318
+
319
+ by_category = defaultdict(list)
320
+ for plugin_name, manifest in available.items():
321
+ category = manifest.get("category", plugin_name)
322
+ by_category[category].append(manifest)
323
+
324
+ found_any = False
325
+ panels = []
326
+ for category in sorted(by_category.keys()):
327
+ cat_cmds = {}
328
+ for manifest in by_category[category]:
329
+ cat_cmds.update(manifest["commands"])
330
+
331
+ active_count = sum(1 for c in cat_cmds if c in active_cmds)
332
+ is_any_active = active_count > 0
333
+ is_not_installed = active_count == 0
334
+
335
+ if installed and not is_any_active:
336
+ continue
337
+ if not_installed and not is_not_installed:
338
+ continue
339
+
340
+ found_any = True
341
+ panel_width = max(30, _console.width // 2 - 2)
342
+ panels.append(
343
+ _render_category_panel(
344
+ category,
345
+ cat_cmds,
346
+ active_cmds,
347
+ panel_width))
348
+
349
+ if panels:
350
+ _layout_panels(panels)
351
+
352
+ if not found_any:
353
+ if installed:
354
+ _console.print("No plugins installed.")
355
+ _console.print("Run 'lash plugin add <plugin>' to install.")
356
+ elif not_installed:
357
+ _console.print("All available plugins are installed.")
358
+
359
+ return plugin_list
360
+
361
+
362
+ make_plugins_command = make_plugin_list_command
363
+
364
+
365
+ def _collect_active_requires(available, installed_cmds, removed_cmds):
366
+ active_requires = set()
367
+ for manifest in available.values():
368
+ is_core = manifest.get("core", False)
369
+ for cmd_name, cmd_info in manifest["commands"].items():
370
+ if cmd_name in removed_cmds:
371
+ continue
372
+ if is_core or cmd_name in installed_cmds:
373
+ active_requires.update(cmd_info.get("requires", []))
374
+ return active_requires
375
+
376
+
377
+ def _sync_installed_requires(available, installed_cmds, state_file):
378
+ for manifest in available.values():
379
+ for cmd_name, cmd_info in manifest["commands"].items():
380
+ if cmd_name not in installed_cmds:
381
+ continue
382
+ plugin_registry.mark_command_installed(
383
+ cmd_name,
384
+ manifest["name"],
385
+ cmd_info.get("requires", []),
386
+ state_file=state_file,
387
+ )
388
+
389
+
390
+ def make_fix_command(*, plugins_dir=None, state_file=None):
391
+ @click.command("fix")
392
+ def fix():
393
+ """Fix missing dependencies for installed plugins."""
394
+ state = plugin_registry._load_state(state_file)
395
+ installed_cmds = set(state.get("installed_commands", {}).keys())
396
+ removed_cmds = set(state.get("removed_commands", []))
397
+ available = plugin_registry.get_available_plugins(
398
+ plugins_dir=plugins_dir)
399
+
400
+ active_requires = _collect_active_requires(
401
+ available, installed_cmds, removed_cmds
402
+ )
403
+
404
+ if not active_requires:
405
+ click.echo("No dependencies to install.")
406
+ if not installed_cmds:
407
+ click.echo("Run 'lash plugin add <plugin>' first.")
408
+ return
409
+
410
+ click.echo(
411
+ "Checking dependencies: "
412
+ f"{', '.join(sorted(active_requires))}"
413
+ )
414
+
415
+ requires = list(active_requires)
416
+ installer = _detect_installer(requires)
417
+ with _console.status("Installing missing dependencies...", spinner="dots"):
418
+ result = subprocess.run(
419
+ _install_cmd(requires, installer),
420
+ capture_output=True,
421
+ text=True,
422
+ )
423
+
424
+ if result.returncode != 0:
425
+ _console.print(
426
+ f"[red]Dependency install failed:[/red]\n{result.stderr}")
427
+ raise SystemExit(1)
428
+
429
+ _sync_installed_requires(available, installed_cmds, state_file)
430
+
431
+ click.echo("Done. All plugin dependencies are now installed.")
432
+
433
+ return fix
434
+
435
+
436
+ fix = make_fix_command()
437
+
438
+
439
+ class _PluginGroup(click.Group):
440
+ """click.Group com aliases ocultos no help.
441
+
442
+ install -> add, uninstall -> remove.
443
+ """
444
+
445
+ _aliases = {"install": "add", "uninstall": "remove"}
446
+
447
+ def get_command(self, ctx, cmd_name):
448
+ return super().get_command(ctx, self._aliases.get(cmd_name, cmd_name))
449
+
450
+
451
+ def _annotate_aliases(group):
452
+ for alias, name in group._aliases.items():
453
+ cmd = group.commands.get(name)
454
+ if cmd is None:
455
+ continue
456
+ base = cmd.help or ""
457
+ cmd.help = f"{base}\n\nAlias: {alias}"
458
+
459
+
460
+ def make_plugin_group(*, plugins_dir=None, state_file=None):
461
+ @click.group("plugin", cls=_PluginGroup)
462
+ def plugin_group():
463
+ """Manage lash plugins: add, remove, list, fix."""
464
+
465
+ plugin_group.add_command(
466
+ make_download_command(plugins_dir=plugins_dir, state_file=state_file)
467
+ )
468
+ plugin_group.add_command(
469
+ make_remove_command(plugins_dir=plugins_dir, state_file=state_file)
470
+ )
471
+ plugin_group.add_command(
472
+ make_plugin_list_command(
473
+ plugins_dir=plugins_dir,
474
+ state_file=state_file))
475
+ plugin_group.add_command(fix)
476
+ _annotate_aliases(plugin_group)
477
+ return plugin_group
478
+
479
+
480
+ plugin = make_plugin_group()