restartprocwithvars


Namerestartprocwithvars JSON
Version 0.10 PyPI version JSON
download
home_pagehttps://github.com/hansalemaos/restartprocwithvars
SummaryRestarts process (Windows only)
upload_time2024-04-07 05:38:20
maintainerNone
docs_urlNone
authorJohannes Fischer
requires_pythonNone
licenseMIT
keywords restart windows
VCS
bugtrack_url
requirements ctrlchandler keyboard list_all_files_recursively_short
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
# Restarts process (Windows only)

## Tested against Windows / Python 3.11 / Anaconda

### pip install restartprocwithvars

```py
from restartprocwithvars import (
    set_console_ctrl_handler,
    newstartwhenctrlc,
    disable_restart_proc,
)
from time import sleep
from functools import partial
import sys

disable_restart_proc(
    "ctrl+alt+w",
)
set_console_ctrl_handler(
    returncode=1,
    func=partial(
        newstartwhenctrlc,
        sleeptime=30,
        sleep_before_restart=5,
        sleep_after_exit=5,
        pythonexe=sys.executable,
    ),
)
while True:
    sleep(1)
    print("test")
sleep(10)


# def _switch_restart_proc():
#     """
#     Toggle the value of config.restart_proc and print the updated status.
#     """

# def disable_restart_proc(disable_shortcut):
#     """
#     Function to disable the restart process with a specified shortcut.

#     :param disable_shortcut: str - The shortcut used to disable the restart process.
#     :return: None
#     """

# def newstartwhenctrlc(*args, **kwargs):
#     """
#     A function to handle the behavior when Ctrl+C is pressed. It checks if a process needs to be restarted, then generates a batch file for the restart process with necessary environment variables and commands. Finally, it starts the batch file in a new subprocess and exits the current process.
#     """
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/hansalemaos/restartprocwithvars",
    "name": "restartprocwithvars",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "restart, windows",
    "author": "Johannes Fischer",
    "author_email": "aulasparticularesdealemaosp@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/0a/19/2b8a05d2e6da00e3c95884080e9aebadaa8dd724376f979c7f3a888f79e8/restartprocwithvars-0.10.tar.gz",
    "platform": null,
    "description": "\r\n# Restarts process (Windows only)\r\n\r\n## Tested against Windows / Python 3.11 / Anaconda\r\n\r\n### pip install restartprocwithvars\r\n\r\n```py\r\nfrom restartprocwithvars import (\r\n    set_console_ctrl_handler,\r\n    newstartwhenctrlc,\r\n    disable_restart_proc,\r\n)\r\nfrom time import sleep\r\nfrom functools import partial\r\nimport sys\r\n\r\ndisable_restart_proc(\r\n    \"ctrl+alt+w\",\r\n)\r\nset_console_ctrl_handler(\r\n    returncode=1,\r\n    func=partial(\r\n        newstartwhenctrlc,\r\n        sleeptime=30,\r\n        sleep_before_restart=5,\r\n        sleep_after_exit=5,\r\n        pythonexe=sys.executable,\r\n    ),\r\n)\r\nwhile True:\r\n    sleep(1)\r\n    print(\"test\")\r\nsleep(10)\r\n\r\n\r\n# def _switch_restart_proc():\r\n#     \"\"\"\r\n#     Toggle the value of config.restart_proc and print the updated status.\r\n#     \"\"\"\r\n\r\n# def disable_restart_proc(disable_shortcut):\r\n#     \"\"\"\r\n#     Function to disable the restart process with a specified shortcut.\r\n\r\n#     :param disable_shortcut: str - The shortcut used to disable the restart process.\r\n#     :return: None\r\n#     \"\"\"\r\n\r\n# def newstartwhenctrlc(*args, **kwargs):\r\n#     \"\"\"\r\n#     A function to handle the behavior when Ctrl+C is pressed. It checks if a process needs to be restarted, then generates a batch file for the restart process with necessary environment variables and commands. Finally, it starts the batch file in a new subprocess and exits the current process.\r\n#     \"\"\"\r\n```\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Restarts process (Windows only)",
    "version": "0.10",
    "project_urls": {
        "Homepage": "https://github.com/hansalemaos/restartprocwithvars"
    },
    "split_keywords": [
        "restart",
        " windows"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c5fcc3041341bd98f99894531304ef0243170f1f880cf590449ec7b338e2bc0d",
                "md5": "23be94689ba6d203a308d2c7746c6619",
                "sha256": "f1b8c7d35b4ddd40955e42c0ed391815b5c5243114cc5813237c371ba44375de"
            },
            "downloads": -1,
            "filename": "restartprocwithvars-0.10-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "23be94689ba6d203a308d2c7746c6619",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 6432,
            "upload_time": "2024-04-07T05:38:18",
            "upload_time_iso_8601": "2024-04-07T05:38:18.710621Z",
            "url": "https://files.pythonhosted.org/packages/c5/fc/c3041341bd98f99894531304ef0243170f1f880cf590449ec7b338e2bc0d/restartprocwithvars-0.10-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0a192b8a05d2e6da00e3c95884080e9aebadaa8dd724376f979c7f3a888f79e8",
                "md5": "26631e6df71aeeef23858f11c0a0f5e9",
                "sha256": "a354640933c0af4ecd1d88dbff13830809a685557be8a730186112df8b6a0c39"
            },
            "downloads": -1,
            "filename": "restartprocwithvars-0.10.tar.gz",
            "has_sig": false,
            "md5_digest": "26631e6df71aeeef23858f11c0a0f5e9",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 4539,
            "upload_time": "2024-04-07T05:38:20",
            "upload_time_iso_8601": "2024-04-07T05:38:20.664679Z",
            "url": "https://files.pythonhosted.org/packages/0a/19/2b8a05d2e6da00e3c95884080e9aebadaa8dd724376f979c7f3a888f79e8/restartprocwithvars-0.10.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-07 05:38:20",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "hansalemaos",
    "github_project": "restartprocwithvars",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "ctrlchandler",
            "specs": []
        },
        {
            "name": "keyboard",
            "specs": []
        },
        {
            "name": "list_all_files_recursively_short",
            "specs": []
        }
    ],
    "lcname": "restartprocwithvars"
}
        
Elapsed time: 0.27341s