def run() -> None: """ """ from multiprocessing import freeze_support freeze_support() # Multiprocessing support for frozen Windows executables # Configure basic Bible Organisational System (BOS) set-up parser = BibleOrgSysGlobals.setup(SHORT_PROGRAM_NAME, PROGRAM_VERSION, LAST_MODIFIED_DATE) parser.add_argument("inputBibleFileOrFolder", help="path/to/BibleFileOrFolder") BibleOrgSysGlobals.addStandardOptionsAndProcess(parser) main() # Do the BOS close-down stuff BibleOrgSysGlobals.closedown(PROGRAM_NAME, PROGRAM_VERSION)
def run(): # Configure basic Bible Organisational System (BOS) set-up parser = BibleOrgSysGlobals.setup(PROGRAM_NAME, PROGRAM_VERSION) parser.add_argument("inputBibleFileOrFolder", help="path/to/BibleFileOrFolder") BibleOrgSysGlobals.addStandardOptionsAndProcess(parser) # Search for a Bible and attempt to load it unknownBible = UnknownBible( BibleOrgSysGlobals.commandLineArguments.inputBibleFileOrFolder) loadedBible = unknownBible.search( autoLoadAlways=True, autoLoadBooks=True) # Load all the books if we find any # See if we were successful at loading one (and only one), and if so, do the export if isinstance(loadedBible, Bible): # i.e., not an error message loadedBible.toUSXXML() # Export as USX files (USFM inside XML) vPrint( 'Quiet', False, f"\nOutput should be in {BibleOrgSysGlobals.DEFAULT_WRITEABLE_OUTPUT_FOLDERPATH.joinpath( 'BOS_USX2_Export/' )}/ folder." ) # Do the BOS close-down stuff BibleOrgSysGlobals.closedown(PROGRAM_NAME, PROGRAM_VERSION)
results = pool.map(testUB, parameters) # have the pool do our loads assert len(results) == len( parameters ) # Results (all None) are actually irrelevant to us here BibleOrgSysGlobals.alreadyMultiprocessing = False else: # Just single threaded for j, someFolder in enumerate(sorted(foundFolders)): vPrint('Normal', debuggingThisModule, "\nUnbound D{}/ Trying {}".format(j + 1, someFolder)) #myTestFolder = os.path.join( testFolder, someFolder+'/' ) testUB(someFolder) # end of UnboundBible.fullDemo if __name__ == '__main__': multiprocessing.freeze_support( ) # Multiprocessing support for frozen Windows executables # Configure basic set-up parser = BibleOrgSysGlobals.setup(SHORT_PROGRAM_NAME, PROGRAM_VERSION, LAST_MODIFIED_DATE) BibleOrgSysGlobals.addStandardOptionsAndProcess(parser, exportAvailable=True) fullDemo() BibleOrgSysGlobals.closedown(PROGRAM_NAME, PROGRAM_VERSION) # end of UnboundBible.py
# end of test_090_getSSFFilenames # end of USFMFilenamesTests2 class def fullDemo() -> None: """ Full demo to check class is working """ briefDemo() # end of fullDemo if __name__ == '__main__': from multiprocessing import freeze_support freeze_support() # Multiprocessing support for frozen Windows executables # Configure basic set-up parser = BibleOrgSysGlobals.setup(SHORT_PROGRAM_NAME, PROGRAM_VERSION, LAST_MODIFIED_DATE) BibleOrgSysGlobals.addStandardOptionsAndProcess(parser) vPrint('Normal', debuggingThisModule, programNameVersion) # Make sure you set the testFolder in setUp above unittest.main() # Automatically runs all of the above tests # end of USFMFilenamesTests.py