def finduser_nc(self , historyFile , ver , wip ='' , subject = '' ): if QFileInfo(historyFile).isFile(): nc = NoteContainer() nc.importSAX(str(historyFile)) nc = nc.getNotes(True) else : return False temp= [ x.author for x in nc if x.version == int(ver) and x.wipversion == int(wip) and x.subject.strip()==subject ] return '.'+temp[0] if temp != [] else ''
def getEventNotes(self, tab, level1, level2, level3, offset=0, archive=0): historyFile = self.getFileName(tab, level1, level2, level3, "historyFile", offset, archive) #outString = "" nc = [] if QFileInfo(historyFile).isFile(): nc = NoteContainer() nc.importSAX(str(historyFile)) #outString = n.readXML() nc = nc.getNotes(True) return nc
def accept(self): # print 'accepted' taskName = str(self.Workcode_listWidget.currentItem().text()) root = str(self.getFileName(self.tab, self.level1, self.level2, taskName, "folderTest")) historyFile = self.getFileName(self.tab, self.level1, self.level2, taskName, "historyFile") if os.path.exists(root): print "already exists." else: createFolderList = [] devFolder = os.path.join(root, "dev") pubFolder = os.path.join(root, "pub") workspaceFile = os.path.join(str(devFolder), "workspace.mel") createFolderList.append(devFolder) createFolderList.append(pubFolder) subFolderList = self.workcodedata[taskName] source_workspace = Constants.workspaceDirectory + "/" + taskName + ".mel" if not QFileInfo(source_workspace).isFile(): print 'source_workspace error' return for sub in subFolderList: createFolderList.append(os.path.join(devFolder, sub)) # 디렉토리 생성 for folder in createFolderList: os.makedirs(folder) if 'preview' in folder: os.chmod( folder , 0777 ) QFile.copy(source_workspace, workspaceFile) # workspace.mel 의 퍼미션을 읽기모드로 변경 os.chmod(workspaceFile, 0555) nc = NoteContainer() nc.add(Note(self.userName, # author self.getDate(), # date self.getTime(), # time "created", # event comment="" # comment )) # scenes 폴더에 xml 파일 생성 nc.exportXML(historyFile) if self.tab == 1: # Asset self.assetSelected(1) elif self.tab == 2: # Shot self.shotSelected(1) self.close()
def getComment_nc(self , historyFile , ver , wip ='' , subject = '' ): if QFileInfo(historyFile).isFile(): nc = NoteContainer() nc.importSAX(str(historyFile)) nc = nc.getNotes(True) else : return False temp= [ x.comment for x in nc if x.version == int(ver) and x.wipversion == int(wip) and x.subject.strip()==subject ] # for x in nc: # if x.version ==2 and x.wipversion == 1 and x.subject.strip()==subject: # print unicode(x.comment) temp2 = '' for n in temp: temp2 += n return unicode(temp2) if temp2 != '' else ''