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

Class List

v2/test/BoostBuild.py:1156–1201  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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