old htb folders
This commit is contained in:
2023-08-29 21:53:22 +02:00
parent 62ab804867
commit 82b0759f1e
21891 changed files with 6277643 additions and 0 deletions

View File

@@ -0,0 +1,250 @@
Metadata-Version: 2.1
Name: plumbum
Version: 1.8.1
Summary: Plumbum: shell combinators library
License: Copyright (c) 2013 Tomer Filiba (tomerfiliba@gmail.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
License-File: LICENSE
Keywords: cli,color,execution,local,path,pipe,popen,process,remote,shell,ssh
Classifier: Development Status :: 5 - Production/Stable
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Software Development :: Build Tools
Classifier: Topic :: System :: Systems Administration
Requires-Python: >=3.6
Requires-Dist: pywin32; platform_system == 'Windows' and platform_python_implementation != 'PyPy'
Provides-Extra: dev
Requires-Dist: paramiko; extra == 'dev'
Requires-Dist: psutil; extra == 'dev'
Requires-Dist: pytest-cov; extra == 'dev'
Requires-Dist: pytest-mock; extra == 'dev'
Requires-Dist: pytest-timeout; extra == 'dev'
Requires-Dist: pytest>=6.0; extra == 'dev'
Provides-Extra: docs
Requires-Dist: sphinx-rtd-theme>=1.0.0; extra == 'docs'
Requires-Dist: sphinx>=4.0.0; extra == 'docs'
Provides-Extra: ssh
Requires-Dist: paramiko; extra == 'ssh'
Description-Content-Type: text/x-rst
.. image:: https://readthedocs.org/projects/plumbum/badge/
:target: https://plumbum.readthedocs.io/en/latest/
:alt: Documentation Status
.. image:: https://github.com/tomerfiliba/plumbum/workflows/CI/badge.svg
:target: https://github.com/tomerfiliba/plumbum/actions
:alt: Build Status
.. image:: https://coveralls.io/repos/tomerfiliba/plumbum/badge.svg?branch=master&service=github
:target: https://coveralls.io/github/tomerfiliba/plumbum?branch=master
:alt: Coverage Status
.. image:: https://img.shields.io/pypi/v/plumbum.svg
:target: https://pypi.python.org/pypi/plumbum/
:alt: PyPI Status
.. image:: https://img.shields.io/pypi/pyversions/plumbum.svg
:target: https://pypi.python.org/pypi/plumbum/
:alt: PyPI Versions
.. image:: https://img.shields.io/conda/vn/conda-forge/plumbum.svg
:target: https://github.com/conda-forge/plumbum-feedstock
:alt: Conda-Forge Badge
.. image:: https://img.shields.io/pypi/l/plumbum.svg
:target: https://pypi.python.org/pypi/plumbum/
:alt: PyPI License
.. image:: https://badges.gitter.im/plumbumpy/Lobby.svg
:alt: Join the chat at https://gitter.im/plumbumpy/Lobby
:target: https://gitter.im/plumbumpy/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
:alt: Code styled with Black
:target: https://github.com/psf/black
Plumbum: Shell Combinators
==========================
Ever wished the compactness of shell scripts be put into a **real** programming language?
Say hello to *Plumbum Shell Combinators*. Plumbum (Latin for *lead*, which was used to create
pipes back in the day) is a small yet feature-rich library for shell script-like programs in Python.
The motto of the library is **"Never write shell scripts again"**, and thus it attempts to mimic
the **shell syntax** ("shell combinators") where it makes sense, while keeping it all **Pythonic
and cross-platform**.
Apart from shell-like syntax and handy shortcuts, the library provides local and remote command
execution (over SSH), local and remote file-system paths, easy working-directory and environment
manipulation, and a programmatic Command-Line Interface (CLI) application toolkit.
Now let's see some code!
*This is only a teaser; the full documentation can be found at*
`Read the Docs <https://plumbum.readthedocs.io>`_
Cheat Sheet
-----------
Basics
******
.. code-block:: python
>>> from plumbum import local
>>> local.cmd.ls
LocalCommand(/bin/ls)
>>> local.cmd.ls()
'build.py\nCHANGELOG.rst\nconda.recipe\nCONTRIBUTING.rst\ndocs\nexamples\nexperiments\nLICENSE\nMANIFEST.in\nPipfile\nplumbum\nplumbum.egg-info\npytest.ini\nREADME.rst\nsetup.cfg\nsetup.py\ntests\ntranslations.py\n'
>>> notepad = local["c:\\windows\\notepad.exe"]
>>> notepad() # Notepad window pops up
'' # Notepad window is closed by user, command returns
In the example above, you can use ``local["ls"]`` if you have an unusually named executable or a full path to an executable. The ``local`` object represents your local machine. As you'll see, Plumbum also provides remote machines that use the same API!
You can also use ``from plumbum.cmd import ls`` as well for accessing programs in the ``PATH``.
Piping
******
.. code-block:: python
>>> from plumbum.cmd import ls, grep, wc
>>> chain = ls["-a"] | grep["-v", r"\.py"] | wc["-l"]
>>> print(chain)
/bin/ls -a | /bin/grep -v '\.py' | /usr/bin/wc -l
>>> chain()
'27\n'
Redirection
***********
.. code-block:: python
>>> from plumbum.cmd import cat, head
>>> ((cat < "setup.py") | head["-n", 4])()
'#!/usr/bin/env python3\nimport os\n\ntry:\n'
>>> (ls["-a"] > "file.list")()
''
>>> (cat["file.list"] | wc["-l"])()
'31\n'
Working-directory manipulation
******************************
.. code-block:: python
>>> local.cwd
<LocalWorkdir /home/tomer/workspace/plumbum>
>>> with local.cwd(local.cwd / "docs"):
... chain()
...
'22\n'
Foreground and background execution
***********************************
.. code-block:: python
>>> from plumbum import FG, BG
>>> (ls["-a"] | grep[r"\.py"]) & FG # The output is printed to stdout directly
build.py
setup.py
translations.py
>>> (ls["-a"] | grep[r"\.py"]) & BG # The process runs "in the background"
<Future ['/bin/grep', '\\.py'] (running)>
Command nesting
***************
.. code-block:: python
>>> from plumbum.cmd import sudo, ifconfig
>>> print(sudo[ifconfig["-a"]])
/usr/bin/sudo /sbin/ifconfig -a
>>> (sudo[ifconfig["-a"]] | grep["-i", "loop"]) & FG
lo Link encap:Local Loopback
UP LOOPBACK RUNNING MTU:16436 Metric:1
Remote commands (over SSH)
**************************
Supports `openSSH <http://www.openssh.org/>`_-compatible clients,
`PuTTY <http://www.chiark.greenend.org.uk/~sgtatham/putty/>`_ (on Windows)
and `Paramiko <https://github.com/paramiko/paramiko/>`_ (a pure-Python implementation of SSH2)
.. code-block:: python
>>> from plumbum import SshMachine
>>> remote = SshMachine("somehost", user = "john", keyfile = "/path/to/idrsa")
>>> r_ls = remote["ls"]
>>> with remote.cwd("/lib"):
... (r_ls | grep["0.so.0"])()
...
'libusb-1.0.so.0\nlibusb-1.0.so.0.0.0\n'
CLI applications
****************
.. code-block:: python
import logging
from plumbum import cli
class MyCompiler(cli.Application):
verbose = cli.Flag(["-v", "--verbose"], help = "Enable verbose mode")
include_dirs = cli.SwitchAttr("-I", list = True, help = "Specify include directories")
@cli.switch("--loglevel", int)
def set_log_level(self, level):
"""Sets the log-level of the logger"""
logging.root.setLevel(level)
def main(self, *srcfiles):
print("Verbose:", self.verbose)
print("Include dirs:", self.include_dirs)
print("Compiling:", srcfiles)
if __name__ == "__main__":
MyCompiler.run()
Sample output
+++++++++++++
::
$ python3 simple_cli.py -v -I foo/bar -Ispam/eggs x.cpp y.cpp z.cpp
Verbose: True
Include dirs: ['foo/bar', 'spam/eggs']
Compiling: ('x.cpp', 'y.cpp', 'z.cpp')
Colors and Styles
-----------------
.. code-block:: python
from plumbum import colors
with colors.red:
print("This library provides safe, flexible color access.")
print(colors.bold | "(and styles in general)", "are easy!")
print("The simple 16 colors or",
colors.orchid & colors.underline | '256 named colors,',
colors.rgb(18, 146, 64) | "or full rgb colors",
'can be used.')
print("Unsafe " + colors.bg.dark_khaki + "color access" + colors.bg.reset + " is available too.")

View File

@@ -0,0 +1,101 @@
plumbum-1.8.1.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
plumbum-1.8.1.dist-info/METADATA,sha256=5yI4GuF90fRsVaW7x_8lEkpGefgvQrjayZsk7IHEfxw,9676
plumbum-1.8.1.dist-info/RECORD,,
plumbum-1.8.1.dist-info/WHEEL,sha256=uowK1IU2Mr84Y-Zer0AkNPWpF6NqJUMrUTigrBnI0N8,87
plumbum-1.8.1.dist-info/licenses/LICENSE,sha256=Xf7FmKabEomzZ58j0sOuU40oLzY2WKkvcYHpme-iKMM,1080
plumbum/__init__.py,sha256=4tE4kJWBGYUNIV-dIvBkrD5WvBoWNxBS9ch5b1X1szE,3255
plumbum/__pycache__/__init__.cpython-310.pyc,,
plumbum/__pycache__/_testtools.cpython-310.pyc,,
plumbum/__pycache__/cmd.cpython-310.pyc,,
plumbum/__pycache__/colors.cpython-310.pyc,,
plumbum/__pycache__/lib.cpython-310.pyc,,
plumbum/__pycache__/typed_env.cpython-310.pyc,,
plumbum/__pycache__/version.cpython-310.pyc,,
plumbum/_testtools.py,sha256=ezPLEsAyrolXBf0Yyw5SLLTxIsFxX1Ru8pVtrDiMAhs,651
plumbum/cli/__init__.py,sha256=UYL6FOoFSDiETf8g6TabcrBVbG3Gp0rqo1U4Mh_RRMU,606
plumbum/cli/__pycache__/__init__.cpython-310.pyc,,
plumbum/cli/__pycache__/application.cpython-310.pyc,,
plumbum/cli/__pycache__/config.cpython-310.pyc,,
plumbum/cli/__pycache__/i18n.cpython-310.pyc,,
plumbum/cli/__pycache__/image.cpython-310.pyc,,
plumbum/cli/__pycache__/progress.cpython-310.pyc,,
plumbum/cli/__pycache__/switches.cpython-310.pyc,,
plumbum/cli/__pycache__/terminal.cpython-310.pyc,,
plumbum/cli/__pycache__/termsize.cpython-310.pyc,,
plumbum/cli/application.py,sha256=o0fh2aKlEi0blD9Qx3w8pAYtB8wZqIYzXSVijV5bKCM,38056
plumbum/cli/config.py,sha256=Soie_VJ1s9rknXji1G9jWShBxhpiusSJTJH1YNguFIs,3200
plumbum/cli/i18n.py,sha256=_RlrW7kNTiQwzaMUmGsfp7Ln2dk0npybZeWcSKBh25E,1666
plumbum/cli/i18n/de.po,sha256=WulYQveWzsUJBnd15hoQ5lqqrQ8DOKZNfox74QLTfzY,6754
plumbum/cli/i18n/de/LC_MESSAGES/plumbum.cli.mo,sha256=2OkN6oW1F4Ksg9i3DKPZrlRdKO4RKedbSpsnxOq7pgE,3553
plumbum/cli/i18n/fr.po,sha256=PoOpb0IcGFK5BkNovrcVvyykkQ08oN1m1DzUiDboqyA,6734
plumbum/cli/i18n/fr/LC_MESSAGES/plumbum.cli.mo,sha256=JoOoEfDg4_Q6zfpGhAHbcbcPMgsZdIXEIsgTmy1ROQc,3514
plumbum/cli/i18n/nl.po,sha256=isPe1KZqGrdCNm95BJsQvVZgPICHTQiVgKBYFI5KAWY,6727
plumbum/cli/i18n/nl/LC_MESSAGES/plumbum.cli.mo,sha256=hRxdGDzf_1SxB0KcAq1ruPNZDYTkzDBtin0kgvmrAc8,3510
plumbum/cli/i18n/ru.po,sha256=hz5Kb6etms8uwQM_jMuweqFtEiurgneB0wbzxTp1rJo,8070
plumbum/cli/i18n/ru/LC_MESSAGES/plumbum.cli.mo,sha256=r2GHlN1gJXTI9RFCEBDSin8THy2vcAhul7Bg6LTEvCI,4836
plumbum/cli/image.py,sha256=YqETTJ4v1OqAG-VsjYNdX5Px3e72RPwdHpmd02-jMwo,3397
plumbum/cli/progress.py,sha256=Ei_61MvhIQMLFh9LCSF3N2w8Aj8WgMT7yVxjrL8L47k,8374
plumbum/cli/switches.py,sha256=pWoKxQ4xJi52QP0m56pLsHCqvAj9iWVzGAcvt3avK-U,21071
plumbum/cli/terminal.py,sha256=dZfA2ZSgQmYFHyAsb3sk-QmJS4qjPAsjeffQXEiw2Mw,7277
plumbum/cli/termsize.py,sha256=bWjbA5zQXMIOzn1HefIJJX6u0B79hXSCsuc-yFj0Qmc,3095
plumbum/cmd.py,sha256=DFJiL7KNm4vhnbRdrrCD3l16a6IJ1TmRNKq2xCv3xcM,292
plumbum/colorlib/__init__.py,sha256=gibK9PbGdOlKgd0mf6yxe9VSmXaewA5kqS-wx03QMp0,1211
plumbum/colorlib/__main__.py,sha256=CVgnPvmCuqacFWXbE7cVKiw-xjTLwLhlp9k83inLEco,165
plumbum/colorlib/__pycache__/__init__.cpython-310.pyc,,
plumbum/colorlib/__pycache__/__main__.cpython-310.pyc,,
plumbum/colorlib/__pycache__/_ipython_ext.cpython-310.pyc,,
plumbum/colorlib/__pycache__/factories.cpython-310.pyc,,
plumbum/colorlib/__pycache__/names.cpython-310.pyc,,
plumbum/colorlib/__pycache__/styles.cpython-310.pyc,,
plumbum/colorlib/_ipython_ext.py,sha256=Y2RiBYW_LP8dvW98lnwIf_zAjwoGTkLmgtfPw4BIou8,979
plumbum/colorlib/factories.py,sha256=8fW7oUaACJ50lLDKx9GJ_6j8bUUcdP2l6ghSSEX7HgI,6927
plumbum/colorlib/names.py,sha256=BEEZ1_GNZoGnEr86eOSpFUfPrnAmu1HEzN-GkNojJ8I,8229
plumbum/colorlib/styles.py,sha256=TY5EDPpgY3s7nNk2TDECG9DrlBPA3rIbxiwpHKWvZ90,25049
plumbum/colors.py,sha256=zecWZrAMOZX6pfO181RYY1zaXokfEuO0ei-135MT5lA,567
plumbum/commands/__init__.py,sha256=4JD0qk9qS8Aq5LzuycQ4naqISWCtvqoWWiGXB7Xgwsc,773
plumbum/commands/__pycache__/__init__.cpython-310.pyc,,
plumbum/commands/__pycache__/base.cpython-310.pyc,,
plumbum/commands/__pycache__/daemons.cpython-310.pyc,,
plumbum/commands/__pycache__/modifiers.cpython-310.pyc,,
plumbum/commands/__pycache__/processes.cpython-310.pyc,,
plumbum/commands/base.py,sha256=OYBCBzG16tQh1bJ2MAAqljXJJifWcNFYMSCnevpAOAo,19591
plumbum/commands/daemons.py,sha256=rtNs5n53G3aJqv6X1rZ_yKcdzr2ruwIB2mJChtoHRaY,3543
plumbum/commands/modifiers.py,sha256=5lNhCvvnYFIo4vdkzlKmPovUcT4_n0Pm88TzAT7f46g,17023
plumbum/commands/processes.py,sha256=c675_O5i0VXrYPb0WmosHrtS-8gL2jdv3cBXR2FZ_YI,13989
plumbum/fs/__init__.py,sha256=Bpyjk_snTCVuypWNf2Na3WsktWXUtPRrbS5C3mWwtg4,39
plumbum/fs/__pycache__/__init__.cpython-310.pyc,,
plumbum/fs/__pycache__/atomic.cpython-310.pyc,,
plumbum/fs/__pycache__/mounts.cpython-310.pyc,,
plumbum/fs/atomic.py,sha256=Jen6cvMPYGIUP4xmr0gQIeTducJnk7b3VjxJq8HVE40,9545
plumbum/fs/mounts.py,sha256=scWnOidkGPmHJlBUCO1FobC_cTAusePUKmAVx1Yvpzc,1097
plumbum/lib.py,sha256=WpNkkQRZUT2NHSGA6athO28pgnmsGN7J09eNpn2D6Tc,2036
plumbum/machines/__init__.py,sha256=YTwUWsX97lhfASX3Ou-4niEj60a3VvnjjpJ-oeGPGNk,356
plumbum/machines/__pycache__/__init__.cpython-310.pyc,,
plumbum/machines/__pycache__/_windows.cpython-310.pyc,,
plumbum/machines/__pycache__/base.cpython-310.pyc,,
plumbum/machines/__pycache__/env.cpython-310.pyc,,
plumbum/machines/__pycache__/local.cpython-310.pyc,,
plumbum/machines/__pycache__/paramiko_machine.cpython-310.pyc,,
plumbum/machines/__pycache__/remote.cpython-310.pyc,,
plumbum/machines/__pycache__/session.cpython-310.pyc,,
plumbum/machines/__pycache__/ssh_machine.cpython-310.pyc,,
plumbum/machines/_windows.py,sha256=cch_ln_hHsuYG0iqsY1gbO0XkkimMX-ZjJbuEeCVyk8,757
plumbum/machines/base.py,sha256=GvNCGVaFzzinORHy0cljBoR75uSUpS10vtYmJ8Xsv_k,3415
plumbum/machines/env.py,sha256=yz1vqGSlxE1TJlmOM9MB3N9YeHJwOB5e1l0sIDFA1Ms,6345
plumbum/machines/local.py,sha256=S1Y5w5-sUCnZydc-fJMeKgTF79EqzZ8lvlgu7qHfkc0,15783
plumbum/machines/paramiko_machine.py,sha256=zRXnovbDy8ZQai5O88NVoyUKAeSrl7mAKOjHWVO7nzg,17609
plumbum/machines/remote.py,sha256=aLxOngc5vWwzm2lXHd7js7hlnD-Y8NkwSaV1HebrRdQ,15952
plumbum/machines/session.py,sha256=DD9E-wKRYJsB0fcQCsc65vOP6iD3EGRmwyTKCojoQ6A,11854
plumbum/machines/ssh_machine.py,sha256=en_3KuQC6AJSG9_xa2jLipa1lXuJIbv3-oQejUFkPkg,15168
plumbum/path/__init__.py,sha256=PBLLCtxJfoaK-t0IAOwqumxgCSWdBlNgKEz5ifOcoDw,395
plumbum/path/__pycache__/__init__.cpython-310.pyc,,
plumbum/path/__pycache__/base.cpython-310.pyc,,
plumbum/path/__pycache__/local.cpython-310.pyc,,
plumbum/path/__pycache__/remote.cpython-310.pyc,,
plumbum/path/__pycache__/utils.cpython-310.pyc,,
plumbum/path/base.py,sha256=powKEs23HyKNdMRtaCOOrgTmG446eVokoJe0vaPmvH0,16482
plumbum/path/local.py,sha256=FulradqWqDQx-sD5QybPV_vP-FlMNQ14AdIPnnkXrc4,10683
plumbum/path/remote.py,sha256=i2oCVAeBHyOc3gYW9e6b_uQRb_-BYaV9Gu_e6Zs956g,11330
plumbum/path/utils.py,sha256=--mQnfp4kRNcCZ5ZEtaMY1t4_2Hk66hy0s6a5tU9o9o,3532
plumbum/typed_env.py,sha256=AjkQ4IM9L2Ov4PegCutHg8EEcmKIkIDMypxHEvYLS9A,4953
plumbum/version.py,sha256=1PLVGwdqSOnBYJqXAjP_DrkllYMg9Q96g7dch7gafVY,160

View File

@@ -0,0 +1,4 @@
Wheel-Version: 1.0
Generator: hatchling 1.12.1
Root-Is-Purelib: true
Tag: py3-none-any

View File

@@ -0,0 +1,19 @@
Copyright (c) 2013 Tomer Filiba (tomerfiliba@gmail.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.