chiark / gitweb /
Add uppercase STL and HEX to file dialog filters for linux/MacOS
[cura.git] / Cura / skeinforge_application / skeinforge_utilities / skeinforge_profile.py
1 """
2 Profile is a script to set the craft types setting for the skeinforge chain.
3
4 Profile presents the user with a choice of the craft types in the profile_plugins folder.  The chosen craft type is used to determine the craft type profile for the skeinforge chain.  The default craft type is extrusion.
5
6 """
7
8 from __future__ import absolute_import
9 #Init has to be imported first because it has code to workaround the python bug where relative imports don't work if the module is imported as a main module.
10 import __init__
11
12 from fabmetheus_utilities import archive
13
14 def getCraftTypeName():
15         return 'extrusion'
16
17 def getProfileName(craftTypeName):
18         return 'Cura profile:' + craftTypeName
19
20 def addListsToCraftTypeRepository(fileNameHelp, repository):
21     #print('addListsToCraftTypeRepository:', fileNameHelp, repository)
22     repository.name = fileNameHelp.split('.')[-2]
23     repository.preferences = []
24
25 def getCraftTypePluginModule( craftTypeName = ''):
26     "Get the craft type plugin module"
27     if craftTypeName == '':
28         craftTypeName = getCraftTypeName()
29     profilePluginsDirectoryPath = getPluginsDirectoryPath()
30     return archive.getModuleWithDirectoryPath( profilePluginsDirectoryPath, craftTypeName )
31
32 def getPluginsDirectoryPath():
33     "Get the plugins directory path."
34     return archive.getSkeinforgePluginsPath('profile_plugins')
35