Exemplo n.º 1
0
        def readSettings(self):
                self.output = cStringIO.StringIO()                
                profileDirectory = skeinforge_profile.getProfileDirectory()
                craftRepo = skeinforge_craft.CraftRepository()
                profileBaseName = settings.getProfileBaseName( craftRepo )
                allCraftNames = archive.getPluginFileNamesFromDirectoryPath( skeinforge_craft.getPluginsDirectoryPath() )

                fullProfilePath = os.path.join( archive.getSettingsPath() , 'profiles' )
                fullProfileDirectory = os.path.join( fullProfilePath , profileDirectory )

                for craftName in allCraftNames:
                        pluginModule = archive.getModuleWithPath(os.path.join( skeinforge_craft.getPluginsDirectoryPath(), craftName  ))

                        repo = pluginModule.getNewRepository()
                        self.outputSettings(craftName, settings.getReadRepository(repo).preferences)

                return self.output.getvalue()
Exemplo n.º 2
0
def fillDescription():
        descriptionExtension = '_'
        pluginModule = archive.getModuleWithPath(os.path.join( skeinforge_craft.getPluginsDirectoryPath(), 'fill'  ))
        prefs = settings.getReadRepository(pluginModule.getNewRepository()).preferences
        for pref in prefs:
                if (pref.name == 'Activate Fill:' and pref.value == False):
                        return ''
                if (pref.name == 'Infill Solidity (ratio):'):
                        infill = pref.value
                        descriptionExtension += str(pref.value).replace('.','')+'fill'
        return descriptionExtension
Exemplo n.º 3
0
    def readSettings(self):
        self.output = cStringIO.StringIO()
        profileDirectory = skeinforge_profile.getProfileDirectory()
        craftRepo = skeinforge_craft.CraftRepository()
        profileBaseName = settings.getProfileBaseName(craftRepo)
        allCraftNames = archive.getPluginFileNamesFromDirectoryPath(
            skeinforge_craft.getPluginsDirectoryPath())

        fullProfilePath = os.path.join(archive.getSettingsPath(), 'profiles')
        fullProfileDirectory = os.path.join(fullProfilePath, profileDirectory)

        for craftName in allCraftNames:
            pluginModule = archive.getModuleWithPath(
                os.path.join(skeinforge_craft.getPluginsDirectoryPath(),
                             craftName))

            repo = pluginModule.getNewRepository()
            self.outputSettings(craftName,
                                settings.getReadRepository(repo).preferences)

        return self.output.getvalue()
Exemplo n.º 4
0
def carveDescription():
        descriptionExtension = ''
        pluginModule = archive.getModuleWithPath(os.path.join( skeinforge_craft.getPluginsDirectoryPath(), 'carve'  ))
        prefs = settings.getReadRepository(pluginModule.getNewRepository()).preferences
        for pref in prefs:
                if (pref.name == 'Layer Thickness (mm):'):
                        lt = pref.value
                        descriptionExtension += str(pref.value).replace('.','')+'h'
                if (pref.name == 'Perimeter Width over Thickness (ratio):'):
                        pwot = pref.value
                        descriptionExtension += 'x' + str(lt * pwot).replace('.','') + 'w'
        return descriptionExtension
Exemplo n.º 5
0
def fillDescription():
    descriptionExtension = '_'
    pluginModule = archive.getModuleWithPath(
        os.path.join(skeinforge_craft.getPluginsDirectoryPath(), 'fill'))
    prefs = settings.getReadRepository(
        pluginModule.getNewRepository()).preferences
    for pref in prefs:
        if (pref.name == 'Activate Fill:' and pref.value == False):
            return ''
        if (pref.name == 'Infill Solidity (ratio):'):
            infill = pref.value
            descriptionExtension += str(pref.value).replace('.', '') + 'fill'
    return descriptionExtension
Exemplo n.º 6
0
def addToCraftMenu( menu ):
	"Add a craft plugin menu."
	settings.ToolDialog().addPluginToMenu(menu, archive.getUntilDot(archive.getSkeinforgePluginsPath('craft.py')))
	menu.add_separator()
	directoryPath = skeinforge_craft.getPluginsDirectoryPath()
	directoryFolders = settings.getFolders(directoryPath)
	pluginFileNames = skeinforge_craft.getPluginFileNames()
	for pluginFileName in pluginFileNames:
		pluginFolderName = pluginFileName + '_plugins'
		pluginPath = os.path.join( directoryPath, pluginFileName )
		if pluginFolderName in directoryFolders:
			addSubmenus( menu, pluginFileName, os.path.join( directoryPath, pluginFolderName ), pluginPath )
		else:
			settings.ToolDialog().addPluginToMenu( menu, pluginPath )
