Skip to content

Commit

Permalink
Merge pull request #3 from dictation-toolbox/master
Browse files Browse the repository at this point in the history
grab latest
  • Loading branch information
dougransom authored Feb 18, 2021
2 parents adf8c97 + 8e7dd56 commit 3f21376
Show file tree
Hide file tree
Showing 394 changed files with 1,184 additions and 714 deletions.
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*.pyc
/actionclasses/*.pyc
__pycache__/
/grammar.bin
/unimacro_test/*.pyc
/actionclasses/__pycache__/*.pyc
*.bak
__pycache__
/unimacro_test/testresult.txt
/_number extended.py
/_repeat.py
.vscode/launch.json
/dist
/configurenatlink_error.txt
/README.html
File renamed without changes.
2 changes: 2 additions & 0 deletions Packaging Python Projects — Python Packaging User Guide.url
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[InternetShortcut]
URL=https://packaging.python.org/tutorials/packaging-projects/
57 changes: 53 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,55 @@
This is the repository which was previously with subversion on sourceforge.net.
# Unimacro
The Unimacro project aims to provide a rich set of command grammars, that can be configured by the users without programming knowledge.
Read more at [Natlink, including Unimacro and Vocolaa](https://qh.antenna.nl/unimacro/index.html)

# Installing

Unimacro is reasonably stable, but still in alpha. Check the [Unimacro Issues](https://github.com/dictation-toolbox/unimacro/issues) to see the problem
areas - probably nothing you can't live without.



## Install a prerelease of [Python for Win 32](https://github.com/mhammond/pywin32)
The latest the version of [Python for Win 32](https://github.com/mhammond/pywin32) in the Python Packing Index (300) has some bugs that affect Unimacro.
So you need to install a later version.

You can download can updated pywin32 from https://github.com/mhammond/pywin32/pull/1622/checks, click on Artifacts, download the artifacts, extract the files to your computer somehwhere.

In a shell with administrator privileges,
`pip install --force-reinstall .\pywin32-300.1-cp38-cp38-win32.whl`.

## Install unimacro

Install from the [Test Python Package Index](https://test.pypi.org/)
with the following.

`pip install --no-cache --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple unimacro`


# Location of Grammars

Grammars installed with Unimacro will be installed in:
the Lib\site-packages\unimacro\UnimacroGrammars sub-directory of your
Python installation. Good ones to start with include _folders.py and _clickbyvoice.py
as most users will find web and file system navigation by voice useful.

More about [Unimacro Grammars](https://qh.antenna.nl/unimacro/grammars/globalgrammars/folders/index.html)

# Developer instructions.

Follow the instructions for [Natlink](https://test.pypi.org/project/natlinkpy/), replacing 'natlink' with 'unimacro'.
The same commands for building packages and publishing are available in the unimacro root.

If you wish to build or publish a package, there are:

- build_package.ps1 and build_package.ps1 to build the packages.
- publish_package_pypi.ps1/.cmd to upload the package to the [Python Packaging Index](https://pypi.org/)
- publish_package_testpypi.ps1/.cmd to upload the packkage to the [Test Python Packaging Index](https://test.pypi.org/)







Information about this project, which goes together with Natlink2, on
https://qh.antenna.nl/unimacro/index.html

Quintijn Hoogenboom, Sept 27, 2019.
2 changes: 2 additions & 0 deletions Why use Flit- — Flit 3.0.0 documentation.url
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[InternetShortcut]
URL=https://flit.readthedocs.io/en/latest/rationale.html
1 change: 0 additions & 1 deletion __init__.py

This file was deleted.

149 changes: 0 additions & 149 deletions actionclasses/komodo-actions.py

This file was deleted.

1 change: 1 addition & 0 deletions build_package.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
flit build --format sdist --no-setup-py
4 changes: 4 additions & 0 deletions build_package.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#build an sdist (source distribution) package for unimacro
#no wheel is built, one less thing to worry about
#use the no-setup option, which requires a
flit build --format sdist --no-setup-py
64 changes: 64 additions & 0 deletions building_and_publishing_packages.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@


Packages are build without a setup.py, and source only, as any PIP recent enough will be PEP517 compliant.
Flit is the simplest packaging tool that will work. Read about it here https://flit.readthedocs.io/en/latest/cmdline.html.

Getting Ready to Publish a Package.
9
Get your credentials for pypi and testpypi and add them to your ~\.pypirc. ~\.pypirc
seems very finicky even though it looks like a text file. If publishing to pypi or testpypi is
new it is suggested you copy pypirc_template to ~/.pypirc and add your token from your accounts for PyPi/TestPyPi.
(see in the natlink repository for this template)

Customizing the Package for PyPi:

Read https://flit.readthedocs.io/en/latest/pyproject_toml.html to see how to customize the description on PyPi,
licensing, etc.

To build a package:

Ensure you have flit ("pip install flit")

Update the version number of the package. Make the number bigger in src/unimacro/__init__.py than it was the last time
a package was uploaded to TestPypi or PyPi. Flit uses that number as the release number on pypi.

Start a power shell in the root of your git clone. if you are used to command shell, type "powershell" and that
will launch a windows powershell.

enter the command "build-package". That should work. if you have untraccked git files you need to
address them by addding to .gitignore or adding to git.


To test a package.

If that works, and you want to see if it works, i suggest uploading to testpypi.
use the powershell command:

publish_package_testpypi

if it publishes, then you will see the updated version number in natlink on testpypi https://test.pypi.org/search/?q=natlink

Now install it using pip with this:

pip --no-cache install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple unimacro

Remove any local projects for natlink from any Python Path variables, so that the version in site-packages gets loaded by
natlink. You can rename your dictation-toolbox root temporarily below which natlink lies, or your can temporarily rename
natlink to something like dev_natlink.



To Publish a Package on PyPi after testing.

You can't undo publishing a package on PyPi, so get it working on TestPyPi first.

Then publish to testpypi using publish_package_pypy in powershell.









5 changes: 5 additions & 0 deletions compile_README.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@echo for testing the README.md.
@echo the outpout is not used for publishing. it is only so you know your README.md will
@echo compile ok before publishing with flit.

python -m markdown README.md > README.html
Binary file added fix_pywin32/pywin32-300.1-cp37-cp37m-win32.whl
Binary file not shown.
Binary file added fix_pywin32/pywin32-300.1-cp38-cp38-win32.whl
Binary file not shown.
2 changes: 2 additions & 0 deletions packaging instructions.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
To create the package for upload to PyPy etc,
run the powershell script build_package.ps1
1 change: 1 addition & 0 deletions publish_package_pypi.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
flit publish --format sdist --no-setup-py --repository pypi
4 changes: 4 additions & 0 deletions publish_package_pypi.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#build an sdist (source distribution) package for unimacro
#no wheel is built, one less thing to worry about
#use the no-setup option, which requires a
flit publish --format sdist --no-setup-py --repository pypi
1 change: 1 addition & 0 deletions publish_package_tesetpypi.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
flit publish --format sdist --no-setup-py --repository testpypi
4 changes: 4 additions & 0 deletions publish_package_testpypi.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#build an sdist (source distribution) package for unimacro
#no wheel is built, one less thing to worry about
#use the no-setup option, which requires a
flit publish --format sdist --no-setup-py --repository testpypi
27 changes: 27 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[build-system]
requires = ["flit_core >=2,<4"]
build-backend = "flit_core.buildapi"

[tool.flit.metadata]
module="unimacro"
author = "Quintijn Hoogenboom"
author-email = "[email protected]"
home-page = "https://qh.antenna.nl/unimacro/"
description-file = "README.md"

requires=["natlink",
"debugpy >= 1.2.0",
"pywin32 >= 300"]


classifiers=[ "Development Status :: 4 - Beta",
"Topic :: Multimedia :: Sound/Audio :: Speech",
"Topic :: Scientific/Engineering :: Human Machine Interfaces",
]

requires-python = ">=3.8"
keywords="dragon,speech,dictation,dictation-toolobx,unimacro,natlink"

[tool.flit.scripts]


File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2711,8 +2711,8 @@ def makeFromTemplateAndExecute(unimacrofolder, templatefile, unimacrogrammarsfol

outputpath = os.path.join(unimacrogrammarsfolder, outputfile)
readwritefile.writeAnything(outputpath, encoding, bom, Text)
print('wrote to: %s'% outputfile)
print(f'output dialog: {outputpath}, python: {pythonexe}')
# print('wrote to: %s'% outputfile)
# print(f'output dialog: {outputpath}, python: {pythonexe}')
UnimacroBringUp(pythonexe.normpath(), outputpath)


Expand Down
Loading

0 comments on commit 3f21376

Please sign in to comment.