def __get_value(self): yml_data = yml.get_yaml_data(self.conf_path) if yml_data.has_key(self.__step): value = yml_data.get(self.__step) return value else: logging.error("Step KeyError: %s not in the config file" % self.__step)
def get_custom_dir(): conf_dir = get_package_dir.conf_dir custom_config_path = "%s/custom.yml" % conf_dir conf_data = yml_operation.get_yaml_data(custom_config_path) cus_dir = conf_data.get("custom_dir") if not cus_dir or not os.path.isdir(cus_dir): cus_dir = get_package_dir.get_package_dir("miraCustom") cus_dir = cus_dir.replace("\\", "/") return cus_dir
def get_buttons(): # get conf path conf_dir = pipeGlobal.conf_dir shelf_conf_path = join_path.join_path2(conf_dir, "maya_shelf.yml") shelf_conf_data = yml_operation.get_yaml_data(shelf_conf_path) pipeline_shelf = shelf_conf_data["pipeline_shelf"] pipeline_buttons = sorted(pipeline_shelf, key=lambda key: pipeline_shelf[key]["order"]) return pipeline_buttons
def get_actions(self): conf_path = os.path.abspath(os.path.join(__file__, "..", "conf.yml")).replace( "\\", "/") conf_data = yml_operation.get_yaml_data(conf_path) if self.engine in conf_data: return conf_data[self.engine] else: print "conf.yml not include current engine" % self.engine return
def init_context_combo(self): conf_path = os.path.join(os.path.dirname(__file__), "context.yml") context_data = yml_operation.get_yaml_data(conf_path) contexts = context_data["contexts"].split(",") self.context_model = QStandardItemModel() for context in contexts: item = QStandardItem(context) item.qcer = self.get_context_qcer(context) self.context_model.appendRow(item) self.context_combo.setModel(self.context_model) self.context_combo.setCurrentIndex(self.context_combo.count()+1)
def showEvent(self, event): scene_name = mc.file(q=1, sn=1) if not scene_name: return conf_file = "%s/%s.yml" % ( conf_dir, os.path.splitext(os.path.basename(scene_name))[0]) if not os.path.isfile(conf_file): return yml_data = yml_operation.get_yaml_data(conf_file) if yml_data["file_name"] == scene_name: data = yml_data.get("data") if not data: return for i in data: layer = i.get("layer") checked = i.get("checked") objects = i.get("objects") check_box = self.do_add(layer, objects) check_box.setChecked(checked)
def st_conf_data(cls): obj = cls() conf_path = obj.get_conf_path() conf_data = yml_operation.get_yaml_data(conf_path) return conf_data
def get_plugin_conf_data(): plugin_conf_path = join_path.join_path2(conf_dir, "plugins.yml") yml_data = yml.get_yaml_data(plugin_conf_path) return yml_data
def get_hud_conf(): hud_conf_dir = pipeGlobal.conf_dir hud_conf_path = join_path.join_path2(hud_conf_dir, "hud.yml") hud_data = yml_operation.get_yaml_data(hud_conf_path) return hud_data
def __get_value(yml_name): from miraLibs.pyLibs import yml_operation yml_path = "%s/%s.yml" % (conf_dir, yml_name) return yml_operation.get_yaml_data(yml_path)
def conf_data(self): conf_path = self.get_conf_path() conf_data = yml_operation.get_yaml_data(conf_path) return conf_data
def get_yml_data(yml_path): yml_data = yml_operation.get_yaml_data(yml_path) return yml_data