Compare commits

..

No commits in common. "eecd51e0ca2b3732bc26c7666f30eb7ace3c9a16" and "130bf74f2747cf9996dbce7bf492d68bdbb9ae3a" have entirely different histories.

8 changed files with 8 additions and 194 deletions

View File

@ -1,62 +0,0 @@
name: Build PYZ
on:
push:
tags:
- 'v*.*.*'
pull_request:
branches: [main]
workflow_dispatch:
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up PDM
uses: pdm-project/setup-pdm@v4
with:
python-version: '3.11'
- name: Install dependencies
run: |
pdm sync -d -G build
- name: Build addon
run: pdm run compile
- name: Upload build artifacts
if: success()
uses: actions/upload-artifact@v4
with:
name: pyz_build
path: ./bin/simple-recorder.pyz
upload_release:
runs-on: ubuntu-latest
if: ${{ startsWith(github.ref, 'refs/tags/') }}
needs: build
steps:
- name: Download releases files
uses: actions/download-artifact@v4.1.7
with:
name: pyz_build
- name: Display structure of downloaded files
run: tree
- name: Release
uses: softprops/action-gh-release@v1
with:
files: simple-recorder.pyz
fail_on_unmatched_files: true
prerelease: ${{ contains(github.ref, '-') }}

View File

@ -1,26 +0,0 @@
name: Release
on:
release:
types: [published]
push:
tags:
- 'v*.*.*'
jobs:
pypi-publish:
name: upload release to PyPI
runs-on: ubuntu-latest
environment: pypi
permissions:
# This permission is needed for private repositories.
contents: read
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
- uses: actions/checkout@v4
- uses: pdm-project/setup-pdm@v4
- name: Publish package distributions to PyPI
run: pdm publish

4
.gitignore vendored
View File

