def gotoProject(self, item): name = item.asset.name() aid = item.asset.getAttribute('id') work_path = os.path.join(user_data.getAttribute('workspace'), 'Project') work_path = os.path.join(work_path, name) if not os.path.isdir(work_path): os.makedirs(work_path) os.chdir(work_path) proj_path = os.path.join(user_data.getAttribute('project_root'), name) penv.setWorkspace(work_path) penv.setProject(str(name)) penv.setProjectID(str(aid)) penv.setProjectPath(str(proj_path)) penv.setJob(str(proj_path)) ts = pms.myTasks(aid.replace('p', '')) self.tasks_list.clear() for t in ts: a = pms.asset(task_id = t.getAttribute('id')) item = AssetListItem(t, a) self.tasks_list.addItem(item) self.goto_project.emit(name) return True
def gotoTask(self, item): # name = unicode(item.text()) # aid = unicode(item.data(1).toString()) name = item.asset.name() aid = item.asset.getAttribute('id') penv.setTask(str(name)) a = pms.asset(task_id = aid) if a: penv.setAsset(str(a.name())) penv.setAssetID(str(a.getAttribute('id'))) penv.setAssetType(str(a.getAttribute('type'))) penv.setAssetPath(str(os.path.normpath(a.getAttribute('path')))) self.goto_task.emit(name) # penv.printAll() return True
def gotoTask(self): sel_item = self.tasks_list.currentItem() if not sel_item: return False name = unicode(sel_item.text()) aid = unicode(sel_item.data(1).toString()) a = pms.asset(task_id = aid) if a: os.environ['PILLARS_ASSET'] = str(a.name()) os.environ['PILLARS_ASSET_ID'] = str(a.getAttribute('id')) os.environ['PILLARS_ASSET_TYPE'] = str(a.getAttribute('type')) os.environ['PILLARS_ASSET_PATH'] = str(a.getAttribute('path')) os.environ['PILLARS_USER_TEMP'] = self.__user_data.getAttribute('workshop') self.showMessage(u'Into Task < %s >, Lanch your software.' % name) return True
def gotoProject(self): sel_item = self.projects_list.currentItem() if not sel_item: return False name = unicode(sel_item.text()) aid = unicode(sel_item.data(1).toString()) os.environ['PILLARS_PROJECT'] = str(name) os.environ['PILLARS_PROJECT_ID'] = str(aid) ts = pms.myTasks(aid.replace('p', '')) self.tasks_list.clear() for t in ts: task_id = t.getAttribute('id') a = pms.asset(task_id = task_id) item = QtGui.QListWidgetItem('%s : %s' % (a.name(), t.name())) item.setData(1, task_id) self.tasks_list.addItem(item) self.showMessage(u'Into Project < %s >, Select a task.' % name) return True