The MIT License (MIT)

Copyright (c) 2020 James P Goodwin

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.

ped

ped is an editor and accompanying tools written in python.

Background

I wrote ped since 2009 basically for my own use. I wanted an editor that emulated Brief(TM) and that I could easily extend and that would run in terminals on linux or other places that curses was available. I had been using a Brief(TM) emulation macro in emacs, but that was very limited and emacs is complicated to extend because of all of the mass of features and variants that exist. When I started the project I was working in python almost exclusively, and I realized that a lot of sophisticated features would be made relatively easy because python packages existed for them, so I embarked on writing my own editor.

I guess this was an act of vanity, stupidity, or stubbornness, but it was fun and I got what I wanted in the end and have been using the editor and extending it since then. I don't expect that this will be anyone's favorite editor but mine, but there might be some snippets of code or modules that others find useful, so please use the code as you like.

If you find bugs let me know or send me a fix I may apply it or fix the bug or not. I don't warrant that this code is good for any particular purpose.

Installation

Install from pypy:

python3 -m pip install ped-editor

Make sure that ~/.local/bin is on your PATH

OR

Check out the source code to a path OR download the release .zip file and unzip there.

Put the path on your operating system's execution path and the modules on your PYTHONPATH.

Requires python 3.6.9 or better.

Requires a terminal that works with the python curses module.

There is a requirements.txt file, you can do: pip install -r requirements.txt

Notes

Documentation

Have a look at the wiki page for usage and configuration documentation.

Contributing

If you're interested in contributing these are the instructions. Please understand that while you retain the copyright for any of your work, once it is contributed it is licensed under the same MIT license as the rest of the project.

To get set up you should do the following:

Some of the finer details of the dev environment:

If you happen to use Microsoft Visual Studio Code here is a template for launching and debugging both tests and the code, put this in launch.json for your working folder:

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Python: Current File",
            "type": "python",
            "request": "launch",
            "program": "/home/yourhome/ped-git/scripts/ped",
            "args": ["ped_core/editor_common.py"],
            "env": { "PYTHONPATH":"." },
            "console": "externalTerminal"
        },
        {
            "name": "Python: Pytest",
            "type": "python",
            "request": "launch",
            "module": "pytest",
            "args": [ "tests", "-k", "test_Editor_wrapped" ],
            "env" : { "PYTHONPATH":".", "SSH_DIALOG_BASEPATH":"ssh://your-ssh-server:22/home/yourhome/ssh_tmp", "SSH_DIALOG_USERNAME":"your_user_name",
"SSH_DIALOG_PASSWORD":"*******" },
            "console": "externalTerminal"
        }
    ]
}

API Documentation

Packages/Modules