def convert(self, file_name): temp_dir = './temp_Dir' file_operations = FileOperations() file_operations.unzip_csar(file_name, temp_dir) entry_file_name = file_operations.read_tosca_meta_file(temp_dir) node_list, node_keys = self.get_nodes(entry_file_name, temp_dir) yaml, content = file_operations.read_file(Path(temp_dir, entry_file_name)) updated_content = self.operation_connectTo(content, node_keys, node_list) updated_content = self.operaton_encryption(updated_content,node_keys) file_operations.write_file(yaml, updated_content, (Path(temp_dir, entry_file_name))) modified = file_operations.zip_csar(file_name, temp_dir) return modified
datafolder = foldername + "data/" cwd = os.getcwd() newpath = cwd + "/" + datafolder if not os.path.exists(newpath): os.makedirs(newpath) imagefile = datafolder + filename + '.png' textfile = open(datafolder + filename + '.txt', 'a') file_operations.save_to_folder(textfile, imagefile, bounding_box, final) # todo get classes through GUI classes = [] #interface = CLI() file_operations = FileOperations() motor = MotorControl() camera = ImageCapture(RPI_CAMERA) image_processor = ImageProcessing(camera.capture()) delay = 1 / 1000.0 #images = input("How many images do you want per category (5 categories)?") images = 10000 STEPS_FOR_FULL_CIRCLE = 12360 steps = int(STEPS_FOR_FULL_CIRCLE / images) classes = ["Banana"] #, "Rolle"] only_snippets = False only_train_images = True ## Section for the configuration
import argparse import sys from file_operations import FileOperations parser = argparse.ArgumentParser( description="Trim whitespace from all lines in the input file") parser.add_argument("file_path", help="Full path to input file") if __name__ == "__main__": args = parser.parse_args() if len(sys.argv) < 1: parser.print_help() exit(-1) file_operations = FileOperations(args.file_path) file_operations.execute()
def setUp(self): self.data_pipeline_parser = ModifyConnectionType() self.file_operations = FileOperations() self.data_encryption = DataEncryption() self.verify_connection_type = ValidateConnectionType() self.temp_dir = './temp_Dir'