-
Notifications
You must be signed in to change notification settings - Fork 74
Git REALLY hates me version. More changes thn you can poke a stick at #82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from 75 commits
457b238
f95184d
268f2f3
f8f928c
f3d5801
ba40877
2ca6d0e
f768b7a
cf99b9e
9aaf1c1
d443439
68ec660
53aa082
850cbc1
11df3cf
e41c5e1
822d941
95b6500
1340b52
55818fa
eb994e5
0b0d705
47116b8
cf6b4f0
b3ec50e
c943251
b34610b
225938c
3b951f5
3c09c39
6992e78
e6aa5ad
ca71833
cd16831
ff83025
4f74e00
cf42a80
56bd596
7b9ff51
2e98c34
8035898
51fe6bf
3bac574
1cb24de
66392dd
b89aaf8
6cc1149
107303b
c497ab2
03e96d2
779fb23
b11875d
3f2742b
33c5c7c
2472f85
119c96c
6ae9286
bb8e066
47cdfed
a24ac5b
18cadc4
69db3ec
1fea76f
c4c5210
340a747
5b0bd2f
88379a2
7dd7714
080b78c
1a5fc36
2ba338b
b3c57a0
1802032
89d3d2a
e559585
12aa79e
e6a6877
f4829aa
0c0170b
6b54798
4814416
c462c1e
43c3467
3494ebb
9baae68
da20398
42e6831
75f363d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,3 +18,6 @@ dependencies: | |
| - pytesseract | ||
| - imagehash | ||
| - dhash | ||
| - selenium | ||
| - pyperclip | ||
| - python-dateutils | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,3 +17,6 @@ dependencies: | |
| - pytesseract | ||
| - imagehash | ||
| - dhash | ||
| - selenium | ||
| - pyperclip | ||
| - python-dateutils | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| import sys, os, subprocess, argparse | ||
| import sys, os, subprocess, argparse, global_vars | ||
| from datetime import datetime | ||
| from constants import * | ||
|
|
||
|
|
@@ -10,7 +10,7 @@ | |
| if getattr(sys, 'frozen', False): | ||
| IS_EXE = True | ||
| PROG_FILE = sys.executable | ||
| PROG_PATH = os.path.dirname(PROG_FILE) | ||
| PROG_PATH = os.path.dirname(PROG_FILE) | ||
| PATH = sys._MEIPASS | ||
| else: | ||
| IS_EXE = False | ||
|
|
@@ -65,10 +65,10 @@ def datetime_str(): | |
|
|
||
| # Try to import launchpad.py | ||
| try: | ||
| import launchpad_py as launchpad | ||
| import launchpad_py as launchpad_real | ||
| except ImportError: | ||
| try: | ||
| import launchpad | ||
| import launchpad as launchpad_real | ||
| except ImportError: | ||
| sys.exit("[LPHK] Error loading launchpad.py") | ||
| print("") | ||
|
|
@@ -79,7 +79,17 @@ def datetime_str(): | |
| # just import the control modules to automatically integrate them | ||
| import command_list | ||
|
|
||
| lp = launchpad.Launchpad() | ||
|
|
||
| # create a launchpad object, either real or fake | ||
| def Launchpad(): | ||
| if window.IsStandalone(): | ||
| import launchpad_fake | ||
| return launchpad_fake.launchpad | ||
| else: | ||
| return launchpad_real.Launchpad() | ||
|
|
||
|
|
||
| LP = None | ||
|
|
||
| EXIT_ON_WINDOW_CLOSE = True | ||
|
|
||
|
|
@@ -88,51 +98,74 @@ def init(): | |
|
|
||
| ap = argparse.ArgumentParser() # argparse makes argument processing easy | ||
| ap.add_argument( # reimnplementation of debug (-d or --debug) | ||
| "-d", "--debug", | ||
| help = "turn on debugging mode", action="store_true") | ||
| ap.add_argument( # new option to automatically load a layout | ||
| "-l", "--layout", | ||
| help = "load a layout", | ||
| "-d", "--debug", | ||
| help = "Turn on debugging mode", action="store_true") | ||
| ap.add_argument( # option to automatically load a layout | ||
| "-l", "--layout", | ||
| help = "Load an initial layout", | ||
| type=argparse.FileType('r')) | ||
| ap.add_argument( # new option to start minimised | ||
| "-m", "--minimised", | ||
| ap.add_argument( # option to start minimised | ||
| "-m", "--minimised", | ||
| help = "Start the application minimised", action="store_true") | ||
|
|
||
| window.ARGS = vars(ap.parse_args()) # store the arguments in a place anything can get to | ||
|
|
||
| if window.ARGS['debug']: | ||
| ap.add_argument( # option to start without connecting to a Launchpad | ||
| "-s", "--standalone", | ||
| help = "Operate without connection to Launchpad", type=str, choices=[LP_MK1, LP_MK2, LP_MINI, LP_PRO]) | ||
| ap.add_argument( # option to start with launchpad window in a particular mode | ||
| "-M", "--mode", | ||
| help = "Launchpad mode", type=str, choices=[LM_EDIT, LM_MOVE, LM_SWAP, LM_COPY, LM_DEL, LM_RUN], default=LM_EDIT) | ||
| ap.add_argument( # turn of unnecessary verbosity | ||
| "-q", "--quiet", | ||
| help = "Disable information popups", action="store_true") | ||
| ap.add_argument( # make button text variable in size (default is small) | ||
| "-f", "--fit", | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe make this the default?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are you talking about -q or -f? I see no reason not to make -f the default, and even to remove the option for all-the-same-size annotation text. (just discovered this comment thing!)
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah the f (and there are loads more comments ;) )
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, OK. I misread "yeah the f" as something other than "yeah the -f option" :-D I will make it the default in my next commit. |
||
| help = "Make short button text fit the button", action="store_true") | ||
|
|
||
| global_vars.ARGS = vars(ap.parse_args()) # store the arguments in a place anything can get to | ||
|
|
||
| if global_vars.ARGS['debug']: | ||
| EXIT_ON_WINDOW_CLOSE = False | ||
| print("[LPHK] Debugging mode active! Will not shut down on window close.") | ||
| print("[LPHK] Run shutdown() to manually close the program correctly.") | ||
|
|
||
| files.init(USER_PATH) | ||
| sound.init(USER_PATH) | ||
|
|
||
| global LP | ||
| LP = Launchpad() | ||
|
|
||
| def shutdown(): | ||
| if lp_events.timer != None: # cancel any outstanding events | ||
| lp_events.timer.cancel() | ||
|
|
||
| scripts.to_run = [] # remove anything from the list of scripts scheduled to run | ||
|
|
||
| for x in range(9): | ||
| for y in range(9): | ||
| if scripts.buttons[x][y].thread != None: | ||
| scripts.buttons[x][y].thread.kill.set() # request to kill any running threads | ||
| if window.lp_connected: | ||
|
|
||
| if window.lp_connected or window.IsStandalone: | ||
| scripts.Unbind_all() # unbind all the buttons | ||
| lp_events.timer.cancel() # cancel all the timers | ||
| launchpad_connector.disconnect(lp) # disconnect from the launchpad | ||
| if LP != None and LP != -1: | ||
| launchpad_connector.disconnect(LP) # disconnect from the launchpad | ||
| window.lp_connected = False | ||
|
|
||
| logger.stop() # stop logging | ||
|
|
||
| if window.restart: | ||
| window.restart = False # don't do this forever | ||
| if IS_EXE: | ||
| os.startfile(sys.argv[0]) | ||
| else: | ||
| os.execv(sys.executable, ["\"" + sys.executable + "\""] + sys.argv) | ||
|
|
||
| sys.exit("[LPHK] Shutting down...") | ||
|
|
||
|
|
||
| def main(): | ||
| init() | ||
| window.init(lp, launchpad, PATH, PROG_PATH, USER_PATH, VERSION, PLATFORM) | ||
| window.init(LP, PATH, PROG_PATH, USER_PATH, VERSION, PLATFORM) | ||
| if EXIT_ON_WINDOW_CLOSE: | ||
| shutdown() | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| 0.3.1 | ||
| 0.3.2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What exactly does this do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It starts the program in the specified mode. The default is starting it up in edit mode, so that clicking on a button will start the editor. However, if you're operating without a launchpad, it makes more sense to start in run mode, so that clicking on a button will execute the macro. I always start mine in run mode now. The other modes are there just so you can chose one of them if you have a reason to,