def check_for_uncombined_files(self):
        """
        Go through working directory and check for uncombined files.
        (I.e., location1_specimens.txt and location2_specimens.txt but no specimens.txt.)
        Show a warning if uncombined files are found.
        Return True if no uncombined files are found OR user elects
        to continue anyway.
        """
        wd_files = os.listdir(self.WD)
        if self.data_model_num == 2:
            ftypes = ['er_specimens.txt', 'er_samples.txt', 'er_sites.txt', 'er_locations.txt', 'pmag_specimens.txt', 'pmag_samples.txt', 'pmag_sites.txt', 'rmag_specimens.txt', 'rmag_results.txt', 'rmag_anisotropy.txt']
        else:
            ftypes = ['specimens.txt', 'samples.txt', 'sites.txt', 'locations.txt']
        uncombined = set()
        for ftype in ftypes:
            if ftype not in wd_files:
                for f in wd_files:
                    if f.endswith('_' + ftype):
                        uncombined.add(ftype)
        if uncombined:
            msg = 'It looks like you may have uncombined files of type(s) {} in your working directory.\nYou may want to go back to Step 1 and finish combining all files.\nIf you continue, the program will try to extract as much information as possible from your measurement file.'.format(", ".join(list(uncombined)))
            dlg = pw.ChooseOne(self, 'Continue anyway', 'Go back', msg, title="Warning!")
            res = dlg.ShowModal()
            if res == wx.ID_NO:
                return
        return True
def check_for_uncombined_files ( self ) : wd_files = os . listdir ( self . WD ) if self . data_model_num == 2 : ftypes = [ 'er_specimens.txt' , 'er_samples.txt' , 'er_sites.txt' , 'er_locations.txt' , 'pmag_specimens.txt' , 'pmag_samples.txt' , 'pmag_sites.txt' , 'rmag_specimens.txt' , 'rmag_results.txt' , 'rmag_anisotropy.txt' ] else : ftypes = [ 'specimens.txt' , 'samples.txt' , 'sites.txt' , 'locations.txt' ] uncombined = set ( ) for ftype in ftypes : if ftype not in wd_files : for f in wd_files : if f . endswith ( '_' + ftype ) : uncombined . add ( ftype ) if uncombined : msg = 'It looks like you may have uncombined files of type(s) {} in your working directory.\nYou may want to go back to Step 1 and finish combining all files.\nIf you continue, the program will try to extract as much information as possible from your measurement file.' . format ( ", " . join ( list ( uncombined ) ) ) dlg = pw . ChooseOne ( self , 'Continue anyway' , 'Go back' , msg , title = "Warning!" ) res = dlg . ShowModal ( ) if res == wx . ID_NO : return return True
Go through working directory and check for uncombined files.
        (I.e., location1_specimens.txt and location2_specimens.txt but no specimens.txt.)
        Show a warning if uncombined files are found.
        Return True if no uncombined files are found OR user elects
        to continue anyway.