bmh
Project description
BashMetaHandler
Features
It provites an interpreter for a own bash meta languange. Currently only tested for linux systems.
Requirements
click>=8.1.7 ; python_version >= "3.7" and python_version < "4.0" colorama>=0.4.6 ; python_version >= "3.7" and python_version < "4.0" and platform_system == "Windows" datetime>=5.5 ; python_version >= "3.7" and python_version < "4.0" importlib-metadata>=4.2.0 ; python_version >= "3.7" and python_version < "3.8" pexpect>=4.9.0 ; python_version >= "3.7" and python_version < "4.0" ptyprocess>=0.7.0 ; python_version >= "3.7" and python_version < "4.0" pytz>=2024.1 ; python_version >= "3.7" and python_version < "4.0" setuptools>=68.0.0 ; python_version >= "3.7" and python_version < "4.0" typing-extensions>=4.7.1 ; python_version >= "3.7" and python_version < "3.8" zipp>=3.15.0 ; python_version >= "3.7" and python_version < "3.8" zope-interface>=6.4.post2 ; python_version >= "3.7" and python_version < "4.0"
Installation
You can install bmh via pip from PyPI:
$ pip install BashMetaHandler
Usage
The main purpose of this library is to provide an interpreter for the self-created metabashlanguage. The MetaBashHandler-class handles this interpretation. When on object of this class is created it initiates a bash terminal where the interpreted language is executed.
Firstly, it a provided file is read and lines for the goto-command are searched and indexed. They must be a word followed by an ":".Secondly, the execute_file function will run the interpreter.
The metabashlanguange has normally the ending ".msh". When not a special case the input goes directly to the bash terminal. It has the advantage to not care whether you are directly in the bash terminal are input of a program run by the terminal. Keywords implemented are: while, if, elif, else. When used you have to use a tab to indicate how long these keywords effect should be (similar to python).
Additionally you are provided with functions to be used. They are used as follows functionname(arg1,arg2,...). There are a few prebuild functions to use given as default parameters to the MetaBashHandler. These are: check, do_not, equal, expect, expect_check, get_input, println and wait. The actual functionname are sometimes different to the actual python functionnames. You can also create your own function, the first argument should always be the MetaBashHandler object.
Finally there you can use variables indicated by $(variable name). They will be replaced with the content of the variable given to the MetaBashHandler object.
Please see the Command-line Reference for details.
Contributing
Contributions are very welcome. To learn more, see the Contributor Guide.
License
Distributed under the terms of the MIT license, bmh is free and open source software.
Issues
If you encounter any problems, please file an issue along with a detailed description.
Credits
This project was generated from @cjolowicz's Hypermodern Python Cookiecutter template.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file bashmetahandler-1.1.0.tar.gz
.
File metadata
- Download URL: bashmetahandler-1.1.0.tar.gz
- Upload date:
- Size: 9.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e6993d4e40f290e1222121fa23ada5e5832f0d4fac2e38545c4068c71084ead0 |
|
MD5 | 19c7c7d2c91aa06feeec7bc6459004f6 |
|
BLAKE2b-256 | 0f0dfb8b9b42a4e14e299105550b58d18b2ba1673ab75bb6e0a7af6a800e9e78 |
File details
Details for the file bashmetahandler-1.1.0-py3-none-any.whl
.
File metadata
- Download URL: bashmetahandler-1.1.0-py3-none-any.whl
- Upload date:
- Size: 10.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 87a9afaf6741ee9c80b2f4add9c32c84496917939865a9f6c62cdb93da23187e |
|
MD5 | e4f9fc43997728761e6e1d93bf4af585 |
|
BLAKE2b-256 | 7daf47c4919c1f1a1323346d8f68e7d30a74f04b3fd8169ec1ea784d570a15db |