Skip to content

Commit

Permalink
Merge branch 'refs/heads/auto-site-hotkey'
Browse files Browse the repository at this point in the history
  • Loading branch information
naisanzaa committed Nov 11, 2024
2 parents bdcd1c3 + 3a2e6b5 commit fef347a
Show file tree
Hide file tree
Showing 9 changed files with 589 additions and 182 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/python313.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: 3.13

on:
push:
branches: [ '*' ]
pull_request:
branches: [ '*' ]

env:
# Use docker.io for Docker Hub if empty
REGISTRY: ghcr.io
# github.repository as <account>/<repo>
#IMAGE_NAME: ${{ github.repository }}
IMAGE_NAME: theshellland/automonisaur

PKG: automon
PYPI: automonisaur
TWINE_REPOSITORY: https://upload.pypi.org/legacy/
TWINE_REPOSITORY_URL: https://upload.pypi.org/legacy/
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}


jobs:

unittest:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.13'
- name: Install python packages
run: pip3 install -r requirements.txt
- name: install chrome and chromedriver
run: /bin/bash docker/install.sh
- name: Run tests
run: /bin/bash test.sh
env:
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
44 changes: 44 additions & 0 deletions .github/workflows/python314.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: 3.14

on:
push:
branches: [ '*' ]
pull_request:
branches: [ '*' ]

env:
# Use docker.io for Docker Hub if empty
REGISTRY: ghcr.io
# github.repository as <account>/<repo>
#IMAGE_NAME: ${{ github.repository }}
IMAGE_NAME: theshellland/automonisaur

PKG: automon
PYPI: automonisaur
TWINE_REPOSITORY: https://upload.pypi.org/legacy/
TWINE_REPOSITORY_URL: https://upload.pypi.org/legacy/
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}


jobs:

unittest:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.14'
- name: Install python packages
run: pip3 install -r requirements.txt
- name: install chrome and chromedriver
run: /bin/bash docker/install.sh
- name: Run tests
run: /bin/bash test.sh
env:
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
2 changes: 1 addition & 1 deletion .github/workflows/python38.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 3.8
name: 3.8 EOL

on:
push:
Expand Down
Empty file.
82 changes: 82 additions & 0 deletions automon/integrations/audacityWrapper/client.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""Tests the audacity pipe.
Keep pipe_test.py short!!
You can make more complicated longer tests to test other functionality
or to generate screenshots etc in other scripts.
Make sure Audacity is running first and that mod-script-pipe is enabled
before running this script.
Requires Python 2.7 or later. Python 3 is strongly recommended.
"""

import os
import sys

if sys.platform == 'win32':
print("pipe-test.py, running on windows")
TONAME = '\\\\.\\pipe\\ToSrvPipe'
FROMNAME = '\\\\.\\pipe\\FromSrvPipe'
EOL = '\r\n\0'
else:
print("pipe-test.py, running on linux or mac")
TONAME = '/tmp/audacity_script_pipe.to.' + str(os.getuid())
FROMNAME = '/tmp/audacity_script_pipe.from.' + str(os.getuid())
EOL = '\n'

print("Write to \"" + TONAME + "\"")
if not os.path.exists(TONAME):
print(" ..does not exist. Ensure Audacity is running with mod-script-pipe.")
sys.exit()

print("Read from \"" + FROMNAME + "\"")
if not os.path.exists(FROMNAME):
print(" ..does not exist. Ensure Audacity is running with mod-script-pipe.")
sys.exit()

print("-- Both pipes exist. Good.")

TOFILE = open(TONAME, 'w')
print("-- File to write to has been opened")
FROMFILE = open(FROMNAME, 'rt')
print("-- File to read from has now been opened too\r\n")


def send_command(command):
"""Send a single command."""
print("Send: >>> \n" + command)
TOFILE.write(command + EOL)
TOFILE.flush()


def get_response():
"""Return the command response."""
result = ''
line = ''
while True:
result += line
line = FROMFILE.readline()
if line == '\n' and len(result) > 0:
break
return result


def do_command(command):
"""Send one command, and return the response."""
send_command(command)
response = get_response()
print("Rcvd: <<< \n" + response)
return response


def quick_test():
"""Example list of commands."""
# do_command('Export2: Filename=/tmp/out.wav')
# do_command('SetPreference: Name=GUI/Theme Value=classic Reload=1')


quick_test()
Loading

0 comments on commit fef347a

Please sign in to comment.