MCPcopy Create free account
hub / github.com/ActiveState/code / load

Method load

recipes/Python/496795_pythreplacement/recipe-496795.py:221–235  ·  view source on GitHub ↗

Load properties from an open file stream

(self, stream)

Source from the content-addressed store, hash-verified

219 return newvalue
220
221 def load(self, stream):
222 """ Load properties from an open file stream """
223
224 # For the time being only accept file input streams
225 if type(stream) is not file:
226 raise TypeError,'Argument should be a file object!'
227 # Check for the opened mode
228 if stream.mode != 'r':
229 raise ValueError,'Stream should be opened in read-only mode!'
230
231 try:
232 lines = stream.readlines()
233 self.__parse(lines)
234 except IOError, e:
235 raise
236
237 def getProperty(self, key):
238 """ Return a property for the given key """

Callers 5

recipe-496923.pyFile · 0.45
openMethod · 0.45
recipe-496789.pyFile · 0.45
recipe-496795.pyFile · 0.45

Calls 2

__parseMethod · 0.95
readlinesMethod · 0.45

Tested by

no test coverage detected