MCPcopy
hub / github.com/USArmyResearchLab/Dshell / __init__

Method __init__

dshell/plugins/http/riphttp.py:117–131  ·  view source on GitHub ↗
(self, filename, plugin_instance)

Source from the content-addressed store, hash-verified

115 """
116
117 def __init__(self, filename, plugin_instance):
118 self.complete = False
119 # Expected size in bytes of full file transfer
120 self.size = 0
121 # List of tuples indicating byte chunks already received and written to
122 # disk
123 self.ranges = []
124 self.plugin = plugin_instance
125 self.filename = filename
126 try:
127 self.fh = open(filename, 'wb')
128 except IOError as e:
129 self.plugin.error(
130 "Could not create file {!r}: {!s}".format(filename, e))
131 self.fh = None
132
133 def __del__(self):
134 if self.fh is None:

Callers 1

__init__Method · 0.45

Calls 1

errorMethod · 0.80

Tested by

no test coverage detected