def device_time_relationship(TEST): TIME_MOUSE_CLASS = [] TIME_TOUCHPAD_CLASS = [] ID_LIST = [] for i in range(1, TEST+1): form_mouse = get_form('data/'+str(i)+'/mouse.txt') form_touchpad = get_form('data/'+str(i)+'/touchpad.txt') ID_list_mouse, ID_class_mouse = get_ID_list(form_mouse) time_list_mouse, time_ID_class_mouse = get_ID_time_list(ID_list_mouse, form_mouse) ID_list_touchpad, ID_class_touchpad = get_ID_list(form_touchpad) time_list_touchpad, time_ID_class_touchpad = get_ID_time_list(ID_list_touchpad, form_touchpad) if i == 1 : X_, ID_LIST = get_ID_list(form_mouse) TIME_MOUSE_CLASS = time_ID_class_mouse TIME_TOUCHPAD_CLASS = time_ID_class_touchpad else : for j in range(0, COMBINATION): TIME_MOUSE_CLASS[j] += time_ID_class_mouse[j] TIME_TOUCHPAD_CLASS[j] += time_ID_class_touchpad[j] for j in range(0, COMBINATION): TIME_MOUSE_CLASS[j] /= TEST TIME_TOUCHPAD_CLASS[j] /= TEST return TIME_MOUSE_CLASS, TIME_TOUCHPAD_CLASS, ID_LIST
def device_error_relationship(TEST): ERROR_MOUSE_CLASS = [] ERROR_TOUCHPAD_CLASS = [] ID_LIST = [] for i in range(1, TEST+1): form_mouse = get_form('data/'+str(i)+'/mouse.txt') form_touchpad = get_form('data/'+str(i)+'/touchpad.txt') ID_list_mouse, ID_class_mouse = get_ID_list(form_mouse) error_ID_class_mouse = get_ID_error_list(ID_list_mouse, form_mouse) ID_list_touchpad, ID_class_touchpad = get_ID_list(form_touchpad) error_ID_class_touchpad = get_ID_error_list(ID_list_touchpad, form_touchpad) if i == 1 : X_, ID_LIST = get_ID_list(form_mouse) ERROR_MOUSE_CLASS = error_ID_class_mouse ERROR_TOUCHPAD_CLASS = error_ID_class_touchpad else : for j in range(0, COMBINATION): ERROR_MOUSE_CLASS[j] += error_ID_class_mouse[j] ERROR_TOUCHPAD_CLASS[j] += error_ID_class_touchpad[j] for j in range(0, COMBINATION): ERROR_MOUSE_CLASS[j] /= TEST ERROR_TOUCHPAD_CLASS[j] /= TEST return ERROR_MOUSE_CLASS, ERROR_TOUCHPAD_CLASS, ID_LIST
def sort_macros(mcs_product, mcs_names, macros): #mcs always counts as the last macro # print('sorting') # print(mcs_product) name_indices = {} i = 0 for mcs_name in mcs_names: name_indices[utils.parse(mcs_name)] = len(macros) + i i += 1 for i in range(0, len(mcs_product.children[0].children[0].children)): node = mcs_product.children[0].children[0].children[i] if is_macro(node): name_indices[utils.get_name(node)] = i name_key = lambda macro: name_indices[utils.get_name(macro) ] #Secondary sort length_key = lambda macro: -len(utils.get_form(macro)) #Primary sort macros.sort(key=name_key) #This works because of stable sorting macros.sort(key=length_key)
#encoding=UTF-8 # # 2015.12.10 by shenwei @GuiYang # ============================== # 利用判断表单命名是否包含业务线的关键词来确定业务线的表单ID # import utils cur_mysql = utils.mysql_conn() oracle_conn = utils.oracle_conn() cur_oracle = oracle_conn.cursor() # 业务线1的关键词是:人力资源 utils.get_form(cur_oracle, cur_mysql, 1, '人力资源服务许可') # 业务线2的关键词是:劳务派遣 utils.get_form(cur_oracle, cur_mysql, 2, '劳务派遣') # 同步其它类型的表单 utils.get_form(cur_oracle, cur_mysql, 1, '分管领导指派优先办理') utils.get_form(cur_oracle, cur_mysql, 2, '分管领导指派优先办理') cur_mysql.close() cur_oracle.close() oracle_conn.close() # # Eof #
#encoding=UTF-8 # # 2015.12.10 by shenwei @GuiYang # ============================== # 利用判断表单命名是否包含业务线的关键词来确定业务线的表单ID # import utils cur_mysql = utils.mysql_conn() oracle_conn = utils.oracle_conn() cur_oracle = oracle_conn.cursor() # 业务线1的关键词是:人力资源 utils.get_form(cur_oracle,cur_mysql,1,'人力资源服务许可') # 业务线2的关键词是:劳务派遣 utils.get_form(cur_oracle,cur_mysql,2,'劳务派遣') # 同步其它类型的表单 utils.get_form(cur_oracle,cur_mysql,1,'分管领导指派优先办理') utils.get_form(cur_oracle,cur_mysql,2,'分管领导指派优先办理') cur_mysql.close() cur_oracle.close() oracle_conn.close() # # Eof #
#encoding=UTF-8 # # 2015.12.10 by shenwei @GuiYang # ============================== # 利用判断表单命名是否包含业务线的关键词来确定业务线的表单ID # import utils cur_mysql = utils.mysql_conn() oracle_conn = utils.oracle_conn() cur_oracle = oracle_conn.cursor() # 业务线1的关键词是:人力资源 utils.get_form(cur_oracle,cur_mysql,1,'人力资源服务许可') # 业务线2的关键词是:劳务派遣 utils.get_form(cur_oracle,cur_mysql,2,'劳务派遣') # 同步其它类型的表单 utils.get_form(cur_oracle,cur_mysql,1,'分管领导指派优先办理') utils.get_form(cur_oracle,cur_mysql,2,'分管领导指派优先办理') # # 台湾、香港、澳门人员就业证办理就业审批表 # 台湾、香港、澳门人员就业证办理就业审批补正 # # utils.get_form(cur_oracle,cur_mysql,3,'台湾、香港、澳门人员就业证办理就业') # # 特殊工时工作制审批表 #
#encoding=UTF-8 # # 2015.12.10 by shenwei @GuiYang # ============================== # 利用判断表单命名是否包含业务线的关键词来确定业务线的表单ID # import utils cur_mysql = utils.mysql_conn() oracle_conn = utils.oracle_conn() cur_oracle = oracle_conn.cursor() # 业务线1的关键词是:人力资源 utils.get_form(cur_oracle, cur_mysql, 1, '人力资源服务许可') # 业务线2的关键词是:劳务派遣 utils.get_form(cur_oracle, cur_mysql, 2, '劳务派遣') # 同步其它类型的表单 utils.get_form(cur_oracle, cur_mysql, 1, '分管领导指派优先办理') utils.get_form(cur_oracle, cur_mysql, 2, '分管领导指派优先办理') # # 台湾、香港、澳门人员就业证办理就业审批表 # 台湾、香港、澳门人员就业证办理就业审批补正 # # utils.get_form(cur_oracle, cur_mysql, 3, '台湾、香港、澳门人员就业证办理就业') # # 特殊工时工作制审批表 #