def type_form(self): if _swig_: self.type = _File.types[c_rsf.sf_gettype(self.file)] self.form = _File.forms[c_rsf.sf_getform(self.file)] else: self.type = self.file.gettype() self.form = self.file.getform()
def __init__(self, tag): if not self.file: # can only be used by Input and Output # that define self.file raise TypeError('Use Input or Output instead of File') if _swig_: self.type = _File.types[c_rsf.sf_gettype(self.file)] self.form = _File.forms[c_rsf.sf_getform(self.file)] else: self.type = self.file.gettype() self.form = self.file.getform() if self.type == 'float': self.datatype = np.float32 elif self.type == 'complex': self.datatype = np.complex64 elif self.type == 'int': self.datatype = np.int32 else: raise TypeError('Unsupported type %s' % self.type) File.__init__(self, tag) # create methods line int, float, and ints # for extracting parameters for type in ('int', 'float'): setattr(self, type, self.__get(type)) for type in ('int', ): setattr(self, type + 's', self.__gets(type))
def __init__(self, tag): if not self.file: raise TypeError, 'Use Input or Output instead of File' File.__init__(self, tag) self.type = _File.type[c_rsf.sf_gettype(self.file)] self.form = _File.form[c_rsf.sf_getform(self.file)]
def __init__(self,tag): if not self.file: raise TypeError, 'Use Input or Output instead of File' File.__init__(self,tag) self.type = _File.type[c_rsf.sf_gettype(self.file)] self.form = _File.form[c_rsf.sf_getform(self.file)]