def main(): """Gets the list of files on harddrive and in db and uploads new ones""" data_files = get_list_of_datafiles() print('Found {} files on harddrive'.format(len(data_files))) db_files = get_files_in_db() print('Found {} files in db'.format(len(db_files))) new_files = [] for data_file in data_files: if data_file.db_path not in db_files: new_files.append(data_file) print('Found {} new files'.format(len(new_files))) for index, data_file in enumerate(new_files): specsfile = SpecsFile(data_file.fullpath, encoding='iso-8859-1') send_file_to_db(specsfile, data_file.db_path) print('\nPress enter to exit') raw_input()
def get_specs_region(filepath, region): """Get the specs region""" specs_file = SpecsFile(os.path.join(THIS_FILE_DIR, filepath)) return specs_file.search_regions(region)[0]
def get_specs_region(filepath, region): """Get the specs region""" specs_file = SpecsFile(filepath) return specs_file.search_regions(region)[0]