Exemplo n.º 7
0
def carveDescription():
    descriptionExtension = ''
    pluginModule = archive.getModuleWithPath(
        os.path.join(skeinforge_craft.getPluginsDirectoryPath(), 'carve'))
    prefs = settings.getReadRepository(
        pluginModule.getNewRepository()).preferences
    for pref in prefs:
        if (pref.name == 'Layer Thickness (mm):'):
            lt = pref.value
            descriptionExtension += str(pref.value).replace('.', '') + 'h'
        if (pref.name == 'Perimeter Width over Thickness (ratio):'):
            pwot = pref.value
            descriptionExtension += 'x' + str(lt * pwot).replace('.', '') + 'w'
    return descriptionExtension
Exemplo n.º 8
0
def addToCraftMenu( menu ):
	"Add a craft plugin menu."
	settings.ToolDialog().addPluginToMenu( menu, archive.getUntilDot( os.path.abspath( __file__ ) ) )
	menu.add_separator()
	directoryPath = skeinforge_craft.getPluginsDirectoryPath()
	directoryFolders = settings.getFolders(directoryPath)
	pluginFileNames = skeinforge_craft.getPluginFileNames()
	for pluginFileName in pluginFileNames:
		pluginFolderName = pluginFileName + '_plugins'
		pluginPath = os.path.join( directoryPath, pluginFileName )
		if pluginFolderName in directoryFolders:
			addSubmenus( menu, pluginFileName, os.path.join( directoryPath, pluginFolderName ), pluginPath )
		else:
			settings.ToolDialog().addPluginToMenu( menu, pluginPath )
Exemplo n.º 9
0
def multiplyDescription():
        descriptionExtension = ''
        pluginModule = archive.getModuleWithPath(os.path.join( skeinforge_craft.getPluginsDirectoryPath(), 'multiply'  ))
        prefs = settings.getReadRepository(pluginModule.getNewRepository()).preferences
        for pref in prefs:
                if (pref.name == 'Activate Multiply:' and pref.value == False):
                        return ''
                if (pref.name == 'Number of Columns (integer):'):
                        cols = pref.value
                if (pref.name == 'Number of Rows (integer):'):
                        rows = pref.value
        if (cols > 1 or rows > 1) :
                descriptionExtension ='_'+str(cols * rows).replace('.','')+'off'
        return descriptionExtension
Exemplo n.º 10
0
def multiplyDescription():
    descriptionExtension = ''
    pluginModule = archive.getModuleWithPath(
        os.path.join(skeinforge_craft.getPluginsDirectoryPath(), 'multiply'))
    prefs = settings.getReadRepository(
        pluginModule.getNewRepository()).preferences
    for pref in prefs:
        if (pref.name == 'Activate Multiply:' and pref.value == False):
            return ''
        if (pref.name == 'Number of Columns (integer):'):
            cols = pref.value
        if (pref.name == 'Number of Rows (integer):'):
            rows = pref.value
    if (cols > 1 or rows > 1):
        descriptionExtension = '_' + str(cols * rows).replace('.', '') + 'off'
    return descriptionExtension
Exemplo n.º 11
0
def speedDescription():
        descriptionExtension = '_'
        pluginModule = archive.getModuleWithPath(os.path.join( skeinforge_craft.getPluginsDirectoryPath(), 'speed'  ))
        prefs = settings.getReadRepository(pluginModule.getNewRepository()).preferences
        for pref in prefs:
                if (pref.name == 'Activate Speed:' and pref.value == False):
                        return ''
                if (pref.name == 'Feed Rate (mm/s):'):
                        feedrate = pref.value
                if (pref.name == 'Flow Rate Setting (float):'):
                        flowrate = pref.value
        if (feedrate == flowrate):
                descriptionExtension += str(feedrate).replace('.0','')+'Ff'
        else :
                descriptionExtension += str(feedrate).replace('.0','')+'F'+str(flowrate).replace('.0','')+'f'
        return descriptionExtension
Exemplo n.º 12
0
def speedDescription():
    descriptionExtension = '_'
    pluginModule = archive.getModuleWithPath(
        os.path.join(skeinforge_craft.getPluginsDirectoryPath(), 'speed'))
    prefs = settings.getReadRepository(
        pluginModule.getNewRepository()).preferences
    for pref in prefs:
        if (pref.name == 'Activate Speed:' and pref.value == False):
            return ''
        if (pref.name == 'Feed Rate (mm/s):'):
            feedrate = pref.value
        if (pref.name == 'Flow Rate Setting (float):'):
            flowrate = pref.value
    if (feedrate == flowrate):
        descriptionExtension += str(feedrate).replace('.0', '') + 'Ff'
    else:
        descriptionExtension += str(feedrate).replace(
            '.0', '') + 'F' + str(flowrate).replace('.0', '') + 'f'
    return descriptionExtension