Mercurial > repos > shellac > sam_consensus_v3
annotate env/lib/python3.9/site-packages/shellescape-3.4.1.dist-info/METADATA @ 0:4f3585e2f14b draft default tip
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
| author | shellac | 
|---|---|
| date | Mon, 22 Mar 2021 18:12:50 +0000 | 
| parents | |
| children | 
| rev | line source | 
|---|---|
| 0 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 1 Metadata-Version: 2.0 | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 2 Name: shellescape | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 3 Version: 3.4.1 | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 4 Summary: Shell escape a string to safely use it as a token in a shell command (backport of Python shlex.quote for Python versions 2.x & < 3.3) | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 5 Home-page: https://github.com/chrissimpkins/shellescape | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 6 Author: Christopher Simpkins | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 7 Author-email: git.simpkins@gmail.com | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 8 License: MIT license | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 9 Keywords: shell,quote,escape,backport,command line,command,subprocess | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 10 Platform: any | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 11 Classifier: Development Status :: 5 - Production/Stable | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 12 Classifier: Intended Audience :: Developers | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 13 Classifier: Natural Language :: English | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 14 Classifier: License :: OSI Approved :: MIT License | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 15 Classifier: Programming Language :: Python | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 16 Classifier: Programming Language :: Python :: 2 | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 17 Classifier: Programming Language :: Python :: 3 | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 18 Classifier: Operating System :: MacOS :: MacOS X | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 19 Classifier: Operating System :: POSIX | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 20 Classifier: Operating System :: Unix | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 21 Classifier: Operating System :: Microsoft :: Windows | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 22 | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 23 Source Repository: https://github.com/chrissimpkins/shellescape | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 24 | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 25 Description | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 26 ----------- | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 27 | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 28 The shellescape Python module defines the ``shellescape.quote()`` function that returns a shell-escaped version of a Python string. This is a backport of the ``shlex.quote()`` function from Python 3.4.3 that makes it accessible to users of Python 3 versions < 3.3 and all Python 2.x versions. | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 29 | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 30 quote(s) | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 31 -------- | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 32 | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 33 >From the Python documentation: | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 34 | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 35 Return a shell-escaped version of the string s. The returned value is a string that can safely be used as one token in a shell command line, for cases where you cannot use a list. | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 36 | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 37 This idiom would be unsafe: | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 38 | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 39 .. code-block:: python | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 40 | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 41 >>> filename = 'somefile; rm -rf ~' | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 42 >>> command = 'ls -l {}'.format(filename) | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 43 >>> print(command) # executed by a shell: boom! | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 44 ls -l somefile; rm -rf ~ | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 45 | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 46 | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 47 ``quote()`` lets you plug the security hole: | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 48 | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 49 .. code-block:: python | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 50 | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 51 >>> command = 'ls -l {}'.format(quote(filename)) | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 52 >>> print(command) | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 53 ls -l 'somefile; rm -rf ~' | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 54 >>> remote_command = 'ssh home {}'.format(quote(command)) | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 55 >>> print(remote_command) | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 56 ssh home 'ls -l '"'"'somefile; rm -rf ~'"'"'' | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 57 | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 58 | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 59 The quoting is compatible with UNIX shells and with ``shlex.split()``: | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 60 | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 61 .. code-block:: python | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 62 | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 63 >>> remote_command = split(remote_command) | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 64 >>> remote_command | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 65 ['ssh', 'home', "ls -l 'somefile; rm -rf ~'"] | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 66 >>> command = split(remote_command[-1]) | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 67 >>> command | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 68 ['ls', '-l', 'somefile; rm -rf ~'] | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 69 | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 70 | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 71 Usage | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 72 ----- | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 73 | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 74 Include ``shellescape`` in your project setup.py file ``install_requires`` dependency definition list: | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 75 | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 76 .. code-block:: python | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 77 | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 78 setup( | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 79 ... | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 80 install_requires=['shellescape'], | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 81 ... | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 82 ) | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 83 | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 84 | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 85 Then import the ``quote`` function into your module(s) and use it as needed: | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 86 | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 87 .. code-block:: python | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 88 | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 89 #!/usr/bin/env python | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 90 # -*- coding: utf-8 -*- | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 91 | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 92 from shellescape import quote | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 93 | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 94 filename = "somefile; rm -rf ~" | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 95 escaped_shell_command = 'ls -l {}'.format(quote(filename)) | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 96 | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 97 | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 98 Issue Reporting | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 99 --------------- | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 100 | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 101 Issue reporting is available on the `GitHub repository <https://github.com/chrissimpkins/shellescape/issues>`_ | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 102 | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 103 | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 104 | 
| 
4f3585e2f14b
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
 shellac parents: diff
changeset | 105 | 
