Пример #1
0
 def parse_decomp(self, directory):
     decomposition_data = ParsingFunctions.parse_decomposition(directory)
     self.inputfilename = decomposition_data['input file name']
     self.pi = decomposition_data['Pi info']
     self.patch = decomposition_data['Patch Vectors']
     self.radius = decomposition_data["radius"]
     self.center = decomposition_data["center"]
     self.num_patches = decomposition_data['num patches']
Пример #2
0
    def parse_decomp(self, directory):
		decomposition_data = ParsingFunctions.parse_decomposition(directory)
		self.inputfilename = decomposition_data['input file name']
		self.pi = decomposition_data['Pi info']
		self.patch = decomposition_data['Patch Vectors']
		self.radius = decomposition_data["radius"]
		self.center = decomposition_data["center"]
		self.num_patches = decomposition_data['num patches']
Пример #3
0
 def parse_surf(self, directory):
     surf_data = ParsingFunctions.parse_Surf(directory)
     self.num_faces = surf_data[0]
     self.num_edges = surf_data[1]
     self.num_midpoint_slices = surf_data[2]
     self.num_critical_point_slices = surf_data[3]
     self.num_singular_curves = surf_data[4]
     self.singular_curve_multiplicities = surf_data[5]
Пример #4
0
def create_command_handler(bot, update, filtered_command_list):
    """takes the message_filtered and creates the command that must be eventually execute"""
    logger.info('{} User: {}'.format(filtered_command_list, update))
    new_filtered_command = []
    for scan in filtered_command_list:
        if scan != 'execute' and scan != 'config':
            new_filtered_command.append(scan)
    try:
        if filtered_command_list[1] == "see":
            send_msg_html(
                bot, update,
                show_task_info(
                    ParsingFunctions.find_task(new_filtered_command[0])))
    except:
        pass
    if len(filtered_command_list) == 0:
        send_msg_html(bot, update, 'Error! no command found')
    if new_filtered_command[0].lower() == "view":
        new_filtered_command = ['task']
        run_command(bot, update, new_filtered_command)
    elif new_filtered_command[0].lower() == "see":
        try:
            send_msg_html(
                bot, update,
                show_task_info(
                    ParsingFunctions.find_task(new_filtered_command[1])))
        except IndexError:
            send_msg_html(bot, update,
                          '"see" function must have id_task as argument')
    elif new_filtered_command[0].lower() == "completed":
        show_task_completed(bot, update)
    elif new_filtered_command[0].lower() == "deleted":
        show_task_deleted(bot, update)
    elif new_filtered_command[0].lower() == "recurring":
        show_task_recurring(bot, update)
    elif new_filtered_command[0].lower() == "waiting":
        show_task_waiting(bot, update)
    else:
        new_filtered_command.insert(0, 'task')
        new_filtered_command[1] = new_filtered_command[1].lower()
        run_command(bot, update, new_filtered_command)
Пример #5
0
 def gather(self):
     self.directory_info = ParsingFunctions.parse_directory_name()
     self.find_directory(self.directory_info[0])
     print("gathering data from " + self.directory)
     self.dimension = int(self.directory_info[2])
     # gather vertices
     self.gather_vertices()
     if self.dimension == 1:
         # polynomial is a curve
         self.gather_curve(self.directory)
     elif self.dimension == 2:
         # polynomial is a surface
         self.gather_surface(self.directory)
     print("done gathering decomposition")
Пример #6
0
    def __init__(self):
        self.filenames = []
        self.num_vertices = 0
        self.vertices = []
        self.directory_info = ParsingFunctions.parse_directory_name()
        self.find_directory(self.directory_info[0])
        print("gathering data from " + self.directory)

        self.dimension = int(self.directory_info[2])

        # gather vertices
        self.gather_vertices()
        if self.dimension == 1:
            # polynomial is a curve
            self.gather_curve(self.directory)
        elif self.dimension == 2:
            # polynomial is a surface
            self.gather_surface(self.directory)

        print("done gathering decomposition")
Пример #7
0
 def gather_surface_samples(self, directory):
     self.surface_sampler_data = ParsingFunctions.parse_Surface_Sampler(
         directory)
Пример #8
0
 def gather_faces(self, directory):
     self.faces = ParsingFunctions.parse_Faces(directory)
Пример #9
0
def show_task_recurring(bot, update):
    """Show in a message all recurring tasks and their related details."""
    all_task_list = ParsingFunctions.parsin_json()
    task_list = all_task_list[3]
    message_list = ParsingFunctions.select_output(task_list)
    send_long_HTML(bot, update, message_list)
Пример #10
0
def show_task_info(task):
    """Create the output for send all informations of the task identified. return string"""
    message_out = ParsingFunctions.select_output(task)[0]
    return message_out
Пример #11
0
	def parse_curve_sampler(self, directory):
		self.curve_sampler_data = ParsingFunctions.parse_Curve_Sampler(directory)
Пример #12
0
	def parse_edge(self, directory):
		edge_data = ParsingFunctions.parse_Edges(directory)
		self.num_edges = edge_data['number of edges']
		self.edges = edge_data['edges']
Пример #13
0
	def parse_curve_sampler(self, directory):
		self.sampler_data = ParsingFunctions.parse_Curve_Sampler(directory)
Пример #14
0
	def parse_edge(self, directory):
		edge_data = ParsingFunctions.parse_Edges(directory)
		self.num_edges = edge_data['number of edges']
		self.edges = edge_data['edges']