def init_with_current_shows(self, with_shotgun=True): """Initialisation of shows :param with_shotgun: default True, will load all the show in shotgun (minus an exception list) if False load the show define in envi_info instead :note: only show header are read... id, sgtk_name, no other data """ s = self['Shows'] if with_shotgun == True: conn = self.get_conn() cpl = SQ.get_current_projects(conn=conn) for cp in cpl: s.addChild(cp) else: conn = self.get_conn() from dskenv.api.dsk_studio import DskStudio envi_info = DskStudio() envi_info.reset(os.environ.get(dskenv_constants.DSK_ENV_PATH_KEY)) envi_info.load_data() sgtks_names = envi_info.get_projects() cpl = SQ.get_current_projects(conn=conn, sgtk_names=sgtks_names) for cp in cpl: s.addChild(cp)
def test_all_show(): a = ShotgunQuery.get_current_projects(conn) print([(x.getName(), x.id) for x in a]) assert len(a) > 0