@ -162,6 +162,4 @@ cython_debug/
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
!bin/.gitkeep
bin/*
bin/

View File

@ -58,16 +58,6 @@ Without passing a subcommand (start/stop) a GUI will be launched, otherwise a CL
Just enter the filename and click *Start Recording*.
#### Themes
Load the GUI with different themes:
```console
simple-recorder --theme="Light Purple"
```
Available themes: Light Purple, Neutral Blue, Reds, Sandy Beach, Kayak, Light Blue 2, Dark Teal1
### CLI
```shell

View File

69
pdm.lock generated
View File

@ -2,28 +2,14 @@
# It is not intended for manual editing.
[metadata]
groups = ["default", "build"]
groups = ["default"]
strategy = ["inherit_metadata"]
lock_version = "4.5.0"
content_hash = "sha256:292c5ea319597e3539895c1ac50004c884c5d46edd5f7b195ede79156558feab"
content_hash = "sha256:7d4367f16062b5a2d661a207b7b33518aaea59371e239b8cf90a5b5b583e1abc"
[[metadata.targets]]
requires_python = ">=3.11"
[[package]]
name = "click"
version = "8.2.1"
requires_python = ">=3.10"
summary = "Composable command line interface toolkit"
groups = ["build"]
dependencies = [
"colorama; platform_system == \"Windows\"",
]
files = [
{file = "click-8.2.1-py3-none-any.whl", hash = "sha256:61a3265b914e850b85317d0b3109c7f8cd35a670f963866005d6ef1d5175a12b"},
{file = "click-8.2.1.tar.gz", hash = "sha256:27c491cc05d968d271d5a1db13e3b5a184636d9d930f148c50b038f0d0646202"},
]
[[package]]
name = "clypi"
version = "1.8.1"
@ -39,18 +25,6 @@ files = [
{file = "clypi-1.8.1.tar.gz", hash = "sha256:9efa0a5a0e3668dd390e0d90321587dcb8eea12e28facd2ac437383f0de3dc76"},
]
[[package]]
name = "colorama"
version = "0.4.6"
requires_python = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7"
summary = "Cross-platform colored terminal text."
groups = ["build"]
marker = "platform_system == \"Windows\""
files = [
{file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"},
{file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"},
]
[[package]]
name = "freesimplegui"
version = "5.2.0.post1"
@ -76,17 +50,6 @@ files = [
{file = "obsws_python-1.7.2.tar.gz", hash = "sha256:b5cdaad30fbe1f6d4787b6530048b9882f070c3ee7830abb6dad4a47f84d7fa0"},
]
[[package]]
name = "pip"
version = "25.1.1"
requires_python = ">=3.9"
summary = "The PyPA recommended tool for installing Python packages."
groups = ["build"]
files = [
{file = "pip-25.1.1-py3-none-any.whl", hash = "sha256:2913a38a2abf4ea6b64ab507bd9e967f3b53dc1ede74b01b0931e1ce548751af"},
{file = "pip-25.1.1.tar.gz", hash = "sha256:3de45d411d308d5054c2168185d8da7f9a2cd753dbac8acbfa88a8909ecd9077"},
]
[[package]]
name = "python-dateutil"
version = "2.9.0.post0"
@ -101,34 +64,6 @@ files = [
{file = "python_dateutil-2.9.0.post0-py2.py3-none-any.whl", hash = "sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427"},
]
[[package]]
name = "setuptools"
version = "80.9.0"
requires_python = ">=3.9"
summary = "Easily download, build, install, upgrade, and uninstall Python packages"
groups = ["build"]
files = [
{file = "setuptools-80.9.0-py3-none-any.whl", hash = "sha256:062d34222ad13e0cc312a4c02d73f059e86a4acbfbdea8f8f76b28c99f306922"},
{file = "setuptools-80.9.0.tar.gz", hash = "sha256:f36b47402ecde768dbfafc46e8e4207b4360c654f1f3bb84475f0a28628fb19c"},
]
[[package]]
name = "shiv"
version = "1.0.8"
requires_python = ">=3.6"
summary = "A command line utility for building fully self contained Python zipapps."
groups = ["build"]
dependencies = [
"click!=7.0,>=6.7",
"importlib-resources; python_version < \"3.7\"",
"pip>=9.0.3",
"setuptools",
]
files = [
{file = "shiv-1.0.8-py2.py3-none-any.whl", hash = "sha256:a60e4b05a2d2f8b820d567b1d89ee59af731759771c32c282d03c4ceae6aba24"},
{file = "shiv-1.0.8.tar.gz", hash = "sha256:2a68d69e98ce81cb5b8fdafbfc1e27efa93e6d89ca14bfae33482e4176f561d6"},
]
[[package]]
name = "six"
version = "1.17.0"

View File

@ -1,6 +1,6 @@
[project]
name = "simple-recorder"
version = "0.1.3"
version = "0.1.0"
description = "A simple OBS recorder"
authors = [{ name = "onyx-and-iris", email = "code@onyxandiris.online" }]
dependencies = [
@ -24,10 +24,4 @@ build-backend = "pdm.backend"
distribution = true
[tool.pdm.scripts]
compile = "shiv -c simple-recorder -o bin/simple-recorder.pyz ."
[dependency-groups]
build = [
"shiv>=1.0.8",
]
compile = "uvx shiv -c simple-recorder -o bin/simple-recorder.pyz ."

View File

@ -1,7 +1,6 @@
import logging
from datetime import datetime
import clypi
import FreeSimpleGUI as fsg
import obsws_python as obsws
from clypi import ClypiConfig, ClypiException, Command, Positional, arg, configure
@ -14,9 +13,6 @@ config = ClypiConfig(
)
configure(config)
highlight = clypi.Styler(fg="green")
error = clypi.Styler(fg="red", bold=True)
class Start(Command):
"""Start recording."""
@ -46,14 +42,12 @@ class Start(Command):
if resp.output_active:
raise ClypiException("Recording is already active.")
filename = f"{self.filename} {self.get_timestamp()}"
client.set_profile_parameter(
"Output",
"FilenameFormatting",
filename,
f"{self.filename} {self.get_timestamp()}",
)
client.start_record()
print(f"Recording started with filename: {highlight(filename)}")
class Stop(Command):
@ -73,20 +67,11 @@ class Stop(Command):
raise ClypiException("Recording is not active.")
client.stop_record()
print("Recording stopped successfully.")
def theme_parser(value: str) -> str:
"""Parse the theme argument."""
themes = [
"Light Purple",
"Neutral Blue",
"Reds",
"Sandy Beach",
"Kayak",
"Light Blue 2",
"Dark Teal1",
]
themes = ["Light Purple", "Neutral Blue", "Reds", "Sandy Beach"]
if value not in themes:
raise ClypiException(
f"Invalid theme: {value}. Available themes: {', '.join(themes)}"
@ -156,7 +141,7 @@ class SimpleRecorder(Command):
def run():
"""Run the application."""
"""Run the CLI application."""
SimpleRecorder.parse().start()