Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/buddy-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Buddy Build

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [3.11, 3.13]

steps:
- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel pytest responses

- name: Build
env:
CI: 1
run: |
python setup.py sdist bdist_wheel

- name: Install wheel
run:
pip install dist/amcrest-*.whl

- name: Test
run: |
pytest -v
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -105,5 +105,6 @@ ENV/
# Rope project settings
.ropeproject

# Vim temporary files
# Vim/emacs temporary/backup files
*.swp
*~
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def readme():

setup(
name="amcrest",
version="1.9.9",
version="1.9.10",
description="Python wrapper implementation for Amcrest cameras.",
long_description=readme(),
author="Douglas Schilling Landgraf, Marcelo Moreira de Mello",
Expand Down
10 changes: 9 additions & 1 deletion src/amcrest/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,15 @@ def str2bool(value: Union[str, int]) -> bool:
False values: n, no, false, off, 0
"""
if isinstance(value, str):
return value.lower() in ("y", "yes", "on", "1", "true", "t")
valueCompare = value.lower()

if valueCompare in ("y", "yes", "on", "1", "true", "t"):
return True
elif valueCompare in ("n", "no", "off", "0", "false"):
return False
else:
raise ValueError(value)

return bool(value)


Expand Down