Skip to content

Commit c95be61

Browse files
committed
Added venv libs, changed readme
1 parent 9ee1674 commit c95be61

File tree

1,178 files changed

+292509
-24
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,178 files changed

+292509
-24
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -117,3 +117,6 @@ dmypy.json
117117

118118
# Pyre type checker
119119
.pyre/
120+
121+
#IDE
122+
.idea/

.idea/.gitignore

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/dictionaries/matth.xml

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/profiles_settings.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/usb_midi.iml

+10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

+26-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,29 @@
11
# USB MIDI Tool
2-
A lightweight, background tool which allows for connected MIDI devices to interact with each other over a USB connection.
2+
A lightweight, background tool which allows for connected MIDI devices to interact with each other over a USB
3+
connection.
34

5+
To get started, follow the instructions below:
46

7+
1. Ensure you have the newest version of Python 3 installed on your computer.
8+
2. Run start.pyw. No other installation is required but a config file will be generated the first time the tool is run.
9+
Instructions on editing the config file are found below. Simply re-run start.pyw for your config changes to take effect.
10+
3. Press ctrl+shift+f7 to show the program window and ctrl+shift+f8 to hide it.
11+
4. Disconnected MIDI devices can simply be disabled, but new devices ones will require config.txt to be deleted and
12+
generated again by running start.pyw.
13+
14+
###Editing config.txt:
15+
16+
**To disable a MIDI Device, add a '#' in front of its name:**
17+
18+
E.g. `Arturia MicroLab 1 -> #Arturia MicroLab 1`.
19+
20+
Remove the '#' to enable it again. Both actions require a restart of the program.
21+
22+
**Change the channel mode by setting 'mode' to either 0 or 1. The channel modes are:**
23+
24+
**0:** Your MIDI instruments should all be set to channel 1 and channel control is done by the USB MIDI tool software.
25+
26+
**1:** Your MIDI instruments should each be set to their own channel and channel control is done by the USB MIDI protocol.
27+
Change the MIDI channel of your MIDI controller to control each instrument with either mode.
28+
29+
**Do not edit config.txt in any other way!**

readme.txt

-22
This file was deleted.

start.pyw

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import subprocess
22

33
# Path to virtual environment Python executable
4-
python_bin = "venv/Scripts/python.exe"
4+
python_bin = "venv/scripts/python.exe"
55

66
# Path to script
77
script_file = "usb_midi.pyw"

venv/lib/site-packages/PyWin32.chm

