diff --git a/.gitignore b/.gitignore index 6f902533..36b04325 100644 --- a/.gitignore +++ b/.gitignore @@ -2,5 +2,5 @@ node_modules/ dist/ /app/ *.pyc -src/python/build -src/python/__pycache__ +src/server/python/build +src/server/python/__pycache__ diff --git a/scripts/server.rollup.config.js b/scripts/server.rollup.config.js index 960e1690..f1c5b872 100644 --- a/scripts/server.rollup.config.js +++ b/scripts/server.rollup.config.js @@ -55,7 +55,7 @@ module.exports = { targets: [ {src: 'src/app/index.js', dest: 'app/'}, {src: 'src/server/index.js', dest: 'app/server/'}, - {src: 'src/python/*', dest: 'app/server/python/'}, + {src: 'src/server/python/*', dest: 'app/server/python/'}, {src: 'node_modules/fsevents/fsevents.node', dest: 'app/server/'}, {src: 'LICENSE', dest: 'app/'}, {src: 'package.json', dest: 'app/'}, diff --git a/src/server/node/midi.js b/src/server/node/midi.js index ebd70546..3dfc18be 100644 --- a/src/server/node/midi.js +++ b/src/server/node/midi.js @@ -4,7 +4,9 @@ import path from 'path' import * as settings from './settings' -var scriptPath = path.resolve(__dirname, '../python') +var scriptPath = __dirname.includes('server/node') ? + path.resolve(__dirname, '../python') : // src folder structure + path.resolve(__dirname, './python') // app folder structure with rollup chunking var midiBinaries = { x64: { @@ -17,7 +19,7 @@ var midiBinaries = { } } -var expectMidiBinaries = fs.existsSync(path.resoluve(scriptPath, '/.expect-midi-bin')), +var expectMidiBinaries = fs.existsSync(path.resolve(scriptPath, './.expect-midi-bin')), expectMidiBinariesError = false var pythonPathOverride @@ -36,7 +38,7 @@ class MidiConverter { if (expectMidiBinariesError) MidiConverter.midiBinariesError() - this.py = new PythonShell('python/midi.py', Object.assign({ + this.py = new PythonShell('midi.py', Object.assign({ args: [ '--params', settings.read('debug') ? 'debug' : '', @@ -124,7 +126,7 @@ class MidiConverter { if (expectMidiBinariesError) MidiConverter.midiBinariesError() - PythonShell.run('python/midi.py', Object.assign({pythonPath: MidiConverter.getPythonPath(), args: ['--params', 'list-only']}, {scriptPath, mode:'text'}), function(e, results) { + PythonShell.run('midi.py', Object.assign({pythonPath: MidiConverter.getPythonPath(), args: ['--params', 'list-only']}, {scriptPath, mode:'text'}), function(e, results) { if (e) { if (e.code === 'ENOENT') { console.error(`(ERROR, MIDI) Could not find python binary: ${e.message.replace(/spawn (.*) ENOENT/, '$1')}`) diff --git a/src/python/head.py b/src/server/python/head.py similarity index 100% rename from src/python/head.py rename to src/server/python/head.py diff --git a/src/python/list.py b/src/server/python/list.py similarity index 100% rename from src/python/list.py rename to src/server/python/list.py diff --git a/src/python/main.py b/src/server/python/main.py similarity index 100% rename from src/python/main.py rename to src/server/python/main.py diff --git a/src/python/midi.py b/src/server/python/midi.py similarity index 100% rename from src/python/midi.py rename to src/server/python/midi.py diff --git a/src/python/mtc.py b/src/server/python/mtc.py similarity index 100% rename from src/python/mtc.py rename to src/server/python/mtc.py diff --git a/src/python/requirements.txt b/src/server/python/requirements.txt similarity index 100% rename from src/python/requirements.txt rename to src/server/python/requirements.txt diff --git a/src/python/rpn.py b/src/server/python/rpn.py similarity index 100% rename from src/python/rpn.py rename to src/server/python/rpn.py diff --git a/src/python/utils.py b/src/server/python/utils.py similarity index 100% rename from src/python/utils.py rename to src/server/python/utils.py