Exemplo n.º 1
0
def getUsersInDepartments( departments, departmentsFilesPaths ):
	"""docstring for getUsersInDepartments"""
	fils = [a for a in fl.filesInDir( departmentsFilesPaths, True, '.mails' ) if any( [ a.name == d for d in departments ] )]
	mails = []
	for f in fils:
		mails += f.data.replace( '\r\n','' ).split( ',' )
	mails += ['*****@*****.**']
	return list(set(mails))
Exemplo n.º 2
0
def main():
    fils = fl.filesInDir('D:/PipeL/docs', True)
    for f in fils:
        if not f.extension == '.htm':
            continue
        #search for video in file
        data = f.data
        expr = '(?:")(?P<Path>.+)(?:\.mp4")'
        file_str = re.sub(expr, partial(_replacePath, './Videos/'), f.data)
        f.write(file_str)
Exemplo n.º 3
0
def createDistVersion( basePath = 'D:/PipeL', finalPath = 'D:/PipeL/dist' ):
	compileall.compile_dir( basePath, force=True)
	fils = fl.filesInDir( 'D:/PipeL' )
	extensionToIgnore = [ '.py' ]
	foldersToSkip = [ '.git' ]
	for f in fils:
		if any( f.extension == n for n in extensionToIgnore ):
			continue
		if any( n in f.path for n in foldersToSkip ):
			continue
		if f.extension == '.pyc':
			f.move( f.path.replace( basePath, finalPath ) )
		else:
			f.copy( f.path.replace( basePath, finalPath ) )
		print f.path
Exemplo n.º 4
0
def createDistVersion(basePath='D:/PipeL', finalPath='D:/PipeL/dist'):
    compileall.compile_dir(basePath, force=True)
    fils = fl.filesInDir('D:/PipeL')
    extensionToIgnore = ['.py']
    foldersToSkip = ['.git']
    for f in fils:
        if any(f.extension == n for n in extensionToIgnore):
            continue
        if any(n in f.path for n in foldersToSkip):
            continue
        if f.extension == '.pyc':
            f.move(f.path.replace(basePath, finalPath))
        else:
            f.copy(f.path.replace(basePath, finalPath))
        print f.path
