def getSelectedFolder( self ):
		"Get the selected folder."
		settingProfileSubfolder = settings.getSubfolderWithBasename( self.value, settings.getProfilesDirectoryPath( self.listSetting.craftTypeName ) )
		if settingProfileSubfolder != None:
			return settingProfileSubfolder
		toolProfileSubfolder = settings.getSubfolderWithBasename( self.value, settings.getProfilesDirectoryInAboveDirectory( self.listSetting.craftTypeName ) )
		return toolProfileSubfolder
def addListsSetCraftProfileArchive(craftSequence, defaultProfile, repository,
                                   fileNameHelp):
    "Set the craft profile archive."
    settings.addListsToRepository(fileNameHelp, '', repository)
    repository.craftSequenceLabel = settings.LabelDisplay().getFromName(
        'Craft Sequence: ', repository)
    craftToolStrings = []
    for craftTool in craftSequence[:-1]:
        craftToolStrings.append(
            settings.getEachWordCapitalized(craftTool) + '->')
    craftToolStrings.append(settings.getEachWordCapitalized(craftSequence[-1]))
    for craftToolStringIndex in xrange(0, len(craftToolStrings), 5):
        craftLine = ' '.join(
            craftToolStrings[craftToolStringIndex:craftToolStringIndex + 5])
        settings.LabelDisplay().getFromName(craftLine, repository)
    settings.LabelDisplay().getFromName('', repository)
    repository.profileList = ProfileList().getFromName('Profile List:',
                                                       repository)
    repository.profileListbox = ProfileListboxSetting().getFromListSetting(
        repository.profileList, 'Profile Selection:', repository,
        defaultProfile)
    repository.addListboxSelection = AddProfile(
    ).getFromProfileListboxSettingRepository(repository.profileListbox,
                                             repository)
    repository.deleteListboxSelection = DeleteProfile(
    ).getFromProfileListboxSettingRepository(repository.profileListbox,
                                             repository)
    directoryName = settings.getProfilesDirectoryPath()
    settings.makeDirectory(directoryName)
    repository.windowPosition.value = '0+400'
	def setValueToFolders( self ):
		"Set the value to the folders in the profiles directories."
		self.value = settings.getFolders( settings.getProfilesDirectoryPath( self.craftTypeName ) )
		defaultFolders = settings.getFolders( settings.getProfilesDirectoryInAboveDirectory( self.craftTypeName ) )
		for defaultFolder in defaultFolders:
			if defaultFolder not in self.value:
				self.value.append( defaultFolder )
		self.value.sort()
 def setValueToFolders(self):
     "Set the value to the folders in the profiles directories."
     self.value = settings.getFolders(
         settings.getProfilesDirectoryPath(self.craftTypeName))
     defaultFolders = settings.getFolders(
         settings.getProfilesDirectoryInAboveDirectory(self.craftTypeName))
     for defaultFolder in defaultFolders:
         if defaultFolder not in self.value:
             self.value.append(defaultFolder)
     self.value.sort()
	def __init__( self ):
		"Set the default entities, execute title & repository fileName."
		settings.addListsToRepository( 'skeinforge.skeinforge_utilities.skeinforge_profile.html', '', self )
		importantFileNames = [ 'extrusion' ]
		self.craftRadios = settings.getRadioPluginsAddPluginFrame( getPluginsDirectoryPath(), importantFileNames, getPluginFileNames(), self )
		ProfilePluginRadioButtonsSaveListener().getFromRadioPlugins( self.craftRadios, self )
		for craftRadio in self.craftRadios:
			craftRadio.updateFunction = self.updateRelay
		directoryName = settings.getProfilesDirectoryPath()
		settings.makeDirectory( directoryName )
		self.windowPosition.value = '0+200'
 def getSelectedFolder(self):
     "Get the selected folder."
     settingProfileSubfolder = settings.getSubfolderWithBasename(
         self.value,
         settings.getProfilesDirectoryPath(self.listSetting.craftTypeName))
     if settingProfileSubfolder != None:
         return settingProfileSubfolder
     toolProfileSubfolder = settings.getSubfolderWithBasename(
         self.value,
         settings.getProfilesDirectoryInAboveDirectory(
             self.listSetting.craftTypeName))
     return toolProfileSubfolder
	def delete( self ):
		"Delete the selection of a listbox setting."
		self.profileListboxSetting.setToDisplay()
		self.profileListboxSetting.listSetting.setValueToFolders()
		if self.profileListboxSetting.value not in self.profileListboxSetting.listSetting.value:
			return
		lastSelectionIndex = 0
		currentSelectionTuple = self.profileListboxSetting.listbox.curselection()
		if len( currentSelectionTuple ) > 0:
			lastSelectionIndex = int( currentSelectionTuple[ 0 ] )
		else:
			print( 'No profile is selected, so no profile will be deleted.' )
			return
		settings.deleteDirectory( settings.getProfilesDirectoryPath( self.profileListboxSetting.listSetting.craftTypeName ), self.profileListboxSetting.value )
		settings.deleteDirectory( getProfilesDirectoryInAboveDirectory( self.profileListboxSetting.listSetting.craftTypeName ), self.profileListboxSetting.value )
		self.profileListboxSetting.listSetting.setValueToFolders()
		if len( self.profileListboxSetting.listSetting.value ) < 1:
			defaultSettingsDirectory = settings.getProfilesDirectoryPath( os.path.join( self.profileListboxSetting.listSetting.craftTypeName, self.profileListboxSetting.defaultValue ) )
			settings.makeDirectory( defaultSettingsDirectory )
			self.profileListboxSetting.listSetting.setValueToFolders()
		lastSelectionIndex = min( lastSelectionIndex, len( self.profileListboxSetting.listSetting.value ) - 1 )
		self.profileListboxSetting.value = self.profileListboxSetting.listSetting.value[ lastSelectionIndex ]
		self.profileListboxSetting.setStateToValue()
		self.no()
 def __init__(self):
     "Set the default entities, execute title & repository fileName."
     settings.addListsToRepository(
         'skeinforge.skeinforge_utilities.skeinforge_profile.html', '',
         self)
     importantFileNames = ['extrusion']
     self.craftRadios = settings.getRadioPluginsAddPluginFrame(
         getPluginsDirectoryPath(), importantFileNames,
         getPluginFileNames(), self)
     ProfilePluginRadioButtonsSaveListener().getFromRadioPlugins(
         self.craftRadios, self)
     for craftRadio in self.craftRadios:
         craftRadio.updateFunction = self.updateRelay
     directoryName = settings.getProfilesDirectoryPath()
     settings.makeDirectory(directoryName)
     self.windowPosition.value = '0+200'
	def addSelection( self ):
		"Add the selection of a listbox setting."
		entryText = self.entry.get()
		if entryText == '':
			print( 'To add to the profiles, enter the material name.' )
			return
		self.profileListboxSetting.listSetting.setValueToFolders()
		if entryText in self.profileListboxSetting.listSetting.value:
			print( 'There is already a profile by the name of %s, so no profile will be added.' % entryText )
			return
		self.entry.delete( 0, settings.Tkinter.END )
		craftTypeProfileDirectory = settings.getProfilesDirectoryPath( self.profileListboxSetting.listSetting.craftTypeName )
		destinationDirectory = os.path.join( craftTypeProfileDirectory, entryText )
		shutil.copytree( self.profileListboxSetting.getSelectedFolder(), destinationDirectory )
		self.profileListboxSetting.listSetting.setValueToFolders()
		self.profileListboxSetting.value = entryText
		self.profileListboxSetting.setStateToValue()
