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