Mercurial > hg > config
annotate python/install_config.py @ 860:af998083be84
add ssh keys
author | Jeff Hammel <k0scist@gmail.com> |
---|---|
date | Sat, 14 Apr 2018 16:01:05 -0700 |
parents | 1259f9d79961 |
children | c4044724689a |
rev | line source |
---|---|
1 | 1 #!/usr/bin/env python |
234
761e7dfc675e
updates from most recent usage
Jeff Hammel <jhammel@mozilla.com>
parents:
219
diff
changeset
|
2 |
1 | 3 """ |
4 installs config to a user's home directory | |
5 this can be done with | |
16 | 6 curl http://k0s.org/hg/config/raw-file/tip/python/install_config.py | python |
1 | 7 """ |
8 | |
579
f894bd779943
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
578
diff
changeset
|
9 # TODO: |
f894bd779943
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
578
diff
changeset
|
10 # - dl and get ~/web/sync.ini : |
f894bd779943
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
578
diff
changeset
|
11 # ln -s /home/jhammel/web/sync.ini /home/jhammel/.silvermirror |
f894bd779943
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
578
diff
changeset
|
12 # - handle cases where config is autogenerated BUT you still want |
f894bd779943
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
578
diff
changeset
|
13 # to have some base (e.g. .gkrellm2/user_config) |
591
542d329835ec
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
590
diff
changeset
|
14 # - scp k0s.org:~/web/sync.ini ~/.silvermirror |
542d329835ec
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
590
diff
changeset
|
15 # - make idempotent |
595
4b79ee6c8539
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
594
diff
changeset
|
16 # - step to install (and setup) firefox |
579
f894bd779943
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
578
diff
changeset
|
17 |
f894bd779943
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
578
diff
changeset
|
18 # imports |
218 | 19 import imp |
408 | 20 import optparse |
1 | 21 import os |
131
52cf3e146a4c
make the install script slightly nicer
Jeff Hammel <jhammel@mozilla.com>
parents:
130
diff
changeset
|
22 import subprocess |
6 | 23 import sys |
131
52cf3e146a4c
make the install script slightly nicer
Jeff Hammel <jhammel@mozilla.com>
parents:
130
diff
changeset
|
24 |
579
f894bd779943
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
578
diff
changeset
|
25 # globals |
590
e93b81d8a586
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
584
diff
changeset
|
26 SRC = 'http://k0s.org/hg/config' # config repository |
e93b81d8a586
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
584
diff
changeset
|
27 HOME = os.environ['HOME'] # home directory |
1 | 28 |
591
542d329835ec
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
590
diff
changeset
|
29 |
410 | 30 ### standalone functions |
31 | |
591
542d329835ec
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
590
diff
changeset
|
32 def class_mapping(_type): |
846
1259f9d79961
[BBB] we still in 2017 need py26 sometimes
Jeff Hammel <k0scist@gmail.com>
parents:
738
diff
changeset
|
33 """ |
1259f9d79961
[BBB] we still in 2017 need py26 sometimes
Jeff Hammel <k0scist@gmail.com>
parents:
738
diff
changeset
|
34 returns a dict of (name, class) for objects |
1259f9d79961
[BBB] we still in 2017 need py26 sometimes
Jeff Hammel <k0scist@gmail.com>
parents:
738
diff
changeset
|
35 in the current globals() of _type |
1259f9d79961
[BBB] we still in 2017 need py26 sometimes
Jeff Hammel <k0scist@gmail.com>
parents:
738
diff
changeset
|
36 """ |
1259f9d79961
[BBB] we still in 2017 need py26 sometimes
Jeff Hammel <k0scist@gmail.com>
parents:
738
diff
changeset
|
37 |
1259f9d79961
[BBB] we still in 2017 need py26 sometimes
Jeff Hammel <k0scist@gmail.com>
parents:
738
diff
changeset
|
38 return dict([(name,cls) |
1259f9d79961
[BBB] we still in 2017 need py26 sometimes
Jeff Hammel <k0scist@gmail.com>
parents:
738
diff
changeset
|
39 for name, cls in globals().items() if |
1259f9d79961
[BBB] we still in 2017 need py26 sometimes
Jeff Hammel <k0scist@gmail.com>
parents:
738
diff
changeset
|
40 cls.issubclass(_type)]) |
591
542d329835ec
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
590
diff
changeset
|
41 |
542d329835ec
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
590
diff
changeset
|
42 |
590
e93b81d8a586
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
584
diff
changeset
|
43 def execute(*commands, **kwargs): |
131
52cf3e146a4c
make the install script slightly nicer
Jeff Hammel <jhammel@mozilla.com>
parents:
130
diff
changeset
|
44 """execute a series of commands""" |
29
8344c7a9847c
install smartopen by default and some other cleanup (untested)
Jeff Hammel <k0scist@gmail.com>
parents:
22
diff
changeset
|
45 for command in commands: |
619
fd50f457185c
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
595
diff
changeset
|
46 print (subprocess.list2cmdline(command)) |
590
e93b81d8a586
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
584
diff
changeset
|
47 code = subprocess.call(command, **kwargs) |
591
542d329835ec
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
590
diff
changeset
|
48 if code: |
542d329835ec
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
590
diff
changeset
|
49 raise subprocess.CalledProcessError(code, command) |
29
8344c7a9847c
install smartopen by default and some other cleanup (untested)
Jeff Hammel <k0scist@gmail.com>
parents:
22
diff
changeset
|
50 |
592
33b313fa1eb0
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
591
diff
changeset
|
51 |
410 | 52 def install_develop(package): |
53 """install k0s.ware for development""" | |
54 | |
55 src = 'http://k0s.org/hg/%s' % package | |
56 directory = '%s/src/%s' % (package, package) | |
590
e93b81d8a586
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
584
diff
changeset
|
57 commands = [['virtualenv/virtualenv.py', package], |
e93b81d8a586
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
584
diff
changeset
|
58 ['mkdir', '-p', directory ], |
e93b81d8a586
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
584
diff
changeset
|
59 ['hg', 'clone', src, directory] ] |
410 | 60 execute(*commands) |
61 old_directory = os.getcwd() | |
62 os.chdir(directory) | |
63 command = ['../../bin/python', 'setup.py', 'develop'] | |
64 execute(command) | |
65 os.chdir(old_directory) | |
66 | |
591
542d329835ec
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
590
diff
changeset
|
67 |
584 | 68 ### generic step framework |
410 | 69 |
592
33b313fa1eb0
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
591
diff
changeset
|
70 class StepGraph(object): |
33b313fa1eb0
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
591
diff
changeset
|
71 """a bunch of steps""" |
33b313fa1eb0
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
591
diff
changeset
|
72 |
408 | 73 class Step(object): |
74 @classmethod | |
75 def check(cls): | |
76 """checks if the step may be run""" | |
584 | 77 @classmethod |
78 def name(cls): | |
79 return cls.__name__ | |
619
fd50f457185c
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
595
diff
changeset
|
80 __str__ = name # XXX does not work! :( |
408 | 81 def __call__(self): |
82 execute(*self.commands) | |
83 | |
595
4b79ee6c8539
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
594
diff
changeset
|
84 |
584 | 85 class Command(object): |
86 """require a command""" | |
87 | |
595
4b79ee6c8539
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
594
diff
changeset
|
88 #@require(Virtualenv) |
4b79ee6c8539
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
594
diff
changeset
|
89 class InstallVirtualenv(Step): |
4b79ee6c8539
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
594
diff
changeset
|
90 """ABC for installing packages in a virtualenv""" |
4b79ee6c8539
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
594
diff
changeset
|
91 # TODO: move install_develop sctuff to here |
4b79ee6c8539
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
594
diff
changeset
|
92 |
4b79ee6c8539
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
594
diff
changeset
|
93 |
584 | 94 ### process steps |
95 | |
408 | 96 class InitializeRepository(Step): |
97 """make the home directory a repository""" | |
409 | 98 commands = [ |
99 ['hg', 'init'], | |
100 ['hg', 'pull', SRC], | |
101 ['hg', 'update', '-C'], | |
102 ] | |
577 | 103 @classmethod |
410 | 104 def write_hgrc(self): |
584 | 105 """make a (correct) .hg/hgrc file for $HOME""" |
106 | |
410 | 107 hgrc = """[paths] |
108 default = http://k0s.org/hg/config | |
109 default-push = ssh://k0s.org/hg/config | |
110 """ | |
577 | 111 with file('.hg/hgrc', 'w') as f: |
410 | 112 f.write(hgrc) |
595
4b79ee6c8539
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
594
diff
changeset
|
113 |
410 | 114 def __call__(self): |
115 Step.__call__(self) | |
116 self.write_hgrc() | |
408 | 117 |
584 | 118 # get the which command |
119 sys.path.append(os.path.join(HOME, 'python')) | |
120 from which import which | |
579
f894bd779943
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
578
diff
changeset
|
121 |
411 | 122 #@requires(Command('git')) |
590
e93b81d8a586
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
584
diff
changeset
|
123 class ConfigureGit(Step): |
e93b81d8a586
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
584
diff
changeset
|
124 """configure git""" |
595
4b79ee6c8539
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
594
diff
changeset
|
125 commands = [ |
4b79ee6c8539
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
594
diff
changeset
|
126 # setup git's global ignore, since git is silly about this |
4b79ee6c8539
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
594
diff
changeset
|
127 # and doesn't look for the file in the right place |
4b79ee6c8539
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
594
diff
changeset
|
128 ['git', 'config', '--global', 'core.excludesfile', os.path.join(HOME, '.gitignore')] |
4b79ee6c8539
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
594
diff
changeset
|
129 ] |
590
e93b81d8a586
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
584
diff
changeset
|
130 |
e93b81d8a586
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
584
diff
changeset
|
131 #@requires(Command('git')) |
584 | 132 class InstallVirtualenv(Step): |
133 commands = [['git', 'clone', 'https://github.com/pypa/virtualenv.git'], | |
590
e93b81d8a586
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
584
diff
changeset
|
134 ['ln', '-s', |
e93b81d8a586
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
584
diff
changeset
|
135 os.path.join(HOME, 'virtualenv/virtualenv.py'), |
e93b81d8a586
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
584
diff
changeset
|
136 os.path.join(HOME, 'bin', 'virtualenv.py')] |
e93b81d8a586
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
584
diff
changeset
|
137 ] |
e93b81d8a586
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
584
diff
changeset
|
138 |
645
753a5358535f
correct syntax errors; now works again
Jeff Hammel <k0scist@gmail.com>
parents:
619
diff
changeset
|
139 class InstallKWare(Step): |
590
e93b81d8a586
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
584
diff
changeset
|
140 """install k0s.ware""" |
595
4b79ee6c8539
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
594
diff
changeset
|
141 # TODO |
4b79ee6c8539
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
594
diff
changeset
|
142 # from legacy |
4b79ee6c8539
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
594
diff
changeset
|
143 # # install some python |
4b79ee6c8539
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
594
diff
changeset
|
144 # install_develop('smartopen') |
4b79ee6c8539
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
594
diff
changeset
|
145 # install_develop('silvermirror') # XXX this won't actually work since python-dev isn't installed; install it first |
4b79ee6c8539
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
594
diff
changeset
|
146 |
4b79ee6c8539
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
594
diff
changeset
|
147 # postinstall_commands = [['ln', '-s', os.path.join(HOME, 'smartopen', 'bin', 'smartopen'), os.path.join(HOME, 'bin', 'smartopen') ], |
4b79ee6c8539
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
594
diff
changeset
|
148 # ['ln', '-s', os.path.join(HOME, 'silvermirror', 'bin', 'silvermirror'), os.path.join(HOME, 'bin', 'silvermirror') ], |
4b79ee6c8539
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
594
diff
changeset
|
149 # ] |
4b79ee6c8539
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
594
diff
changeset
|
150 # execute(*postinstall_commands) |
4b79ee6c8539
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
594
diff
changeset
|
151 |
577 | 152 |
582 | 153 class DebianPackages(Step): |
578 | 154 """ubuntu packages to install""" |
584 | 155 # TODO: actually install packages |
578 | 156 |
593
dbdc68d85986
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
592
diff
changeset
|
157 PACKAGES=["antiword", |
594
98ccb704e241
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
593
diff
changeset
|
158 "arandr", |
98ccb704e241
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
593
diff
changeset
|
159 "curl", |
98ccb704e241
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
593
diff
changeset
|
160 "emacs", |
593
dbdc68d85986
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
592
diff
changeset
|
161 "fluxbox", |
594
98ccb704e241
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
593
diff
changeset
|
162 "git", |
98ccb704e241
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
593
diff
changeset
|
163 "gkrellm", |
98ccb704e241
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
593
diff
changeset
|
164 "graphviz", |
98ccb704e241
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
593
diff
changeset
|
165 "graphviz-dev", |
98ccb704e241
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
593
diff
changeset
|
166 "irssi", |
593
dbdc68d85986
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
592
diff
changeset
|
167 "mercurial", |
731
e56610c5ece2
now we need pkg-config for pygraphviz
Jeff Hammel <k0scist@gmail.com>
parents:
645
diff
changeset
|
168 "pkg-config", |
594
98ccb704e241
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
593
diff
changeset
|
169 "python-dev", |
98ccb704e241
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
593
diff
changeset
|
170 "python-lxml", |
738 | 171 "libxml2", |
593
dbdc68d85986
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
592
diff
changeset
|
172 "libxml2-dev", |
dbdc68d85986
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
592
diff
changeset
|
173 "libxslt1-dev", |
579
f894bd779943
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
578
diff
changeset
|
174 "unison", |
f894bd779943
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
578
diff
changeset
|
175 "xclip", |
594
98ccb704e241
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
593
diff
changeset
|
176 ] |
98ccb704e241
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
593
diff
changeset
|
177 |
579
f894bd779943
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
578
diff
changeset
|
178 def __call__(self): |
594
98ccb704e241
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
593
diff
changeset
|
179 # TODO: actually install this shit |
645
753a5358535f
correct syntax errors; now works again
Jeff Hammel <k0scist@gmail.com>
parents:
619
diff
changeset
|
180 print ("Ensure the following packages are installed:") |
753a5358535f
correct syntax errors; now works again
Jeff Hammel <k0scist@gmail.com>
parents:
619
diff
changeset
|
181 print ("sudo apt-get install %s" % ' '.join(self.PACKAGES)) |
579
f894bd779943
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
578
diff
changeset
|
182 |
f894bd779943
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
578
diff
changeset
|
183 |
582 | 184 ### CLI |
416 | 185 |
408 | 186 def main(args=sys.argv[1:]): |
578 | 187 |
188 # go home | |
189 os.chdir(HOME) | |
190 | |
191 # parse command line | |
408 | 192 usage = '%prog [options]' |
193 parser = optparse.OptionParser(usage=usage, description=__doc__) | |
578 | 194 parser.add_option('--deb', '--dpkg', '--debian-packages', |
195 dest='debian_packages', | |
196 action='store_true', default=False, | |
197 help="display debian packages to install") | |
579
f894bd779943
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
578
diff
changeset
|
198 parser.add_option('-l', '--list', '--list-steps', |
f894bd779943
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
578
diff
changeset
|
199 dest='list_steps', |
f894bd779943
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
578
diff
changeset
|
200 action='store_true', default=False, |
580
b563a9c1f2b7
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
579
diff
changeset
|
201 help="list steps to be run and exit") |
591
542d329835ec
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
590
diff
changeset
|
202 parser.add_option('--all', dest='all', |
542d329835ec
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
590
diff
changeset
|
203 action='store_true', default=False, |
542d329835ec
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
590
diff
changeset
|
204 help="list all actions") |
542d329835ec
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
590
diff
changeset
|
205 parser.add_option('--run', dest='run', |
542d329835ec
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
590
diff
changeset
|
206 action='append', |
542d329835ec
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
590
diff
changeset
|
207 help="run particular actions, in order") |
408 | 208 options, args = parser.parse_args() |
209 | |
578 | 210 # plan steps |
582 | 211 steps = [InitializeRepository, DebianPackages] |
579
f894bd779943
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
578
diff
changeset
|
212 if options.debian_packages: |
f894bd779943
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
578
diff
changeset
|
213 steps = [DebianPackages] |
f894bd779943
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
578
diff
changeset
|
214 |
f894bd779943
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
578
diff
changeset
|
215 if options.list_steps: |
f894bd779943
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
578
diff
changeset
|
216 # list steps if specified |
f894bd779943
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
578
diff
changeset
|
217 for step in steps: |
584 | 218 print(step.name()) |
580
b563a9c1f2b7
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
579
diff
changeset
|
219 parser.exit() |
578 | 220 |
591
542d329835ec
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
590
diff
changeset
|
221 if options.all: |
645
753a5358535f
correct syntax errors; now works again
Jeff Hammel <k0scist@gmail.com>
parents:
619
diff
changeset
|
222 raise NotImplementedError("TODO") |
591
542d329835ec
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
590
diff
changeset
|
223 |
578 | 224 # execute steps |
409 | 225 for step in steps: |
579
f894bd779943
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
578
diff
changeset
|
226 instance = step() |
f894bd779943
STUB: python/install_config.py
Jeff Hammel <k0scist@gmail.com>
parents:
578
diff
changeset
|
227 instance() |
416 | 228 |
408 | 229 if __name__ == '__main__': |
230 main() |