(self,d)
return d
check if data are in new format, if not create a suitable object.
            returns finalized data object
check if data are in new format, if not create a suitable object.
            returns finalized data object
check if data are in new format if not create a suitable object . returns finalized data object
def check_data(self,d):
        """ check if data are in new format, if not create a suitable object.
            returns finalized data object
        """
        if not isinstance(d, Data_Files):
            self.warn(("old-style data files list found "
                        "-- please convert to Data_Files instance"))
            if type(d) is TupleType:
                if len(d) != 2 or  not (type(d[1]) is ListType):
                        raise DistutilsSetupError, \
                          ("each element of 'data_files' option must be an "
                            "Data File instance, a string or 2-tuple (string,[strings])")
                d = Data_Files(copy_to=d[0],files=d[1])
            else:
                if not (type(d) is StringType):
                        raise DistutilsSetupError, \
                          ("each element of 'data_files' option must be an "
                           "Data File instance, a string or 2-tuple (string,[strings])")
                d = Data_Files(files=[d])
        d.finalize()
        return d
def check_data ( self , d ) : if not isinstance ( d , Data_Files ) : self . warn ( ( "old-style data files list found " "-- please convert to Data_Files instance" ) ) if type ( d ) is TupleType : if len ( d ) != 2 or not ( type ( d [ 1 ] ) is ListType ) : raise DistutilsSetupError , ( "each element of 'data_files' option must be an " "Data File instance, a string or 2-tuple (string,[strings])" ) d = Data_Files ( copy_to = d [ 0 ] , files = d [ 1 ] ) else : if not ( type ( d ) is StringType ) : raise DistutilsSetupError , ( "each element of 'data_files' option must be an " "Data File instance, a string or 2-tuple (string,[strings])" ) d = Data_Files ( files = [ d ] ) d . finalize ( ) return d