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