2.54 MB
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
import sys
2+
import os
3+
import re
4+
import importlib
5+
import warnings
6+
7+
8+
is_pypy = '__pypy__' in sys.builtin_module_names
9+
10+
11+
def warn_distutils_present():
12+
if 'distutils' not in sys.modules:
13+
return
14+
if is_pypy and sys.version_info < (3, 7):
15+
# PyPy for 3.6 unconditionally imports distutils, so bypass the warning
16+
# https://foss.heptapod.net/pypy/pypy/-/blob/be829135bc0d758997b3566062999ee8b23872b4/lib-python/3/site.py#L250
17+
return
18+
warnings.warn(
19+
"Distutils was imported before Setuptools, but importing Setuptools "
20+
"also replaces the `distutils` module in `sys.modules`. This may lead "
21+
"to undesirable behaviors or errors. To avoid these issues, avoid "
22+
"using distutils directly, ensure that setuptools is installed in the "
23+
"traditional way (e.g. not an editable install), and/or make sure "
24+
"that setuptools is always imported before distutils.")
25+
26+
27+
def clear_distutils():
28+
if 'distutils' not in sys.modules:
29+
return
30+
warnings.warn("Setuptools is replacing distutils.")
31+
mods = [name for name in sys.modules if re.match(r'distutils\b', name)]
32+
for name in mods:
33+
del sys.modules[name]
34+
35+
36+
def enabled():
37+
"""
38+
Allow selection of distutils by environment variable.
39+
"""
40+
which = os.environ.get('SETUPTOOLS_USE_DISTUTILS', 'stdlib')
41+
return which == 'local'
42+
43+
44+
def ensure_local_distutils():
45+
clear_distutils()
46+
distutils = importlib.import_module('setuptools._distutils')
47+
distutils.__name__ = 'distutils'
48+
sys.modules['distutils'] = distutils
49+
50+
# sanity check that submodules load as expected
51+
core = importlib.import_module('distutils.core')
52+
assert '_distutils' in core.__file__, core.__file__
53+
54+
55+
def do_override():
56+
"""
57+
Ensure that the local copy of distutils is preferred over stdlib.
58+
59+
See https://github.com/pypa/setuptools/issues/417#issuecomment-392298401
60+
for more motivation.
61+
"""
62+
if enabled():
63+
warn_distutils_present()
64+
ensure_local_distutils()
65+
66+
67+
class DistutilsMetaFinder:
68+
def find_spec(self, fullname, path, target=None):
69+
if path is not None:
70+
return
71+
72+
method_name = 'spec_for_{fullname}'.format(**locals())
73+
method = getattr(self, method_name, lambda: None)
74+
return method()
75+
76+
def spec_for_distutils(self):
77+
import importlib.abc
78+
import importlib.util
79+
80+
class DistutilsLoader(importlib.abc.Loader):
81+
82+
def create_module(self, spec):
83+
return importlib.import_module('setuptools._distutils')
84+
85+
def exec_module(self, module):
86+
pass
87+
88+
return importlib.util.spec_from_loader('distutils', DistutilsLoader())
89+
90+
def spec_for_pip(self):
91+
"""
92+
Ensure stdlib distutils when running under pip.
93+
See pypa/pip#8761 for rationale.
94+
"""
95+
if self.pip_imported_during_build():
96+
return
97+
clear_distutils()
98+
self.spec_for_distutils = lambda: None
99+
100+
@staticmethod
101+
def pip_imported_during_build():
102+
"""
103+
Detect if pip is being imported in a build script. Ref #2355.
104+
"""
105+
import traceback
106+
return any(
107+
frame.f_globals['__file__'].endswith('setup.py')
108+
for frame, line in traceback.walk_stack(None)
109+
)
110+
111+
112+
DISTUTILS_FINDER = DistutilsMetaFinder()
113+
114+
115+
def add_shim():
116+
sys.meta_path.insert(0, DISTUTILS_FINDER)
117+
118+
119+
def remove_shim():
120+
try:
121+
sys.meta_path.remove(DISTUTILS_FINDER)
122+
except ValueError:
123+
pass
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__import__('_distutils_hack').do_override()
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
"""adodbapi - A python DB API 2.0 (PEP 249) interface to Microsoft ADO
2+
3+
Copyright (C) 2002 Henrik Ekelund, version 2.1 by Vernon Cole
4+
* http://sourceforge.net/projects/adodbapi
5+
"""
6+
import sys
7+
import time
8+
9+
if sys.version_info < (3,0): # in Python 2, define all symbols, just like the bad old way
10+
from .apibase import *
11+
VariantConversionMap = MultiMap # old name. Should use apibase.MultiMap
12+
from .ado_consts import *
13+
_makeByteBuffer = buffer
14+
else:
15+
# but if the user is running Python 3, then keep the dictionary clean
16+
from .apibase import apilevel, threadsafety, paramstyle
17+
from .apibase import Warning, Error, InterfaceError, DatabaseError, DataError, OperationalError, IntegrityError
18+
from .apibase import InternalError, ProgrammingError, NotSupportedError, FetchFailedError
19+
from .apibase import NUMBER, STRING, BINARY, DATETIME, ROWID
20+
_makeByteBuffer = bytes
21+
22+
from .adodbapi import connect, Connection, __version__, dateconverter, Cursor
23+
24+
def Binary(aString):
25+
"""This function constructs an object capable of holding a binary (long) string value. """
26+
return _makeByteBuffer(aString)
27+
28+
def Date(year,month,day):
29+
"This function constructs an object holding a date value. "
30+
return dateconverter.Date(year,month,day)
31+
32+
def Time(hour,minute,second):
33+
"This function constructs an object holding a time value. "
34+
return dateconverter.Time(hour,minute,second)
35+
36+
def Timestamp(year,month,day,hour,minute,second):
37+
"This function constructs an object holding a time stamp value. "
38+
return dateconverter.Timestamp(year,month,day,hour,minute,second)
39+
40+
def DateFromTicks(ticks):
41+
"""This function constructs an object holding a date value from the given ticks value
42+
(number of seconds since the epoch; see the documentation of the standard Python time module for details). """
43+
return Date(*time.gmtime(ticks)[:3])
44+
45+
def TimeFromTicks(ticks):
46+
"""This function constructs an object holding a time value from the given ticks value
47+
(number of seconds since the epoch; see the documentation of the standard Python time module for details). """
48+
return Time(*time.gmtime(ticks)[3:6])
49+
50+
def TimestampFromTicks(ticks):
51+
"""This function constructs an object holding a time stamp value from the given
52+
ticks value (number of seconds since the epoch;
53+
see the documentation of the standard Python time module for details). """
54+
return Timestamp(*time.gmtime(ticks)[:6])
55+
56+
version = 'adodbapi v' + __version__

0 commit comments

Comments
 (0)