Skip to content

Commit

Permalink
Merge pull request #13 from gri-gus/bugfix/fix_windows_plugin_deletio…
Browse files Browse the repository at this point in the history
…n_or_update

Fixing bugs with updating and removing plugins on Windows;
  • Loading branch information
gri-gus authored Sep 21, 2024
2 parents e760c22 + 64cacd6 commit 93e8394
Show file tree
Hide file tree
Showing 8 changed files with 80 additions and 4 deletions.
36 changes: 36 additions & 0 deletions README-PYPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,22 @@ Library for creating Stream Deck plugins in Python.

**Supported Python versions:** 3.8 or later

## Installation

> ⚠️ To work correctly on Windows, you need to enable `LongPaths` support in
> the system: [manual](https://www.backupery.com/how-to-enable-ntfs-long-paths-in-windows/).
> Without this setting, installation problems may occur!
```shell
pip install streamdeck-sdk
```

or

```shell
pip install streamdeck_sdk
```

## Features

* Ease of use. You can quickly create your own plugin without having to understand how websockets and
Expand All @@ -50,11 +66,31 @@ Library for creating Stream Deck plugins in Python.
* Build the project using the `streamdeck_sdk build` console command.
* Property Inspector Generator. Write code in Python and get html and js for PI.

## ⚠️ Limitations

1. During installation and update of the plugin, the Internet must be available.

### Windows

1. Plugin requirements should take no longer than 30 seconds to install. This is a feature of Stream Deck on Windows,
since the program restarts the plugin if a websocket connection has not been established within 30 seconds.
Therefore, you need a good Internet connection when installing and updating the plugin.
2. You need to enable `LongPaths` support in the system
registry: [manual](https://www.backupery.com/how-to-enable-ntfs-long-paths-in-windows/).

Without this setting, the created plugins will not work!

## Examples

[LoremFlickr](https://github.com/gri-gus/loremflickr-streamdeck-plugin) - Plugin for installing images on a button from
the LoremFlickr site. Supports MacOS and Windows.

[Proxy Manager](https://github.com/gri-gus/proxymanager-streamdeck-plugin) - Plugin for enabling and disabling
proxies on MacOS. Periodically polls the proxy status through a separate thread.

[One-time password](https://github.com/gri-gus/otp-streamdeck-plugin) - Plugin for generating one-time passwords,
like in Google Authenticator. Has several Actions. Supports MacOS and Windows.

---

See full description and usage examples on
Expand Down
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ Library for creating Stream Deck plugins in Python.

## Installation

> ⚠️ To work correctly on Windows, you need to enable `LongPaths` support in
> the system: [manual](https://www.backupery.com/how-to-enable-ntfs-long-paths-in-windows/).
> Without this setting, installation problems may occur!
```shell
pip install streamdeck-sdk
```
Expand All @@ -69,6 +73,20 @@ pip install streamdeck_sdk
* Build the project using the `streamdeck_sdk build` console command.
* Property Inspector Generator. Write code in Python and get html and js for PI.

## ⚠️ Limitations

1. During installation and update of the plugin, the Internet must be available.

### Windows

1. Plugin requirements should take no longer than 30 seconds to install. This is a feature of Stream Deck on Windows,
since the program restarts the plugin if a websocket connection has not been established within 30 seconds.
Therefore, you need a good Internet connection when installing and updating the plugin.
2. You need to enable `LongPaths` support in the system
registry: [manual](https://www.backupery.com/how-to-enable-ntfs-long-paths-in-windows/).

Without this setting, the created plugins will not work!

## Quick Start

1. Install Python.
Expand Down
18 changes: 18 additions & 0 deletions README.ru.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@

## Установка

> ⚠️ Для корректной работы на Windows нужно включить поддержку `LongPaths` в
> системе: [manual](https://www.backupery.com/how-to-enable-ntfs-long-paths-in-windows/).
> Без этой настройки возможны проблемы с установкой!
```shell
pip install streamdeck-sdk
```
Expand All @@ -69,6 +73,20 @@ pip install streamdeck_sdk
* Сборка проекта через консольную команду `streamdeck_sdk build`.
* Генератор Property Inspector. Пишите код на Python и получите html и js для PI.

## ⚠️ Ограничения

1. Во время установки и обновления плагина должен быть доступен интернет.

### Windows

1. Зависимости плагина должны устанавливаться не дольше 30 секунд. Это особенность Stream Deck на Windows, так как
программа перезапускает плагин, если в течение 30 секунд не было установлено websocket соединение. Поэтому нужен
хороший интернет при установке и обновлении плагина.
2. Нужно включить поддержку `LongPaths` в реестре
системы: [manual](https://www.backupery.com/how-to-enable-ntfs-long-paths-in-windows/).

Без этой настройки созданные плагины не будут работать!

## Быстрый старт

1. Установите Python.
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import setuptools

VERSION = "1.1.0"
VERSION = "1.1.1"
PACKAGE_DIR = "."
REQUIREMENTS_FILE = "./requirements.txt"
README = "README-PYPI.md"
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
streamdeck-sdk>=1.1.0
streamdeck-sdk>=1.1.1
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"Description": "Open streamdeck_sdk github page.",
"Icon": "assets/plugin_icon",
"Name": "MyTestPlugin",
"Version": "0.0.2",
"Version": "0.0.3",
"SDKVersion": 2,
"OS": [
{
Expand Down
5 changes: 4 additions & 1 deletion streamdeck_sdk/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,11 @@ def log_errors(func):
def wrapper(*args, **kwargs):
try:
result = func(*args, **kwargs)
except SystemExit as err:
_log_errors_decorator_logger.exception(str(err))
raise err
except BaseException as err:
_log_errors_decorator_logger.error(str(err), exc_info=True)
_log_errors_decorator_logger.exception(str(err))
return
return result

Expand Down
1 change: 1 addition & 0 deletions streamdeck_sdk/mixins/event_routing_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def ws_on_close(
) -> None:
logger.debug(f"{close_status_code=}; {close_msg=}")
logger.info(f"WS CLOSED")
exit(0)

@log_errors
def ws_on_error(
Expand Down

0 comments on commit 93e8394

Please sign in to comment.