-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathvim
executable file
·42 lines (30 loc) · 1.16 KB
/
vim
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
#!/usr/bin/env python
import sys, optparse, subprocess, urllib2, os, os.path, errno, zipfile, string, json, platform, shutil, tarfile, urlparse, tempfile, multiprocessing
from subprocess import Popen, PIPE
import argparse
import sys
def callWithoutPrint(cmdline):
ret = subprocess.call(cmdline, shell=True)
if ret != 0:
print >> sys.stderr, 'Running: ' + cmdline + ' failed with exit code ' + str(ret) + '!'
return ret
def call(cmdline):
print 'Running: ' + cmdline
callWithoutPrint(cmdline)
class VimExec(object):
def __init__(self):
parser = argparse.ArgumentParser( description='WeedVision');
parser.add_argument('command', help='Subcommand to run'
, choices=['vim_f5', 'vim_f6', 'vim_f7', 'vim_f8']);
args = parser.parse_args(sys.argv[1:2])
if not hasattr(self, args.command):
print 'Unrecognized command'
parser.print_help()
exit(1)
getattr(self, args.command)()
def vim_f5(self):
call('cd build; cmake .. && make -j4 && ./rtk_agri');
def vim_f6(self):
call('./weedvision vim_f6');
if __name__ == '__main__':
VimExec()