Skip to content

Commit aed98b8

Browse files
author
Anthony Oliver
committed
Trying to get launch script working for windows
1 parent 41f51bf commit aed98b8

2 files changed

Lines changed: 28 additions & 17 deletions

File tree

SimpleCV/Shell/Shell.py

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import subprocess
2626
import time
2727
import webbrowser
28+
import sys
2829

2930
#Load simpleCV libraries
3031
from SimpleCV.Shell.Tutorial import *
@@ -180,23 +181,28 @@ def run_notebook():
180181

181182
def main(*args):
182183

184+
print "args:",sys.argv
185+
186+
#~ args = sys.argv
187+
#~ import pdb;pdb.set_trace()
188+
#~ import pdb;pdb.set_trace()
183189
log_level = logging.WARNING
184-
if len(args) and len(args[0]) > 1:
185-
for flag in args[0]:
186-
if flag == "notebook" and IPVER > 10:
187-
run_notebook()
188-
sys.exit()
189-
190-
if flag in ["--headless","headless"]:
191-
# set SDL to use the dummy NULL video driver,
192-
# so it doesn't need a windowing system.
193-
os.environ["SDL_VIDEODRIVER"] = "dummy"
194-
195-
elif flag in ['--nowarnings','nowarnings']:
196-
log_level = logging.INFO
197-
198-
elif flag in ['--debug','debug']:
199-
log_level = logging.DEBUG
190+
if len(sys.argv) > 1 and len(sys.argv[1]) > 1:
191+
flag = sys.argv[1]
192+
if flag == "notebook" and IPVER > 10:
193+
run_notebook()
194+
sys.exit()
195+
196+
if flag in ["--headless","headless"]:
197+
# set SDL to use the dummy NULL video driver,
198+
# so it doesn't need a windowing system.
199+
os.environ["SDL_VIDEODRIVER"] = "dummy"
200+
201+
elif flag in ['--nowarnings','nowarnings']:
202+
log_level = logging.INFO
203+
204+
elif flag in ['--debug','debug']:
205+
log_level = logging.DEBUG
200206

201207
init_logging(log_level)
202208
shellclear()

setup.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@
4040
'examples/tracking/*'
4141
],
4242
},
43-
scripts=['scripts/simplecv']
43+
#~ scripts=['scripts/simplecv'],
44+
entry_points={
45+
'console_scripts': [
46+
'simplecv = SimpleCV.Shell:main',
47+
],
48+
},
4449

4550
)

0 commit comments

Comments
 (0)