MCPcopy Create free account
hub / github.com/boostorg/build / List

Class List

test/BoostBuild.py:1158–1203  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1156
1157
1158class List:
1159 def __init__(self, s=""):
1160 elements = []
1161 if s.__class__ is str:
1162 # Have to handle escaped spaces correctly.
1163 elements = s.replace("\ ", "\001").split()
1164 else:
1165 elements = s
1166 self.l = [e.replace("\001", " ") for e in elements]
1167
1168 def __len__(self):
1169 return len(self.l)
1170
1171 def __getitem__(self, key):
1172 return self.l[key]
1173
1174 def __setitem__(self, key, value):
1175 self.l[key] = value
1176
1177 def __delitem__(self, key):
1178 del self.l[key]
1179
1180 def __str__(self):
1181 return str(self.l)
1182
1183 def __repr__(self):
1184 return "%s.List(%r)" % (self.__module__, " ".join(self.l))
1185
1186 def __mul__(self, other):
1187 result = List()
1188 if not isinstance(other, List):
1189 other = List(other)
1190 for f in self:
1191 for s in other:
1192 result.l.append(f + s)
1193 return result
1194
1195 def __rmul__(self, other):
1196 if not isinstance(other, List):
1197 other = List(other)
1198 return List.__mul__(other, self)
1199
1200 def __add__(self, other):
1201 result = List()
1202 result.l = self.l[:] + other.l[:]
1203 return result
1204
1205
1206def _contains_lines(data, lines):

Callers 4

__mul__Method · 0.85
__rmul__Method · 0.85
__add__Method · 0.85
BoostBuild.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected