MCPcopy Create free account
hub / github.com/carbonengine/trinity / UpgradeFile

Method UpgradeFile

python/upgrade_scripts/carbon1.py:47–56  ·  view source on GitHub ↗
(self, filename)

Source from the content-addressed store, hash-verified

45 return self.attribute in contents
46
47 def UpgradeFile(self, filename):
48 with open(filename, 'r') as f:
49 contents = f.read()
50 while True:
51 try:
52 contents = _RemoveAttribute(contents, self.attribute)
53 except StopIteration:
54 break
55 with open(filename, 'w') as f:
56 f.write(contents)
57
58class ConvertRocks(BaseFileUpgrade):
59 def AppliesToFile(self, filename):

Callers

nothing calls this directly

Calls 2

_RemoveAttributeFunction · 0.85
readMethod · 0.80

Tested by

no test coverage detected