MCPcopy Index your code
hub / github.com/USArmyResearchLab/Dshell / reset_fh

Method reset_fh

dshell/output/output.py:72–87  ·  view source on GitHub ↗

Alter the module's open file handle without changing any of the other settings. Must supply at least a filename or a filehandle (fh). reset_fh(filename=None, fh=None, mode=None)

(self, filename=None, fh=None, mode=None)

Source from the content-addressed store, hash-verified

70 self.fh = sys.stdout
71
72 def reset_fh(self, filename=None, fh=None, mode=None):
73 """
74 Alter the module's open file handle without changing any of the other
75 settings. Must supply at least a filename or a filehandle (fh).
76 reset_fh(filename=None, fh=None, mode=None)
77 """
78 if fh:
79 self.fh = fh
80 elif filename:
81 if self.noclobber:
82 filename = self._increment_filename(filename)
83 if mode:
84 self.mode = mode
85 self.fh = open(filename, mode)
86 else:
87 self.fh = open(filename, self.mode)
88
89 def set_oargs(self, format=None, noclobber=None, delimiter=None, timeformat=None, hex=None, **unused_kwargs):
90 """

Callers 1

mainFunction · 0.80

Calls 1

_increment_filenameMethod · 0.95

Tested by

no test coverage detected