Skip to content
Open
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
7 changes: 4 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ requires = ["flit_core >=2,<4"]
build-backend = "flit_core.buildapi"
[project]
dependencies=[
"dtactions~=1.6.4.dev3",
"natlinkcore >= 5.4.1"
"dtactions >=1.6.4",
"natlinkcore >= 5.4.2"
]
#
requires-python = ">=3.10"
name='vocola2'
authors = [{name = "Mark Lillibridge", email = "mdl@alum.mit.edu"}]
version="3.1.10.dev3"
version="3.1.11"
description="Vocola is a voice command language for creating commands to control a computer by voice "
keywords=["dragon","speech","dictation","dictation-toolbox","natlink", "dtactions"]
readme = "readme.md"
Expand Down
24 changes: 18 additions & 6 deletions src/vocola2/_vocola_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
SOFTWARE.
"""
#pylint:disable=W0614, W0613, C0116, C0321, W0603, W0401, C0115, C0412, W0201
#pylint:disable=E1101
#pylint:disable=E1101, W1203
import sys
import traceback
import os # access to file information
Expand All @@ -42,25 +42,28 @@
import subprocess
import re
import logging
from importlib.metadata import version, PackageNotFoundError
from pathlib import Path
import natlink
from natlinkcore import natlinkutils
from natlinkcore import readwritefile
from vocola2 import VocolaUtils
from vocola2 import natlinkvocolastartup # was natlinkstartup in natlinkmain...
from vocola2.exec.vcl2py.main import main_routine # main.main_routine compile function
from importlib.metadata import version
from pathlib import Path


#we don't know if it will be vocola2 or vocola or None
#depending on how this package is installed. So
#depending on how this package is installed or run. So
#check the path if no __package__ specified.


packageName = __package__ if __package__ is not None else \
Path(__file__).parent.name

thisVersion=version(packageName) #get the version of this package.
thisDir = os.path.split(__file__)[0]
loaded_as_package = __package__ is not None

thisVersion = version(packageName) if loaded_as_package else "unknown (not loaded as package)"
thisDir = os.path.split(__file__)[0]
##########################################################################
# #
# Configuration #
Expand All @@ -74,8 +77,17 @@
Quintijn_installer = True
status = natlinkstatus.NatlinkStatus()

if not loaded_as_package:
try:
vocola2Version=version("vocola2")
except PackageNotFoundError:
vocola2Version = "unknown"
thisVersion += f"\nvocola2 version known to be: {vocola2Version}"

## when natlinkmain is already there, the Logger and Config variables are ignored...
Logger = logging.getLogger('natlink')
Logger.debug(f"Vocala starting version: {thisVersion}\nSource file {__file__}")

Logger.debug(f'checking if Vocola is enabled')
Config = config.NatlinkConfig.from_first_found_file(loader.config_locations())
natlinkmain = loader.NatlinkMain(Logger, Config)
Expand Down