forked from duembeg/gsat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gsat.py
executable file
·88 lines (65 loc) · 3.06 KB
/
gsat.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#!/usr/bin/env python
"""----------------------------------------------------------------------------
gsat.py:
Copyright (C) 2013-2014 Wilhelm Duembeg
This file is part of gsat. gsat is a cross-platform GCODE debug/step for
Grbl like GCODE interpreters. With features similar to software debuggers.
Features such as breakpoint, change current program counter, inspection
and modification of variables.
gsat is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
gsat is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with gsat. If not, see <http://www.gnu.org/licenses/>.
----------------------------------------------------------------------------"""
__appname__ = "Gcode Step and Alignment Tool"
__description__ = \
"GCODE Step and Alignment Tool (gsat) is a cross-platform GCODE debug/step for "\
"Grbl like GCODE interpreters. With features similar to software debuggers. Features "\
"Such as breakpoint, change current program counter, inspection and modification "\
"of variables."
import os
import sys
import wx
from optparse import OptionParser
import modules.mainwnd as mw
"""----------------------------------------------------------------------------
get_cli_params
Get and process command line parameters.
----------------------------------------------------------------------------"""
def get_cli_params():
''' define, retrieve and error check command line interface (cli) params
'''
usage = \
"usage: %prog [options]"
parser = OptionParser(usage=usage)
parser.add_option("-c", "--config", dest="config",
help="Use alternate configuration file name, location will be in HOME folder regardless of file name.", metavar="FILE")
parser.add_option("-v", "--verbose",
dest="verbose", action="store_true", default=False,
help="print extra information while processing input file.")
parser.add_option("--vv", "--vverbose",
dest="vverbose", action="store_true", default=False,
help="print extra extra information while processing input file.")
(options, args) = parser.parse_args()
# check arguments sanity
if options.vverbose:
options.verbose = True
if not wx.VERSION >= (2,8,0,0):
print "** Required wxPython 2.7 or grater."
options.error()
error(1)
return (options, args)
"""----------------------------------------------------------------------------
main
----------------------------------------------------------------------------"""
if __name__ == '__main__':
(cmd_line_options, cli_args) = get_cli_params()
app = wx.App(0)
mw.gsatMainWindow(None, title=__appname__, cmd_line_options=cmd_line_options)
app.MainLoop()