def addListsSetCraftProfileArchive( craftSequence, defaultProfile, repository, fileNameHelp ):
	"Set the craft profile archive."
	settings.addListsToRepository( fileNameHelp, '', repository )
	repository.craftSequenceLabel = settings.LabelDisplay().getFromName( 'Craft Sequence: ', repository )
	craftToolStrings = []
	for craftTool in craftSequence[ : - 1 ]:
		craftToolStrings.append( settings.getEachWordCapitalized( craftTool ) + '->' )
	craftToolStrings.append( settings.getEachWordCapitalized( craftSequence[ - 1 ] ) )
	for craftToolStringIndex in xrange( 0, len( craftToolStrings ), 5 ):
		craftLine = ' '.join( craftToolStrings[ craftToolStringIndex : craftToolStringIndex + 5 ] )
		settings.LabelDisplay().getFromName( craftLine, repository )
	settings.LabelDisplay().getFromName( '', repository )
	repository.profileList = ProfileList().getFromName( 'Profile List:', repository )
	repository.profileListbox = ProfileListboxSetting().getFromListSetting( repository.profileList, 'Profile Selection:', repository, defaultProfile )
	repository.addListboxSelection = AddProfile().getFromProfileListboxSettingRepository( repository.profileListbox, repository )
	repository.deleteListboxSelection = DeleteProfile().getFromProfileListboxSettingRepository( repository.profileListbox, repository )
	directoryName = settings.getProfilesDirectoryPath()
	settings.makeDirectory( directoryName )
	repository.windowPosition.value = '0+400'
 def addSelection(self):
     "Add the selection of a listbox setting."
     entryText = self.entry.get()
     if entryText == '':
         print('To add to the profiles, enter the material name.')
         return
     self.profileListboxSetting.listSetting.setValueToFolders()
     if entryText in self.profileListboxSetting.listSetting.value:
         print(
             'There is already a profile by the name of %s, so no profile will be added.'
             % entryText)
         return
     self.entry.delete(0, settings.Tkinter.END)
     craftTypeProfileDirectory = settings.getProfilesDirectoryPath(
         self.profileListboxSetting.listSetting.craftTypeName)
     destinationDirectory = os.path.join(craftTypeProfileDirectory,
                                         entryText)
     shutil.copytree(self.profileListboxSetting.getSelectedFolder(),
                     destinationDirectory)
     self.profileListboxSetting.listSetting.setValueToFolders()
     self.profileListboxSetting.value = entryText
     self.profileListboxSetting.setStateToValue()
 def delete(self):
     "Delete the selection of a listbox setting."
     self.profileListboxSetting.setToDisplay()
     self.profileListboxSetting.listSetting.setValueToFolders()
     if self.profileListboxSetting.value not in self.profileListboxSetting.listSetting.value:
         return
     lastSelectionIndex = 0
     currentSelectionTuple = self.profileListboxSetting.listbox.curselection(
     )
     if len(currentSelectionTuple) > 0:
         lastSelectionIndex = int(currentSelectionTuple[0])
     else:
         print('No profile is selected, so no profile will be deleted.')
         return
     settings.deleteDirectory(
         getProfilesDirectoryPath(
             self.profileListboxSetting.listSetting.craftTypeName),
         self.profileListboxSetting.value)
     settings.deleteDirectory(
         getProfilesDirectoryInAboveDirectory(
             self.profileListboxSetting.listSetting.craftTypeName),
         self.profileListboxSetting.value)
     self.profileListboxSetting.listSetting.setValueToFolders()
     if len(self.profileListboxSetting.listSetting.value) < 1:
         defaultSettingsDirectory = settings.getProfilesDirectoryPath(
             os.path.join(
                 self.profileListboxSetting.listSetting.craftTypeName,
                 self.profileListboxSetting.defaultValue))
         settings.makeDirectory(defaultSettingsDirectory)
         self.profileListboxSetting.listSetting.setValueToFolders()
     lastSelectionIndex = min(
         lastSelectionIndex,
         len(self.profileListboxSetting.listSetting.value) - 1)
     self.profileListboxSetting.value = self.profileListboxSetting.listSetting.value[
         lastSelectionIndex]
     self.profileListboxSetting.setStateToValue()
     self.no()