def nlmsa_textdump_unpickler(filepath, kwargs): from cnestedlist import textfile_to_binaries, NLMSA logger.info('Saving NLMSA indexes from textdump: %s' % filepath) try: buildpath = os.environ['WORLDBASEBUILDDIR'] except KeyError: buildpath = classutil.get_env_or_cwd('PYGRDATABUILDDIR') path = textfile_to_binaries(filepath, buildpath=buildpath, **kwargs) o = NLMSA(path) # now open in read mode from the saved index fileset o._saveLocalBuild = True # mark this for saving in local metabase return o