def main(): """docstring for main""" fu_con = fu_controller() gen_con = gen_controller() apps = {} apps["add_project"] = add_project.main apps["add_shot"] = add_shot.main apps["add_shot_from_media"] = add_shot_from_media.main apps["create_saver"] = create_saver.main apps["save_as"] = save_as.main apps["set_shot"] = set_shot.main apps["update_shot"] = update_shot.main apps["save_new_version"] = fu_con.save_new_version apps["meta_from_standins"] = gen_con.meta_from_standins parser = argparse.ArgumentParser(description='Process some integers.') parser.add_argument('module', metavar='module', type=str, nargs='+', help='Which module to launch.') args = parser.parse_args() for module in args.module: if not module in apps: log.error("Module not found: " + module) else: log.info("Launching " + module) apps[module]()
def accept(self): """ Check the connection. """ cur_project = self.cmbProject.currentText() cur_shot = self.cmbShot.currentText() log.info("Setting project to " + cur_project) log.info("Setting shot to " + cur_shot) osplus.set_env("EPP_CURPROJECT", cur_project) osplus.set_env("EPP_CURSHOT", cur_shot) _fu = fu_controller() if not _fu.status(True): # No need for a dialog log.error("Fusion not running.", False) else: COMP_ROOT_DIR = shot_id_path(cur_project, cur_shot, "compositions") if os.path.isdir(COMP_ROOT_DIR): res = _fu.set_pathmap("Comps:", COMP_ROOT_DIR) log.info("Setting Comps: PathMap to {0} ({1})".format( COMP_ROOT_DIR, res[1])) super(SetShotDialog, self).accept()
def accept(self): """ Check the connection. """ _fu = fu_controller() if not _fu.status(True): log.error("Fusion not running.", True) return if os.path.isfile(self.COMP_FILEPATH): ret = QMessageBox.information( self, "Question", "Composition does already exist.\nOverwrite '{0}'".format( os.path.basename(self.COMP_FILEPATH)), QMessageBox.Yes | QMessageBox.No) if ret == QMessageBox.No: return cur_project = self.cmbProject.currentText() cur_shot = self.cmbShot.currentText() ret = _fu.save_comp(self.COMP_FILEPATH, { "project": str(cur_project), "shot": str(cur_shot) }) if not ret[0]: log.error(ret[1], True) return log.info("Saved Comp to {0}".format(self.COMP_FILEPATH)) self.hide() if self.chkUpdateSavers.isChecked(): ret = _fu.update_savers(self.spnVersion.value()) if self.chkFormat.isChecked(): _fu.set_format(project_format_object(cur_project)) osplus.set_env("EPP_CURPROJECT", self.cmbProject.currentText()) osplus.set_env("EPP_CURSHOT", self.cmbShot.currentText()) COMP_ROOT_DIR = os.path.dirname(self.COMP_FILEPATH) if os.path.isdir(COMP_ROOT_DIR): res = _fu.set_pathmap("Comps:", COMP_ROOT_DIR) log.info("Setting Comps: PathMap to {0} ({1})".format( COMP_ROOT_DIR, res[1])) super(SaveAsDialog, self).accept()
def _setup(self): """ Setup the widgets """ _fu = fu_controller() if not _fu.status(True): log.error("Fusion not running.", True) return False epp_root = osplus.get_env("EPP_ROOT") if not os.path.isdir(epp_root): log.error( "Could not find EPP ROOT directory.\n{0}".format(epp_root), True) return False self.settings = settings.XMLSettings( os.path.join(epp_root, "config.xml")) self.PROJECTROOT = self.settings.get("paths", "projectdir") if self.PROJECTROOT is None: log.error("No Project Directory configured in config.xml.", True) return False self._setup_header(epp_root) self._setup_status() self.cmbProject.currentIndexChanged.connect(self.update_shots) self.update_project() # Make sure enter does not add to combo box self.cmbName.installEventFilter(self) self.cmbProject.currentIndexChanged.connect(self._validate_path) self.cmbShot.currentIndexChanged.connect(self.update_names) self.cmbShot.currentIndexChanged.connect(self._validate_path) self.cmbName.currentIndexChanged.connect(self._validate_path) self.cmbName.lineEdit().textChanged.connect(self._validate_path) self.cmbName.lineEdit().textChanged.connect(self._get_last_version) self.spnVersion.valueChanged.connect(self._validate_path) self.butNext.clicked.connect(self._get_last_version) self._setup_defaults() self.update_names() return True
def _setup(self): """ Setup the widgets """ _fu = fu_controller() if not _fu.status(True): log.error("Fusion not running.", True) return False epp_root = osplus.get_env("EPP_ROOT") if not os.path.isdir(epp_root): log.error("Could not find EPP ROOT directory.\n{0}".format(epp_root), True) return False self.settings = settings.XMLSettings(os.path.join(epp_root, "config.xml") ) self.PROJECTROOT = self.settings.get("paths", "projectdir") if self.PROJECTROOT is None: log.error("No Project Directory configured in config.xml.", True) return False self._setup_header(epp_root) self._setup_status() self.cmbProject.currentIndexChanged.connect(self.update_shots) self.update_project() # Make sure enter does not add to combo box self.cmbName.installEventFilter(self) self.cmbProject.currentIndexChanged.connect(self._validate_path) self.cmbShot.currentIndexChanged.connect(self.update_names) self.cmbShot.currentIndexChanged.connect(self._validate_path) self.cmbName.currentIndexChanged.connect(self._validate_path) self.cmbName.lineEdit().textChanged.connect(self._validate_path) self.cmbName.lineEdit().textChanged.connect(self._get_last_version) self.spnVersion.valueChanged.connect(self._validate_path) self.butNext.clicked.connect(self._get_last_version) self._setup_defaults() self.update_names() return True
def _setup_defaults(self): """docstring for update_name""" self._fu = fu_controller() ret = self._fu.get_comp() # No connection of composition? if ret[0] == False: return ret self.comp = ret[1] # Need metadata for find out about comps project and shot. # TODO: Maybe worth parsing the path from XML? ret = self._fu.get_meta("epp", self.comp) if ret[0] == False: return ret self.metadata = ret[1] if self.metadata is not None: project = self.metadata.get("project") shot = self.metadata.get("shot") if self.metadata is None or project is None or shot is None: return (False, "Not an epp composition. Metada missing.") idx = self.cmbProject.findText(project) if idx > -1: self.cmbProject.setCurrentIndex(idx) idx = self.cmbShot.findText(shot) if idx > -1: self.cmbShot.setCurrentIndex(idx) self.lneName.setText(shot) self._match_name() self._match_version() return (True, "")
def accept(self): """ Check the connection. """ _fu = fu_controller() if not _fu.status(True): QMessageBox.critical(self, "Error", "Fusion not running.") return if os.path.isfile(self.COMP_FILEPATH): ret = QMessageBox.information( self, "Question", "Composition does already exist.\nOverwrite '{0}'".format( os.path.basename(self.COMP_FILEPATH)), QMessageBox.Yes | QMessageBox.No) if ret == QMessageBox.No: return cur_project = self.cmbProject.currentText() cur_shot = self.cmbShot.currentText() ret = _fu.save_comp(self.COMP_FILEPATH, { "project": str(cur_project), "shot": str(cur_shot) }) if not ret[0]: QMessageBox.critical(self, "Error", ret[1]) return self.hide() if self.chkUpdateSavers.isChecked(): ret = _fu.update_savers(self.spnVersion.value()) if self.chkFormat.isChecked(): _fu.set_format(project_format_object(cur_project)) osplus.set_env("EPP_CURPROJECT", self.cmbProject.currentText()) osplus.set_env("EPP_CURSHOT", self.cmbShot.currentText()) super(SaveAsDialog, self).accept()
def accept(self): """ Check the connection. """ _fu = fu_controller() if not _fu.status(True): log.error("Fusion not running.", True) return if os.path.isfile(self.COMP_FILEPATH): ret = QMessageBox.information(self, "Question", "Composition does already exist.\nOverwrite '{0}'".format(os.path.basename(self.COMP_FILEPATH)), QMessageBox.Yes | QMessageBox.No) if ret == QMessageBox.No: return cur_project = self.cmbProject.currentText() cur_shot = self.cmbShot.currentText() ret = _fu.save_comp(self.COMP_FILEPATH, {"project": str(cur_project), "shot": str(cur_shot)}) if not ret[0]: log.error(ret[1], True) return log.info("Saved Comp to {0}".format(self.COMP_FILEPATH)) self.hide() if self.chkUpdateSavers.isChecked(): ret = _fu.update_savers(self.spnVersion.value()) if self.chkFormat.isChecked(): _fu.set_format(project_format_object(cur_project)) osplus.set_env("EPP_CURPROJECT", self.cmbProject.currentText()) osplus.set_env("EPP_CURSHOT", self.cmbShot.currentText()) COMP_ROOT_DIR = os.path.dirname(self.COMP_FILEPATH) if os.path.isdir(COMP_ROOT_DIR): res = _fu.set_pathmap("Comps:", COMP_ROOT_DIR) log.info("Setting Comps: PathMap to {0} ({1})".format(COMP_ROOT_DIR, res[1])) super(SaveAsDialog, self).accept()
def accept(self): """ Check the connection. """ _fu = fu_controller() if not _fu.status(True): QMessageBox.critical(self, "Error", "Fusion not running.") return if os.path.isfile(self.COMP_FILEPATH): ret = QMessageBox.information(self, "Question", "Composition does already exist.\nOverwrite '{0}'".format(os.path.basename(self.COMP_FILEPATH)), QMessageBox.Yes | QMessageBox.No) if ret == QMessageBox.No: return cur_project = self.cmbProject.currentText() cur_shot = self.cmbShot.currentText() ret = _fu.save_comp(self.COMP_FILEPATH, {"project": str(cur_project), "shot": str(cur_shot)}) if not ret[0]: QMessageBox.critical(self, "Error", ret[1]) return self.hide() if self.chkUpdateSavers.isChecked(): ret = _fu.update_savers(self.spnVersion.value()) if self.chkFormat.isChecked(): _fu.set_format(project_format_object(cur_project)) osplus.set_env("EPP_CURPROJECT", self.cmbProject.currentText()) osplus.set_env("EPP_CURSHOT", self.cmbShot.currentText()) super(SaveAsDialog, self).accept()