本文整理汇总了Python中skeinforge_tools.skeinforge_utilities.interpret.getImportPluginFilenames函数的典型用法代码示例。如果您正苦于以下问题:Python getImportPluginFilenames函数的具体用法?Python getImportPluginFilenames怎么用?Python getImportPluginFilenames使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getImportPluginFilenames函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: execute
def execute(self):
"Comb button has been clicked."
fileNames = polyfile.getFileOrDirectoryTypesUnmodifiedGcode(
self.fileNameInput.value, interpret.getImportPluginFilenames(), self.fileNameInput.wasCancelled
)
for fileName in fileNames:
writeOutput(fileName)
示例2: getCarving
def getCarving( fileName ):
"Get a carving for the file using an import plugin."
importPluginFilenames = interpret.getImportPluginFilenames()
for importPluginFilename in importPluginFilenames:
fileTypeDot = '.' + importPluginFilename
if fileName[ - len( fileTypeDot ) : ].lower() == fileTypeDot:
importPluginsDirectoryPath = gcodec.getAbsoluteFolderPath( os.path.dirname( __file__ ), 'import_plugins' )
pluginModule = gcodec.getModuleWithDirectoryPath( importPluginsDirectoryPath, importPluginFilename )
if pluginModule != None:
return pluginModule.getCarving( fileName )
print( 'Could not find plugin to handle ' + fileName )
return None
示例3: writeOutput
def writeOutput( fileName = '' ):
"Chop a GNU Triangulated Surface file. If no fileName is specified, chop the first GNU Triangulated Surface file in this folder."
if fileName == '':
unmodified = gcodec.getFilesWithFileTypesWithoutWords( interpret.getImportPluginFilenames() )
if len( unmodified ) == 0:
print( "There are no carvable files in this folder." )
return
fileName = unmodified[ 0 ]
startTime = time.time()
print( 'File ' + gcodec.getSummarizedFilename( fileName ) + ' is being chopped.' )
chopGcode = getCraftedText( fileName )
if chopGcode == '':
return
suffixFilename = fileName[ : fileName.rfind( '.' ) ] + '_chop.svg'
suffixDirectoryName = os.path.dirname( suffixFilename )
suffixReplacedBaseName = os.path.basename( suffixFilename ).replace( ' ', '_' )
suffixFilename = os.path.join( suffixDirectoryName, suffixReplacedBaseName )
gcodec.writeFileText( suffixFilename, chopGcode )
print( 'The chopped file is saved as ' + gcodec.getSummarizedFilename( suffixFilename ) )
print( 'It took ' + str( int( round( time.time() - startTime ) ) ) + ' seconds to chop the file.' )
preferences.openWebPage( suffixFilename )