Ejemplo n.º 1
0
 def __init__(self):
     "Set the default preferences, execute title & preferences fileName."
     #Set the default preferences.
     self.archive = []
     self.activateExport = preferences.BooleanPreference().getFromValue(
         'Activate Export', True)
     self.archive.append(self.activateExport)
     self.alsoSendOutputTo = preferences.StringPreference().getFromValue(
         'Also Send Output To:', '')
     self.archive.append(self.alsoSendOutputTo)
     self.deleteComments = preferences.BooleanPreference().getFromValue(
         'Delete Comments', True)
     self.archive.append(self.deleteComments)
     self.deleteM110GcodeLine = preferences.BooleanPreference(
     ).getFromValue('Delete M110 Gcode Line', True)
     self.archive.append(self.deleteM110GcodeLine)
     exportPluginFilenames = gcodec.getPluginFilenames(
         'export_plugins', __file__)
     self.exportLabel = preferences.LabelDisplay().getFromName(
         'Export Operations: ')
     self.archive.append(self.exportLabel)
     self.exportOperations = []
     self.exportPlugins = []
     exportRadio = []
     self.doNotChangeOutput = preferences.RadioCapitalized().getFromRadio(
         'Do Not Change Output', exportRadio, True)
     for exportPluginFilename in exportPluginFilenames:
         exportPlugin = preferences.RadioCapitalized().getFromRadio(
             exportPluginFilename, exportRadio, False)
         self.exportPlugins.append(exportPlugin)
     self.exportOperations = [self.doNotChangeOutput]
     self.exportOperations += self.exportPlugins
     self.exportOperations.sort(
         key=preferences.RadioCapitalized.getLowerName)
     self.exportOperationsButtons = []
     for exportOperation in self.exportOperations:
         self.exportOperationsButtons.append(exportOperation)
         if exportOperation != self.doNotChangeOutput:
             pluginModule = gcodec.getModule(exportOperation.name,
                                             'export_plugins', __file__)
             if pluginModule != None:
                 if pluginModule.isArchivable():
                     displayToolButtonBesidePrevious = preferences.DisplayToolButtonBesidePrevious(
                     ).getFromFolderName('export_plugins', __file__,
                                         exportOperation.name)
                     self.exportOperationsButtons.append(
                         displayToolButtonBesidePrevious)
     self.archive += self.exportOperationsButtons
     self.fileExtension = preferences.StringPreference().getFromValue(
         'File Extension:', 'gcode')
     self.archive.append(self.fileExtension)
     self.fileNameInput = preferences.Filename().getFromFilename(
         interpret.getGNUTranslatorGcodeFileTypeTuples(),
         'Open File to be Exported', '')
     self.archive.append(self.fileNameInput)
     #Create the archive, title of the execute button, title of the dialog & preferences fileName.
     self.executeTitle = 'Export'
     self.saveTitle = 'Save Preferences'
     preferences.setHelpPreferencesFileNameTitleWindowPosition(
         self, 'skeinforge_tools.export.html')
Ejemplo n.º 2
0
	def __init__( self ):
		"Set the default preferences, execute title & preferences fileName."
		#Set the default preferences.
		self.archive = []
		self.activateExport = preferences.BooleanPreference().getFromValue( 'Activate Export', True )
		self.archive.append( self.activateExport )
		self.alsoSendOutputTo = preferences.StringPreference().getFromValue( 'Also Send Output To:', '' )
		self.archive.append( self.alsoSendOutputTo )
		self.deleteComments = preferences.BooleanPreference().getFromValue( 'Delete Comments', True )
		self.archive.append( self.deleteComments )
		self.deleteM110GcodeLine = preferences.BooleanPreference().getFromValue( 'Delete M110 Gcode Line', True )
		self.archive.append( self.deleteM110GcodeLine )
		exportPluginFilenames = gcodec.getPluginFilenames( 'export_plugins', __file__ )
		self.exportLabel = preferences.LabelDisplay().getFromName( 'Export Operations: ' )
		self.archive.append( self.exportLabel )
		self.exportOperations = []
		self.exportPlugins = []
		exportRadio = []
		self.doNotChangeOutput = preferences.RadioCapitalized().getFromRadio( 'Do Not Change Output', exportRadio, True )
		for exportPluginFilename in exportPluginFilenames:
			exportPlugin = preferences.RadioCapitalized().getFromRadio( exportPluginFilename, exportRadio, False )
			self.exportPlugins.append( exportPlugin )
		self.exportOperations = [ self.doNotChangeOutput ]
		self.exportOperations += self.exportPlugins
		self.exportOperations.sort( key = preferences.RadioCapitalized.getLowerName )
		self.exportOperationsButtons = []
		for exportOperation in self.exportOperations:
			self.exportOperationsButtons.append( exportOperation )
			if exportOperation != self.doNotChangeOutput:
				pluginModule = gcodec.getModule( exportOperation.name, 'export_plugins', __file__ )
				if pluginModule != None:
					if pluginModule.isArchivable():
						displayToolButtonBesidePrevious = preferences.DisplayToolButtonBesidePrevious().getFromFolderName( 'export_plugins', __file__, exportOperation.name )
						self.exportOperationsButtons.append( displayToolButtonBesidePrevious )
		self.archive += self.exportOperationsButtons
		self.fileExtension = preferences.StringPreference().getFromValue( 'File Extension:', 'gcode' )
		self.archive.append( self.fileExtension )
		self.fileNameInput = preferences.Filename().getFromFilename( interpret.getGNUTranslatorGcodeFileTypeTuples(), 'Open File to be Exported', '' )
		self.archive.append( self.fileNameInput )
		#Create the archive, title of the execute button, title of the dialog & preferences fileName.
		self.executeTitle = 'Export'
		self.saveTitle = 'Save Preferences'
		preferences.setHelpPreferencesFileNameTitleWindowPosition( self, 'skeinforge_tools.export.html' )
Ejemplo n.º 3
0
def getSkeinforgeToolFilenames():
	"Get skeinforge plugin fileNames."
	return gcodec.getPluginFilenames( 'skeinforge_tools', __file__ )
Ejemplo n.º 4
0
def getAnalyzePluginFilenames():
	"Get analyze plugin fileNames."
	return gcodec.getPluginFilenames( 'analyze_plugins', __file__ )
Ejemplo n.º 5
0
def getImportPluginFilenames():
	"Get analyze plugin fileNames."
	return gcodec.getPluginFilenames( 'import_plugins', os.path.dirname( __file__ ) )