Skip to content

Commit cce885f

Browse files
author
Matthias Koeppe
committed
sage --package dependencies: Fix indentation
1 parent 5109a5e commit cce885f

File tree

2 files changed

+22
-10
lines changed

2 files changed

+22
-10
lines changed

build/sage_bootstrap/app.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -133,27 +133,28 @@ def dependencies(self, *package_classes, **kwds):
133133
else:
134134
raise ValueError('format must be one of "plain", "rst", and "shell"')
135135

136-
if format == 'plain':
137-
indent1 = " "
138-
indent2 = " "
139-
elif format == 'rst':
140-
indent1 = ""
141-
indent2 = " "
142-
143136
for package_name in pc.names:
144137
package = Package(package_name)
145138
if len(pc.names) > 1:
146139
if format == 'plain':
147140
print("{0}:".format(package_name))
141+
indent1 = " "
148142
elif format == 'rst':
149143
print("\n{0}\n{1}\n".format(package_name, "~" * len(package_name)))
144+
indent1 = ""
145+
else:
146+
indent1 = ""
150147

151148
for typeset in typesets:
152149
if len(typesets) > 1:
153150
if format == 'plain':
154151
print(indent1 + "{0}: ".format('/'.join(typeset)))
152+
indent2 = indent1 + " "
155153
elif format == 'rst':
156154
print("\n" + indent1 + ".. tab:: {0}\n".format('/'.join(typeset)))
155+
indent2 = indent1 + " "
156+
else:
157+
indent2 = indent1
157158

158159
deps = []
159160
for t in typeset:

build/sage_bootstrap/cmdline.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,23 @@
109109
110110
$ sage --package dependencies maxima openblas
111111
maxima:
112-
- ecl
113-
- info
112+
- ecl
113+
- info
114114
openblas:
115-
- gfortran
115+
- gfortran
116116
$ sage --package dependencies maxima --runtime
117+
- ecl
118+
119+
$ sage --package dependencies maxima openblas --runtime --order-only
120+
maxima:
121+
order_only:
122+
- info
123+
runtime:
117124
- ecl
125+
openblas:
126+
order_only:
127+
runtime:
128+
- gfortran
118129
"""
119130

120131

0 commit comments

Comments
 (0)