{ "info": { "author": "eXceed-iDeaL", "author_email": "exceedideal@163.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "License :: OSI Approved :: Apache Software License", "Programming Language :: Python :: 3.7" ], "description": "# edl-cr\n\n[![](https://img.shields.io/github/stars/eXceediDeaL/edl-coderunner.svg?style=social&label=Stars)](https://github.com/eXceediDeaL/edl-coderunner) [![](https://img.shields.io/github/forks/eXceediDeaL/edl-coderunner.svg?style=social&label=Fork)](https://github.com/eXceediDeaL/edl-coderunner) ![](http://progressed.io/bar/60?title=developing) [![](https://img.shields.io/github/license/eXceediDeaL/edl-coderunner.svg)](https://github.com/eXceediDeaL/edl-coderunner/blob/master/LICENSE)\n\nA CLI tool to run code. See more at [here](https://exceedideal.github.io/edl-coderunner/)\n\nProject Status:\n\n|||\n|-|-|\n|Repository|[![](https://img.shields.io/github/issues/eXceediDeaL/edl-coderunner.svg)](https://github.com/eXceediDeaL/edl-coderunner/issues/) [![](https://img.shields.io/github/issues-pr/eXceediDeaL/edl-coderunner.svg)](https://github.com/eXceediDeaL/edl-coderunner/pulls/)|\n|Dependencies|![](https://img.shields.io/pypi/pyversions/edl-cr.svg) ![](https://img.shields.io/librariesio/github/eXceediDeaL/edl-coderunner.svg)|\n|Build|[![](https://img.shields.io/travis/eXceediDeaL/edl-coderunner/master.svg?label=master)](https://travis-ci.org/eXceediDeaL/edl-coderunner) ![](https://img.shields.io/travis/eXceediDeaL/edl-coderunner/dev.svg?label=dev)|\n|Release|[![](https://img.shields.io/github/release-pre/eXceediDeaL/edl-coderunner.svg)](https://github.com/eXceediDeaL/edl-coderunner/releases/latest/) [![](https://img.shields.io/github/tag/eXceediDeaL/edl-coderunner.svg)](https://github.com/eXceediDeaL/edl-coderunner/tags)|\n|Package|[![](https://img.shields.io/pypi/v/edl-cr.svg)](https://pypi.org/project/edl-cr/) ![](\thttps://img.shields.io/pypi/status/edl-cr.svg) ![](https://img.shields.io/pypi/dd/edl-cr.svg)|\n\n# Install\n\nUse `pip` to install edl-cr.\n\n```sh\npip install edl-cr\n```\n\n# Usage\n\nUse command `ecr` to run edl-cr.\n\n## CLI Mode\n\n|Option|Description|\n|-|-|\n|`-d --dir`|Set working directory|\n|`-c --command`|Execute command just like in interactive mode|\n|`-V --version`|Show ecr version|\n|`-v --verbose`|Enable `DEBUG` level for logging|\n\n## Interactive Mode\n\nIf you don't use `--command` options, edl-cr will run in interactive mode.\n\n|ECR Color|Description|\n|-|-|\n|Empty|No ecr data at current and global|\n|Yellow|Load from global ecr data|\n|Green|Load from current ecr data|\n|Red|Load failed|\n\n### Initialize\n\n```sh\n> init\n```\n\nInitialize ECR data. It will create a directory named `.ecr` in current directory.\n\nIf you want to clear ECR data, use this command:\n\n```sh\n> clear\n```\n\n### Create and Run\n\nCreate a new code file:\n\n```sh\n> new a.cpp\n\n# Create code file with template\n> new a.cpp -t base\n```\n\nIt will use code template in `.ecr/templates/` to create file and set current file with the new file.\n\nIf you want to set current file with a existed file, use this:\n\n```sh\n> now a.cpp\n```\n\nThen use `edit` to open default editor to edit code:\n\n```sh\n> edit\n```\n\nThen use `run` command to run code.\n\n```sh\n# run a.cpp\na.cpp> run\n\n# run b.cpp\na.cpp> run b.cpp\n\n# run a.cpp with file input and standard output\na.cpp> run -io fs\n\n# watch the file a.cpp and run auto\na.cpp> run -w\n```\n\nIf you give `input.data` and `std.data` for input data and standard output data, use `test` to run and test output data.\n\n```sh\n# run a.cpp's output\na.cpp> test\n\n# run and test b.cpp's output\na.cpp> test b.cpp -r\n\n# watch the file a.cpp and run&test auto\na.cpp> test -w -r\n```\n\n### Use Directory\n\nNot only use files, you can also use directories to create a unique environment for codes.\n\n```sh\n# Create a new directory env\n> new project -d\n\n# Set a directory env for current\n> now project -d\n\n# Run\n@project> run\n\n# Judge\n@project> test\n```\n\nFor `run` and `test` commands, it will use the command list in `config.yml` in the directory. You can write your own commands in it. And these command works in the directory of current work-item.\n\n```yaml\ntest: null\nrun: null\n```\n\nFor commands in `test` and `run`, you can use variables as same as in `executor.yml` and `judger.yml` below.\n\n### Input and Output\n\nThe file input is at `.ecr/input.data`, and the file output is at `.ecr/output.data`.\n\nThe standard output data for judging is at `.ecr/std.data`\n\n### Clean\n\nClean the compiling output and something else:\n\n```sh\n> clean\n```\n\n### Debug\n\nWhen you meet some errors, for example, ecr data loading failing, use `debug` command to get some information. This is also a useful tool when you create an issue.\n\n### Variables\n\nYou can use builtin variables just like in bash:\n\n```sh\n> echo $wdir\n```\n\n|Variable|Description|\n|-|-|\n|`wdir`|Working directory|\n|`edir`|ECR directory|\n|`jdir`|Judger directory|\n|`tdir`|Template directory|\n|`current`|Current file|\n|`input`|Input file|\n|`output`|Output file|\n|`config`|Config file|\n|`globaldir`|Get global ecr directory|\n\n### Commands\n\nThese are builtin commands. You can use system command in `importedCommand` list.\n\nIf you want to call a system command that isn't in `importedCommand` list, use `>` prefix like `>ls`.\n\n|Command|Description|\n|-|-|\n|`init [-g --globals]`|Initialize ECR data|\n|`clear [-g --globals]`|Clear ECR data|\n|`reload [-c --current]`|Reload ECR data or current work-item data|\n|`new [file] [-e --edit] [-d --dir] [-t --template name]`|Create new code file|\n|`now [file] [-d --dir]`|Change current file|\n|`edit [file] [-n --now] [-d --dir]`|Edit code file|\n|`run [file] [-io --io] [-w] [-d --dir]`|Run code file|\n|`test [file] [-r --re] [-w] [-j --judger name] [-d --dir]`|Judge output data|\n|`clean`|Clean temp files|\n|`pwd`|Print working directory|\n|`cd`|Change working directory|\n|`version`|Get version|\n|`cls`|Clear console|\n|`exit`|Exit|\n|`-h --help`|Get help|\n|`status [-v --var]`|Get status|\n|`template [new clear remove clear]`|Template tools|\n|`debug [-os --os] [-c --current] [-e --ecr] [-l --log] [-o file]`|Show debug data|\n\n# Global\n\nWhen ecr starts, it will initialize global data and config at `~` (if it doesn't exist), and you can use `init -g` , `clear -g` to re-initialize and clear that.\n\n# Template\n\nYou can write your own templates for dir-workitem.\n\n```sh\n> template new mytemp\n```\n\nIt will create a new folder `mytemp` at template folder `.ecr/templates`, and generate config files.\n\nThe files in directory `.template` are the template config files. They will not be copied to destination.\n\n## .template/config.yml\n\nThis file defines the config for the template.\n\n```yaml\n# commands to execute after copying files\n# the commands will be executed with working directory = destination\nafter: []\n\n# relative path of the directory to be copied to destination\n# the base path is the current template path\nrootPath: ''\n\n# template's subject\nsubject: test\n```\n\n# Config\n\nThe config files is at `.ecr/`\n\n## config.yml\n\nThis file contains basic config.\n\n```yaml\n# The default editor\ndefaultEditor: vim\n\n# The default judger's name\ndefaultJudger: text\n\n# The default IO when run\ndefaultIO: ss\n\n# The default shell to execute command\ndefaultShell: powershell -c\n\n# The default time limit for every step when run\ndefaultTimeLimit: 10\n\n# The ecr version for the config file\neVersion: 0.0.2\n\n# Map name to system command\nimportedCommand:\n bash: bash\n cat: cat\n copy: copy\n cp: cp\n\n# File extension name to be cleaned\ntempFileFilter:\n- exe\n- o\n- class\n- out\n```\n\n## executor.yml\n\nThis file gives the way to run a code file.\n\nYou can use these varibles in command:\n\n- `fileName` The code file name\n- `fileNameWithoutExt` The code file name without extension\n\n```yaml\nc:\n- gcc {fileName} -o {fileNameWithoutExt}\n- ./{fileNameWithoutExt}\n\ncpp:\n- g++ {fileName} -o {fileNameWithoutExt}\n- ./{fileNameWithoutExt}\n```\n\n## judger.yml\n\nThis file gives the way to test.\n\nYou can use these varibles in command:\n\n- `judgerDir` The directory path for judgers. It will be pointed to `$wdir/.ecr/judgers`\n- `expectFile` The expect output file\n- `realFile` The real output file\n\n```yaml\ntext: # Judger name\n- python -u {judgerDir}/text.py {expectFile} {realFile}\n```\n\n## judgers/\n\nThis directory contains some judgers, you can write your judgers and use them.\n\n## template.yml\n\nThis file defines the default code template for different language.\n\nIt only contains the template file name (without extension name), and it will find the file in `templates/`\n\nThe key-value pair `dir` gives the default template name for directory work-item.\n\n## templates/\n\nThis directory contains code templates.\n\n# Developing\n\n- The `Makefile` use `SHELL` varible in Windows (as well as `PY`), so if you are in Linux, change it before use `make`.\n- To build and upload the package, this requires these modules setuptools, wheel, twine. You can try `make prepare` to install these modules.\n- Maybe there are some differences between win's command and linux's command, so feel free to modify `Makefile` when you meet some errors.\n\n```sh\n# Run\nmake run\n\nmake run RARG=-h # use command args\n\n# Use pylint to check\nmake lint\n\n# Test\nmake test\n\n# Test and get coverage\nmake cover\n\n# Build\nmake build -B\n\n# Install locally\nmake install\n\n# Uninstall locally\nmake uninstall\n\n# Clean\nmake clean\n\n# Upload to PyPI\nmake upload\n\n# Upload to TestPyPI\nmake uptest\n```\n\n# Requirements\n\n- Python 3.7\n- [See more](https://github.com/eXceediDeaL/edl-coderunner/network/dependencies)", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/eXceediDeaL/edl-coderunner", "keywords": "code runner", "license": "Apache-2.0", "maintainer": "", "maintainer_email": "", "name": "edl-cr", "package_url": "https://pypi.org/project/edl-cr/", "platform": "", "project_url": "https://pypi.org/project/edl-cr/", "project_urls": { "Bug Tracker": "https://github.com/eXceediDeaL/edl-coderunner/issues", "Documentation": "https://github.com/eXceediDeaL/edl-coderunner/wiki", "Homepage": "https://github.com/eXceediDeaL/edl-coderunner", "Source Code": "https://github.com/eXceediDeaL/edl-coderunner" }, "release_url": "https://pypi.org/project/edl-cr/0.0.3.2/", "requires_dist": null, "requires_python": ">=3.7", "summary": "A CLI tool to run code", "version": "0.0.3.2" }, "last_serial": 4561700, "releases": { "0.0.1.1": [ { "comment_text": "", "digests": { "md5": "2315d47b337988f7b2f005d83594be3a", "sha256": "166621b65c270963cec3b30ccc724c8e8def3afa8a7b29bc5bd599984affaa1b" }, "downloads": -1, "filename": "edl_cr-0.0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "2315d47b337988f7b2f005d83594be3a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.7", "size": 13897, "upload_time": "2018-11-18T09:29:11", "url": "https://files.pythonhosted.org/packages/d8/48/3b8646d837eac3401e7a6383b919c480d37eaf1d5506a0932d7eff94bb38/edl_cr-0.0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d05e781f78d231ef1c369f322b49c573", "sha256": "49482116af63c87db724179011a31bf2b398d9d6d09ab9c64fcbf7124726a68a" }, "downloads": -1, "filename": "edl-cr-0.0.1.1.tar.gz", "has_sig": false, "md5_digest": "d05e781f78d231ef1c369f322b49c573", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.7", "size": 9657, "upload_time": "2018-11-18T09:29:13", "url": "https://files.pythonhosted.org/packages/a2/76/fe26586b03f96bc9eef7068c803a147afcc93b7833a045bcbfd0a902aea9/edl-cr-0.0.1.1.tar.gz" } ], "0.0.1.2": [ { "comment_text": "", "digests": { "md5": "e685deef8816f77ca5c3516613e788d3", "sha256": "2c0d8ed0b2f2fec17f8f8ba59fc0ba00e1574fbc8fd50a8405b1dfe59762e9e2" }, "downloads": -1, "filename": "edl-cr-0.0.1.2.tar.gz", "has_sig": false, "md5_digest": "e685deef8816f77ca5c3516613e788d3", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.7", "size": 9775, "upload_time": "2018-11-19T09:25:09", "url": "https://files.pythonhosted.org/packages/46/99/fc9044a4f712618fef7acfbbe11bda354531dac1a821c0141be433fccca2/edl-cr-0.0.1.2.tar.gz" } ], "0.0.1.4": [ { "comment_text": "", "digests": { "md5": "349606893d6ae8e84d75ef44d92c6cf3", "sha256": "3c4fa4604be489eb61c7389fac3d95c445f7bd2467beaac01541c2eab8f7adac" }, "downloads": -1, "filename": "edl-cr-0.0.1.4.tar.gz", "has_sig": false, "md5_digest": "349606893d6ae8e84d75ef44d92c6cf3", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.7", "size": 11403, "upload_time": "2018-11-19T12:39:41", "url": "https://files.pythonhosted.org/packages/01/0e/9e6c8bcbc85da9c679ec66b1cabcc1c93ca3b1c6bf99d2bcbe03d7d33080/edl-cr-0.0.1.4.tar.gz" } ], "0.0.1.5": [ { "comment_text": "", "digests": { "md5": "172cce6570c786c28b486618fc362c93", "sha256": "491c57a24be34281cf59a8f7784c4ec1cf4d674c8fa3d8dc9f9e8f9a332af6a5" }, "downloads": -1, "filename": "edl-cr-0.0.1.5.tar.gz", "has_sig": false, "md5_digest": "172cce6570c786c28b486618fc362c93", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.7", "size": 14108, "upload_time": "2018-11-20T12:50:46", "url": "https://files.pythonhosted.org/packages/c0/20/ce674140f0abd9f544975f0371de0b040ebe63246305ad60e498cf013e7c/edl-cr-0.0.1.5.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "7de5072cf66d5b66ec32bbba9b4365b5", "sha256": "7cc20f10d8c0d4b26d6056e902e4a2f54c043a166437b39f35c30134ecdb260c" }, "downloads": -1, "filename": "edl-cr-0.0.2.tar.gz", "has_sig": false, "md5_digest": "7de5072cf66d5b66ec32bbba9b4365b5", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.7", "size": 14696, "upload_time": "2018-11-21T03:58:40", "url": "https://files.pythonhosted.org/packages/a3/9b/871d7c79861870fc8baa4829584a9983f17e3423558842ba02aef8a9e9e5/edl-cr-0.0.2.tar.gz" } ], "0.0.2.8": [ { "comment_text": "", "digests": { "md5": "594eabddfbade10d4bf4b39c4fea00a8", "sha256": "74355438ae0b19888fbca97e629cc19d2ab92f5978d6e6ef54bd8a64ee91107a" }, "downloads": -1, "filename": "edl-cr-0.0.2.8.tar.gz", "has_sig": false, "md5_digest": "594eabddfbade10d4bf4b39c4fea00a8", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.7", "size": 19044, "upload_time": "2018-11-30T13:22:07", "url": "https://files.pythonhosted.org/packages/de/ac/fb792563694ac9ed51de0ccd7cf2db04cd78dabded58873124480e1ee80f/edl-cr-0.0.2.8.tar.gz" } ], "0.0.3.2": [ { "comment_text": "", "digests": { "md5": "3ec4754d93e9668408e9934e8441f67e", "sha256": "f61783ea96b539558e79bf4241504d9f1937f97325d593fe40d68ebb6e6a642d" }, "downloads": -1, "filename": "edl-cr-0.0.3.2.tar.gz", "has_sig": false, "md5_digest": "3ec4754d93e9668408e9934e8441f67e", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.7", "size": 1434394, "upload_time": "2018-12-05T00:53:55", "url": "https://files.pythonhosted.org/packages/77/ab/670b387ae22b0662c677ce49229aeb6766af89dd61c4f42e569098f51807/edl-cr-0.0.3.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "3ec4754d93e9668408e9934e8441f67e", "sha256": "f61783ea96b539558e79bf4241504d9f1937f97325d593fe40d68ebb6e6a642d" }, "downloads": -1, "filename": "edl-cr-0.0.3.2.tar.gz", "has_sig": false, "md5_digest": "3ec4754d93e9668408e9934e8441f67e", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.7", "size": 1434394, "upload_time": "2018-12-05T00:53:55", "url": "https://files.pythonhosted.org/packages/77/ab/670b387ae22b0662c677ce49229aeb6766af89dd61c4f42e569098f51807/edl-cr-0.0.3.2.tar.gz" } ] }