Exemplo n.º 5
0
	def showMenu(self, pos):
		tabwid = self._getCurrentTab()
		item = tabwid.currentItem()
		if uiH.USEPYQT:
			asset = item.data(32).toPyObject()
		else:
			asset = item.data(32)
		menu=QtGui.QMenu(self)
		if INHOU:
			fils = menu.addMenu('Files')
			nukIcon = QtGui.QIcon( PYFILEDIR + '/icons/houdini.png' )
			actionNewFile = QtGui.QAction(nukIcon,"New File", fils)
			fils.addAction( actionNewFile )
			self.connect( actionNewFile, QtCore.SIGNAL( "triggered()" ), self.newHoudiniFile )
			fils.addSeparator()
			#OPEN IN CURRENT NUKE
			fls = [ hfl.houdiniFile( a.path ) for a in fl.filesInDir( asset.dirPath, False ) if a.path.endswith('.hip')]
			for f in fls:
				nukIcon = QtGui.QIcon( PYFILEDIR + '/icons/houdini.png' )
				actionOpenInCurrent = QtGui.QAction(nukIcon,f.name, fils)
				fils.addAction( actionOpenInCurrent )
				self.connect( actionOpenInCurrent, QtCore.SIGNAL( "triggered()" ), lambda val = f : self.openHoudiniFile(val) )
		propIcon = QtGui.QIcon( PYFILEDIR + '/icons/question.png' )
		actionProperties = QtGui.QAction(propIcon, "Properties", menu)
		menu.addAction( actionProperties )
		self.connect( actionProperties, QtCore.SIGNAL( "triggered()" ), self.properties )
		folderIcon = QtGui.QIcon( PYFILEDIR + '/icons/folder.png' )
		actionOpenInExplorer = QtGui.QAction(folderIcon,"Open File in explorer", menu)
		menu.addAction( actionOpenInExplorer )
		self.connect( actionOpenInExplorer, QtCore.SIGNAL( "triggered()" ), self.openFileLocation )
		#COPY PATH
		actionSaveScene = QtGui.QAction("Copy File Path", menu)
		menu.addAction( actionSaveScene )
		self.connect( actionSaveScene, QtCore.SIGNAL( "triggered()" ), self.copyFilePath )
		#OPEN RENDER PATH
		actionSaveScene = QtGui.QAction(folderIcon,"Open Render Folder", menu)
		menu.addAction( actionSaveScene )
		self.connect( actionSaveScene, QtCore.SIGNAL( "triggered()" ), self.openRenderFolder )
		#OPEN RENDER PATH
		videoIcon = QtGui.QIcon( PYFILEDIR + '/icons/video.png' )
		actionOpenPlayblast = QtGui.QAction(videoIcon,"Open Playblast", menu)
		menu.addAction( actionOpenPlayblast )
		self.connect( actionOpenPlayblast, QtCore.SIGNAL( "triggered()" ), self.openPlayblast )
		menu.addSeparator()
		#DOWNLOAD UPLOAD
		downIcon = QtGui.QIcon( PYFILEDIR + '/icons/download.png' )
		uploIcon = QtGui.QIcon( PYFILEDIR + '/icons/upload.png' )
		actionCopyServer = QtGui.QAction( downIcon, "Download From Server", menu)
		actionCopyServer.setIcon( downIcon )
		menu.addAction(actionCopyServer)
		self.connect( actionCopyServer, QtCore.SIGNAL( "triggered()" ), self.copyFromServer )
		actionToServer = QtGui.QAction( uploIcon, "Upload To Server", menu)
		menu.addAction(actionToServer)
		self.connect( actionToServer, QtCore.SIGNAL( "triggered()" ), self.copyToServer )
		menu.addSeparator()
		if INMAYA:
			fils = menu.addMenu('Versions')
			#OPEN IN CURRENT NUKE
			fls = [ mfl.mayaFile( a.path ) for a in fl.filesInDir( asset.dirPath+'/Versions/', False ) if a.path.endswith('.ma')]
			for f in fls:
				nukIcon = QtGui.QIcon( PYFILEDIR + '/icons/maya.png' )
				actionOpenInCurrent = QtGui.QAction(nukIcon,f.name + ' - ' + f.date, fils)
				fils.addAction( actionOpenInCurrent )
				self.connect( actionOpenInCurrent, QtCore.SIGNAL( "triggered()" ), lambda val = f : self.openMayaFile(val) )
			#OPEN IN CURRENT MAYA
			mayaIcon = QtGui.QIcon( PYFILEDIR + '/icons/maya.png' )
			actionOpenInCurrent = QtGui.QAction(mayaIcon,"Open in This Maya", menu)
			menu.addAction( actionOpenInCurrent )
			self.connect( actionOpenInCurrent, QtCore.SIGNAL( "triggered()" ), self.openFileInCurrentMaya )
			menu.addSeparator()
			#IMPORT
			impIcon = QtGui.QIcon( PYFILEDIR + '/icons/import.png' )
			actionImport = QtGui.QAction(impIcon,"Import", menu)
			menu.addAction( actionImport )
			self.connect( actionImport, QtCore.SIGNAL( "triggered()" ), self.importFile )
			menu.addSeparator()
			#COPY TIME SETTINGS
			timeIcon = QtGui.QIcon( PYFILEDIR + '/icons/time.png' )
			actionCopyTime = QtGui.QAction(timeIcon,"Copy Time Settings", menu)
			menu.addAction( actionCopyTime )
			self.connect( actionCopyTime, QtCore.SIGNAL( "triggered()" ), self.copyTimeSettings )
			menu.addSeparator()
			#REFERENCE
			refIcon = QtGui.QIcon( PYFILEDIR + '/icons/reference.png' )
			actionReference = QtGui.QAction(refIcon,"Reference", menu)
			menu.addAction( actionReference )
			self.connect( actionReference, QtCore.SIGNAL( "triggered()" ), self.reference )
			menu.addSeparator()
			#SAVE IN THIS SCENE
			savIcon = QtGui.QIcon( PYFILEDIR + '/icons/save.png' )
			actionSaveScene = QtGui.QAction(savIcon,"Save Scene Here!", menu)
			menu.addAction( actionSaveScene )
			self.connect( actionSaveScene, QtCore.SIGNAL( "triggered()" ), self.saveScene )
		elif INNUKE:
			#OPEN IN CURRENT NUKE
			nukIcon = QtGui.QIcon( PYFILEDIR + '/icons/nuke.png' )
			actionOpenInCurrent = QtGui.QAction(nukIcon,"Open in This Nuke", menu)
			menu.addAction( actionOpenInCurrent )
			self.connect( actionOpenInCurrent, QtCore.SIGNAL( "triggered()" ), self.openFileInCurrentNuke )
			#SAVE IN THIS SCENE
			savIcon = QtGui.QIcon( PYFILEDIR + '/icons/save.png' )
			actionSaveScene = QtGui.QAction(savIcon,"Save Scene Here!", menu)
			menu.addAction( actionSaveScene )
			self.connect( actionSaveScene, QtCore.SIGNAL( "triggered()" ), self.saveNukeScene )


		menu.popup(tabwid.viewport().mapToGlobal(pos))