Beispiel #1
0
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]()
    if len(selected_versions) < 1:
        return (False, "No versions selected.")

    for version in selected_versions:
        meta = version.Metadata(gen.frame())
        path = meta['Data']['File']['Path']

        mat = PAT_FILEBASENAME.findall(path)
        if len(mat):
            shotname = mat[0]
            gen.add_meta(version, shotname)
            log.info("Setting metadata of {0} to {1}".format(version.Name, shotname))
        else:
            log.warning("Skipping " + os.path.basename(path))

    return (True, "")
        
if __name__ == '__main__':
    from epp.gen.controller import gen_controller

    epp_root = osplus.get_env("EPP_ROOT")
    cur_settings = settings.XMLSettings(os.path.join(epp_root, "config.xml") )
    patterns = cur_settings.findall("shotpattern", "pattern")
    gen = gen_controller()

    ret, msg = generate_meta(gen, patterns.values()[1])
    if not ret:
        log.error(msg)

    def _setup_generation(self):
        """docstring for _setup_generation"""
        self._gen = gen_controller()

        return self._gen.status()
Beispiel #4
0
    def _setup_generation(self):
        """docstring for _setup_generation"""
        self._gen = gen_controller()

        return self._gen.status()
Beispiel #5
0
    if len(selected_versions) < 1:
        return (False, "No versions selected.")

    for version in selected_versions:
        meta = version.Metadata(gen.frame())
        path = meta['Data']['File']['Path']

        mat = PAT_FILEBASENAME.findall(path)
        if len(mat):
            shotname = mat[0]
            gen.add_meta(version, shotname)
            log.info("Setting metadata of {0} to {1}".format(
                version.Name, shotname))
        else:
            log.warning("Skipping " + os.path.basename(path))

    return (True, "")


if __name__ == '__main__':
    from epp.gen.controller import gen_controller

    epp_root = osplus.get_env("EPP_ROOT")
    cur_settings = settings.XMLSettings(os.path.join(epp_root, "config.xml"))
    patterns = cur_settings.findall("shotpattern", "pattern")
    gen = gen_controller()

    ret, msg = generate_meta(gen, patterns.values()[1])
    if not ret:
        log.error(msg)