functions.displayMessage("========================\n") os.chdir("..") if not os.path.isdir("files") or not os.path.isdir("builds"): functions.displayMessage( "This script must be run from the 'bin' directory inside a full checkout of the scenery library\n", "error") sys.exit() versionTag = "" previousVersionTag = "" while versionTag == "" or not os.path.isdir("builds/" + versionTag + "/OpenSceneryX-" + versionTag): versionTag = functions.getInput( "Enter the latest release version (e.g. 1.0.1): ", 10) while previousVersionTag == "" or not os.path.isdir( "builds/" + previousVersionTag + "/OpenSceneryX-" + previousVersionTag): previousVersionTag = functions.getInput( "Enter the previous release version (e.g. 1.0.0): ", 10) classes.Configuration.init(versionTag, "", 'n') functions.displayMessage("------------------------\n") functions.displayMessage("Checking for missing virtual paths\n") newPaths = [] with open( "builds/" + versionTag + "/OpenSceneryX-" + versionTag +
functions.displayMessage("======================\n") functions.displayMessage("alpilotx Forest Update\n") functions.displayMessage("======================\n") if not os.path.isdir(".." + os.sep + "files"): raise classes.BuildError("Error: This script must be run from the 'trunk/bin' directory inside a full checkout of the scenery library") if not os.path.isdir(".." + os.sep + ".." + os.sep + "submissions" + os.sep + "alpilotx"): raise classes.BuildError("Error: The 'submissions' folder must contain an 'alpilotx' folder containing the source files") os.chdir(".." + os.sep + "..") europeUS = "" while (europeUS != "e" and europeUS != "u"): europeUS = functions.getInput("Europe or US? [e/u]: ", 1) functions.displayMessage("------------------------\n") functions.displayMessage("Working\n") if (europeUS == "e"): mappingFile = "europe_forest_mapping.txt" continentTitle = "European" else: mappingFile = "us_forest_mapping.txt" continentTitle = "USA" file = open("trunk" + os.sep + "bin" + os.sep + mappingFile) mappingFileContents = file.readlines() file.close()
showTraceback = 0 try: functions.displayMessage("========================\n") functions.displayMessage("OpenSceneryX Release\n") functions.displayMessage("========================\n") if not os.path.isdir("../files") or not os.path.isdir("../builds"): functions.displayMessage( "This script must be run from the 'bin' directory inside a full checkout of the scenery library\n", "error") sys.exit() versionTag = "" while versionTag == "": versionTag = functions.getInput( "Enter the library version number (e.g. 1.0.1): ", 10) sinceVersionTag = "" sinceVersionTag = functions.getInput( "Version number to build latest objects from [" + versionTag + "]: ", 10) if sinceVersionTag == "": sinceVersionTag = versionTag buildPDF = functions.getInput("Build PDF? [y/N]: ", 1) classes.Configuration.init(versionTag, sinceVersionTag, buildPDF) if Image is None: functions.displayMessage( "This script depends on PIL and fpdf for building the developer documentation. Please ensure they are installed ('pip install Pillow' and 'pip install fpdf').\n",
try: functions.displayMessage("==========================\n") functions.displayMessage("Update Third Party Library\n") functions.displayMessage("==========================\n") libraryFilesPath = f"..{os.sep}files" if not os.path.isdir(libraryFilesPath): raise classes.BuildError( "Error: This script must be run from the 'bin' directory inside a full checkout of the scenery library" ) versionTag = "" while versionTag == "": versionTag = functions.getInput( "Enter the latest OpenSceneryX built library version number (e.g. 1.0.1): ", 10) buildLibraryPath = f"..{os.sep}builds{os.sep}{versionTag}{os.sep}OpenSceneryX-{versionTag}{os.sep}library.txt" if not os.path.isfile(buildLibraryPath): raise classes.BuildError( "Error: A library.txt file does not exist for that version") thirdPartyLibraryName = "" while thirdPartyLibraryName == "": thirdPartyLibraryName = functions.getInput( "Enter the name of the third party library (e.g. DT_Library). This is used both to locate the folder and to identify library entries in library.txt: ", 20) thirdPartyLibraryPath = f"..{os.sep}contributions{os.sep}{thirdPartyLibraryName}{os.sep}library.txt" if not os.path.isfile(thirdPartyLibraryPath):
try: functions.displayMessage("=================================\n") functions.displayMessage("Bertrand Augras Aircraft Addition\n") functions.displayMessage("=================================\n") filesFolder = "files" if not os.path.isdir("../" + filesFolder): raise classes.BuildError("Error: This script must be run from the 'trunk/bin' directory inside a full checkout of the scenery library") os.chdir("../..") sourceTextureFolder = "" while sourceTextureFolder == "": sourceTextureFolder = functions.getInput("Enter the name of the source texture folder inside the shared_textures folder (e.g. bertrand_augras/aeroflot): ", 100) lastSlash = sourceTextureFolder.rfind("/") if not os.path.isdir("trunk/" + filesFolder + "/objects/shared_textures/" + sourceTextureFolder): functions.displayMessage("The " + "/objects/shared_textures/" + sourceTextureFolder + " folder doesn't exist, please enter another\n", "error") sourceTextureFolder = "" elif lastSlash == -1: functions.displayMessage("The specified folder cannot be in the root of shared_textures\n", "error") sourceTextureFolder = "" elif not os.path.isfile("trunk/" + filesFolder + "/objects/shared_textures/" + sourceTextureFolder + "/texture.png"): functions.displayMessage("The specified folder does not contain a 'texture.png' file\n", "error") sourceTextureFolder = "" elif not os.path.isfile("trunk/" + filesFolder + "/objects/shared_textures/" + sourceTextureFolder + "/texture_LIT.png"): functions.displayMessage("The specified folder does not contain a 'texture_LIT.png' file\n", "error") sourceTextureFolder = "" else: liveryFolderName = sourceTextureFolder[lastSlash + 1:]
# this program generates song titles automatically # it also keeps a record of the past histories # so it does not output a recent one import functions as fun # import random # from time import sleep # import sys fast = fun.readSongs("fast.txt") slow = fun.readSongs("slow.txt") history = fun.readHistory() # get intput from console numbers = fun.getInput() while True: output = fun.getSong(numbers, 0, fast, slow, history) output.extend(fun.getSong(numbers, 1, fast, slow, history)) fun.printResult(numbers, output) print "Enter 1: write history, 2: repeat 3: exit" cont = raw_input() if cont == "1": fun.writeHistory(output) break elif cont == "3": break
showTraceback = 0 try: functions.growlRegister() functions.displayMessage("========================\n") functions.displayMessage("OpenSceneryX Release\n") functions.displayMessage("========================\n") if not os.path.isdir("../files") or not os.path.isdir("../builds"): functions.displayMessage("This script must be run from the 'bin' directory inside a full checkout of the scenery library\n", "error") sys.exit() versionTag = "" while versionTag == "": versionTag = functions.getInput("Enter the release tag (e.g. 1.0.1): ", 10) os.chdir("..") buildPDF = functions.getInput("Build PDF? [y/N]: ", 1) classes.Configuration.init(versionTag, buildPDF) if Image is None: functions.displayMessage("This script depends on PIL for building the developer documentation. Please ensure it is installed ('pip install pil').\n", "error") functions.displayMessage("------------------------\n") functions.displayMessage("Creating release paths\n") # print "svn mkdir tags/" + classes.Configuration.versionNumber classes.Configuration.makeFolders() # status = os.system("svn mkdir tags/" + classes.Configuration.versionNumber)
functions.displayMessage("========================\n") os.chdir("..") if not os.path.isdir("files") or not os.path.isdir("builds"): functions.displayMessage( "This script must be run from the 'bin' directory inside a full checkout of the scenery library\n", "error") sys.exit() versionTag = "" thirdPartyLibrary = "" while versionTag == "" or not os.path.isdir("builds/" + versionTag + "/OpenSceneryX-" + versionTag): versionTag = functions.getInput( "Enter the latest release version (e.g. 1.0.1): ", 10) while thirdPartyLibrary == "" or not os.path.isfile( thirdPartyLibrary.replace("\ ", " ")): thirdPartyLibrary = functions.getInput( "Enter the path to the third party library: ", 10).strip() classes.Configuration.init(versionTag, "", 'n') functions.displayMessage("------------------------\n") functions.displayMessage("Checking for missing virtual paths\n") osxPaths = [] thirdPartyPaths = [] with open( "builds/" + versionTag + "/OpenSceneryX-" + versionTag +
raise classes.BuildError( "Error: This script must be run from the 'trunk/bin' directory inside a full checkout of the scenery library" ) if not os.path.isdir(".." + os.sep + ".." + os.sep + "submissions" + os.sep + "alpilotx"): raise classes.BuildError( "Error: The 'submissions' folder must contain an 'alpilotx' folder containing the source files" ) os.chdir(".." + os.sep + "..") europeUS = "" while (europeUS != "e" and europeUS != "u"): europeUS = functions.getInput("Europe or US? [e/u]: ", 1) functions.displayMessage("------------------------\n") functions.displayMessage("Working\n") if (europeUS == "e"): mappingFile = "europe_forest_mapping.txt" continentTitle = "European" else: mappingFile = "us_forest_mapping.txt" continentTitle = "USA" file = open("trunk" + os.sep + "bin" + os.sep + mappingFile) mappingFileContents = file.readlines() file.close()
print("Circumference of a triangle is:", 2*TriangleSideLenght+TriangleHeight) if UserShapeInput=="square": SquareSideLength=int(input("Please enter square side length: ")) print("Area of a square is: ", SquareSideLength*SquareSideLength) print("Circumference of a square is: ", 4*SquareSideLength) if UserShapeInput=="rectangle": RectangleFirstSideLenght=int(input("Plese enter rectangle first side lenght: ")) RectagleSecondSideLenght=int(input("Please enter rectangle second side lenght: ")) print("Area of a rectangle is: ", RectangleFirstSideLenght*RectagleSecondSideLenght) print("Circumference of a rectangle is: ",2*(RectangleFirstSideLenght+RectagleSecondSideLenght)) ''' import functions programRuns = True while programRuns: userInput = functions.getInput() IsItOk = functions.checkInput(userInput) print(IsItOk) while IsItOk != True: userInput = functions.getInput() IsItOk = functions.checkInput(userInput) if userInput == "triangle": functions.calculateTriangle() programRuns = False if userInput == "square": functions.calculateSquare() programRuns = False if userInput == "rectangle": functions.calculateRectangle() programRuns = False