Skip to content

Commit

Permalink
public testing release
Browse files Browse the repository at this point in the history
  • Loading branch information
mkupferman committed Feb 7, 2021
0 parents commit 68c5f85
Show file tree
Hide file tree
Showing 9 changed files with 665 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
nfo
*.pyc
__pycache__/
*.egg-info/
venv/
.DS_Store
data/
tmp/
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021 Matt Kupferman <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
all: build

build:
bash build.sh

clean:
rm -rf ./*.egg-info ./__pycache__/ ./*/__pycache__/ ./venv/
50 changes: 50 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# lv1-report

Report generator for Waves eMotion LV1 sessions.

This script extracts information from saved session (.emo) files for reference outside of the LV1 software.

As of this release, it supports the export of routing/patching information (Inputs, Outputs, and Device-to-Device routing) exported to an Excel (.xlsx) file.

## Requirements

- A UNIX-like environemnt, such as:
- Linux
- macOS X
- Windows running Git Bash
- Python (3.5 or greater)
- virtualenv support preferred
- in Windows, be sure you chose to add python to PATH at installation. Furthermore, in Windows 10, you may need to 'Manage app execution aliases' and uncheck the Python options.
- A session (.emo) file from Waves eMotion LV1, version 11 or greater.

## Installation

sh build.sh
# in Linux/macOS/etc:
source venv/bin/activate

# in Windows:
source venv/Scripts/activate

## Usage

lv1report [OPTIONS] SESSION_FILE
Options:
-f, --report-file PATH Specify report file path, otherwise one will be
generated in the same directory as the session file.

## Examples

lv1report "/c/Users/Public\Waves Audio\eMotion\Sessions/my_last_show.emo"

This will read the session "my_last_show.emo" from the default session location in Windows.
It will then create an Excel file in the same folder, based on the name "my_last_show", along with the current date & time.

lv1report /Users/Shared/Waves/eMotion/Sessions/my_last_show.emo -f ~/Desktop/my_report.xlsx

This will read the session "my_last_show.emo" from the default session location on a Mac.
It will then create an Excel file called "my_report.xlsx" on the Desktop.

## Notes

If you are running this in a python virtual environment (the default if you run build.sh to install), be sure you activate it ("source venv...") before running lv1-report!
51 changes: 51 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/bin/sh

if which python3 >/dev/null; then
pyexec=python3
elif which python >/dev/null; then
vers=$(python --version 2>&1)
if [[ "${vers}" == "Python 3."* ]]; then
pyexec=python
else
echo "Could not find python >= 3 in PATH"
exit 1
fi
else
echo "Could not find python >= 3 in PATH"
exit 1
fi

# try to set up virtualenv
$pyexec -m virtualenv venv

# venv not created
if [ ! -d ./venv ]; then
$pyexec -m pip install --user virtualenv
$pyexec -m virtualenv venv

if [ ! -d ./venv ]; then
echo "ERROR: Unable to create python virtualenv"
exit 1
fi
fi

if [ -f ./venv/bin/pip ]; then
pipexec=./venv/bin/pip
activateexec=./venv/bin/activate
elif [ -f ./venv/Scripts/pip ]; then
pipexec=./venv/Scripts/pip
activateexec=./venv/Scripts/activate
else
echo "ERROR: Unable to find python pip in virtualenv"
exit 1
fi

$pipexec install --editable .

echo
if [ -f $activateexec ]; then
echo "Installed. Activate environment with: source $activateexec"
else
echo "ERROR: Unable to find virtualenv activate script"
exit 1
fi
34 changes: 34 additions & 0 deletions lv1report.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/env python3

import os
import sys
import time
import click
from pathlib import Path, PurePath
from pylv1emo import Lv1Session, Lv1ExcelExporter


@click.command()
@click.argument('session-file', type=click.Path(exists=True))
@click.option('--report-file', '-f', default=None, type=click.Path(),
help='Specify report file path, otherwise one will be generated in the same directory as the session file.')
def lv1report(session_file, report_file):
session_path = Path(session_file)
session_ppath = PurePath(session_path)

if report_file is None:
session_directory = session_ppath.parent
session_filename = session_ppath.name
session_stem = session_ppath.stem
report_filename = '%s-%s.xlsx' % (session_stem,
time.strftime('%Y%m%dT%H%M%S'))
report_path = Path(session_directory / report_filename)
else:
report_path = Path(report_file)

print("Reading session %s" % session_path, file=sys.stderr)
session = Lv1Session(session_path)

print("Writing report to %s" % report_path, file=sys.stderr)
report = Lv1ExcelExporter(session)
report.writeFile(report_path)
Loading

0 comments on commit 68c5f85

Please sign in to comment.