コード例 #1
0
	def run( self ):
		check_for_path( self.getPath(), "No directory specified!" )
		mApp().debugN( self, 4, 'checking directory "{0}"'.format( self.getPath() ) )
		if ( os.path.exists( str( self.getPath() ) ) ):
			return 0
		else:
			return 1
コード例 #2
0
ファイル: RmDirAction.py プロジェクト: KDAB/Make-O-Matic
 def run(self):
     check_for_path(self.getPath(), "No directory specified!")
     mApp().debugN(self, 2, 'deleting directory "{0}"'.format(self.getPath()))
     try:
         rmtree(str(self.getPath()))
         return 0
     except (OSError, IOError) as e:
         error = 'error deleting directory "{0}": {1}'.format(self.getPath(), str(e))
         self._setStdErr(error.encode())
         mApp().debug(self, error)
         return 1
コード例 #3
0
ファイル: DoxygenGenerator.py プロジェクト: KDAB/Make-O-Matic
	def setup( self ):
		check_for_path( self.getDoxygenFile(), 'The doxygen configuration file name needs to be a nonempty string!' )
		docsDir = os.path.join( self.getInstructions().getBaseDir(), self.getDocsDir() or self.getInstructions().getDocsDir() )

		# create folders if necessary
		if self.getDocsDir():
			# make docs folder
			step = self.getInstructions().getStep( 'create-folders' )
			step.addMainAction( MkDirAction( docsDir ) )

			# cleanup
			step = self.getInstructions().getStep( 'cleanup' )
			step.addMainAction( RmDirAction( docsDir ) )

		# run doxygen
		step = self.getInstructions().getStep( 'create-docs' )
		cmd = [ self.getCommand(), str( self.getDoxygenFile() ) ]
		doxygenCall = ShellCommandAction( cmd, searchPaths = self.getCommandSearchPaths() )
		doxygenCall.setWorkingDirectory( docsDir )
		step.addMainAction( doxygenCall )
コード例 #4
0
ファイル: Action.py プロジェクト: KDAB/Make-O-Matic
 def setWorkingDirectory(self, workingDir):
     """Set the directory to execute the command in."""
     check_for_path(workingDir, "The working directory parameter must be a string containing a directory name.")
     self.__workingDir = workingDir
コード例 #5
0
	def setSrcDir( self, srcDir ):
		check_for_path( srcDir, 'The course folder needs to be a non-empty string!' )
		self.__srcDir = srcDir
コード例 #6
0
ファイル: DirActionBase.py プロジェクト: KDAB/Make-O-Matic
	def setPath( self, path ):
		check_for_path( path, "The directory to create must be a non-empty name of a directory!" )
		self.__path = path
コード例 #7
0
ファイル: RunCommand.py プロジェクト: mirkoboehm/Make-O-Matic
	def setWorkingDir( self, dir ):
		check_for_path( dir, 'The working directory must be a non-empty string!' )
		self.__workingDir = str( dir )