Example #1
0
def writeHypertext():
    "Run pydoc, then read, write and delete each of the files."
    shellCommand = 'pydoc -w ./'
    commandResult = os.system(shellCommand)
    if commandResult != 0:
        print(
            'Failed to execute the following command in writeHypertext in docwrap.'
        )
        print(shellCommand)
    hypertextFiles = gcodec.getFilesWithFileTypeWithoutWords('html')
    if len(hypertextFiles) <= 0:
        print('Failed to find any help files in writeHypertext in docwrap.')
        return
    documentDirectoryPath = gcodec.getAbsoluteFolderPath(
        hypertextFiles[0], 'documentation')
    removeFilesInDirectory(documentDirectoryPath)
    sortedReplaceFiles = []
    for hypertextFile in hypertextFiles:
        sortedReplaceFiles.append(hypertextFile.replace('.html', '. html'))
    sortedReplaceFiles.sort()
    hypertextFiles = []
    for sortedReplaceFile in sortedReplaceFiles:
        hypertextFiles.append(sortedReplaceFile.replace('. html', '.html'))
    transferredFileNames = []
    for hypertextFileIndex in xrange(len(hypertextFiles)):
        readWriteDeleteHypertextHelp(documentDirectoryPath, hypertextFileIndex,
                                     hypertextFiles, transferredFileNames)
    for transferredFileNameIndex in xrange(len(transferredFileNames)):
        readWriteNavigationHelp(documentDirectoryPath,
                                transferredFileNameIndex, transferredFileNames)
    writeContentsFile(documentDirectoryPath, transferredFileNames)
    print('%s files were wrapped.' % len(transferredFileNames))
Example #2
0
def processXMLElement( xmlElement, xmlProcessor ):
	"Process the xml element."
	fileName = evaluate.getEvaluatedValue('file', xmlElement )
	if fileName == None:
		return
	parserFileName = xmlElement.getRoot().parser.fileName
	absoluteFileName = gcodec.getAbsoluteFolderPath( parserFileName, fileName )
	xmlText = ''
	if fileName.endswith('.xml'):
		xmlText = gcodec.getFileText( absoluteFileName )
	else:
		xmlText = getXMLFromCarvingFileName( absoluteFileName )
	if xmlText == '':
		print('The file %s could not be found in the folder which the fabmetheus xml file is in.' % fileName )
		return
	if '_importname' in xmlElement.attributeDictionary:
		xmlElement.importName = xmlElement.attributeDictionary['_importname']
	else:
		xmlElement.importName = gcodec.getUntilDot( fileName )
		xmlElement.attributeDictionary['_importname'] = xmlElement.importName
	XMLSimpleReader( parserFileName, xmlElement, xmlText )
	originalChildren = xmlElement.children[ : ]
	xmlElement.children = []
	for child in originalChildren:
		for subchild in child.children:
			subchild.setParentAddToChildren(xmlElement)
		for attributeDictionaryKey in child.attributeDictionary.keys():
			if attributeDictionaryKey != 'version':
				xmlElement.attributeDictionary[ attributeDictionaryKey ] = child.attributeDictionary[ attributeDictionaryKey ]
	group.processShape( group.Group, xmlElement, xmlProcessor )
	root = xmlElement.getRoot()
	root.idDictionary[ xmlElement.importName ] = evaluate.ElementID(xmlElement)
	root.nameDictionary[ xmlElement.importName ] = evaluate.ElementName(xmlElement)
Example #3
0
	def __init__(self):
		"Set the default settings, execute title & settings fileName."
		skeinforge_profile.addListsToCraftTypeRepository('skeinforge_application.skeinforge_plugins.craft_plugins.export.html', self )
		self.fileNameInput = settings.FileNameInput().getFromFileName( fabmetheus_interpret.getGNUTranslatorGcodeFileTypeTuples(), 'Open File for Export', self, '')
		self.openWikiManualHelpPage = settings.HelpPage().getOpenFromAbsolute('http://www.bitsfrombytes.com/wiki/index.php?title=Skeinforge_Export')
		self.activateExport = settings.BooleanSetting().getFromValue('Activate Export', self, True )
		self.alsoSendOutputTo = settings.StringSetting().getFromValue('Also Send Output To:', self, '')
		self.deleteComments = settings.BooleanSetting().getFromValue('Delete Comments', self, True )
		exportPluginsFolderPath = gcodec.getAbsoluteFolderPath( __file__, 'export_plugins')
		exportStaticDirectoryPath = os.path.join( exportPluginsFolderPath, 'static_plugins')
		exportPluginFileNames = gcodec.getPluginFileNamesFromDirectoryPath( exportPluginsFolderPath )
		exportStaticPluginFileNames = gcodec.getPluginFileNamesFromDirectoryPath( exportStaticDirectoryPath )
		self.exportLabel = settings.LabelDisplay().getFromName('Export Operations: ', self )
		self.exportPlugins = []
		exportLatentStringVar = settings.LatentStringVar()
		self.doNotChangeOutput = settings.RadioCapitalized().getFromRadio( exportLatentStringVar, 'Do Not Change Output', self, True )
		self.doNotChangeOutput.directoryPath = None
		allExportPluginFileNames = exportPluginFileNames + exportStaticPluginFileNames
		for exportPluginFileName in allExportPluginFileNames:
			exportPlugin = None
			if exportPluginFileName in exportPluginFileNames:
				path = os.path.join( exportPluginsFolderPath, exportPluginFileName )
				exportPlugin = settings.RadioCapitalizedButton().getFromPath( exportLatentStringVar, exportPluginFileName, path, self, False )
				exportPlugin.directoryPath = exportPluginsFolderPath
			else:
				exportPlugin = settings.RadioCapitalized().getFromRadio( exportLatentStringVar, exportPluginFileName, self, False )
				exportPlugin.directoryPath = exportStaticDirectoryPath
			self.exportPlugins.append( exportPlugin )
		self.fileExtension = settings.StringSetting().getFromValue('File Extension:', self, 'gcode')
		self.savePenultimateGcode = settings.BooleanSetting().getFromValue('Save Penultimate Gcode', self, False )
		self.executeTitle = 'Export'
Example #4
0
def processXMLElement(xmlElement):
    "Process the xml element."
    fileName = evaluate.getEvaluatedValue("file", xmlElement)
    if fileName == None:
        return
    parserFileName = xmlElement.getRoot().parser.fileName
    absoluteFileName = gcodec.getAbsoluteFolderPath(parserFileName, fileName)
    xmlText = ""
    if fileName.endswith(".xml"):
        xmlText = gcodec.getFileText(absoluteFileName)
    else:
        xmlText = getXMLFromCarvingFileName(absoluteFileName)
    if xmlText == "":
        print("The file %s could not be found in the folder which the fabmetheus xml file is in." % fileName)
        return
    if "_importname" in xmlElement.attributeDictionary:
        xmlElement.importName = xmlElement.attributeDictionary["_importname"]
    else:
        xmlElement.importName = gcodec.getUntilDot(fileName)
        xmlElement.attributeDictionary["_importname"] = xmlElement.importName
    XMLSimpleReader(parserFileName, xmlElement, xmlText)
    originalChildren = xmlElement.children[:]
    xmlElement.children = []
    for child in originalChildren:
        for subchild in child.children:
            subchild.setParentAddToChildren(xmlElement)
        for attributeDictionaryKey in child.attributeDictionary.keys():
            if attributeDictionaryKey != "version":
                xmlElement.attributeDictionary[attributeDictionaryKey] = child.attributeDictionary[
                    attributeDictionaryKey
                ]
    group.processShape(group.Group, xmlElement)
Example #5
0
def writeHypertext():
	"Run pydoc, then read, write and delete each of the files."
	shellCommand = 'pydoc -w ./'
	commandResult = os.system( shellCommand )
	if commandResult != 0:
		print('Failed to execute the following command in writeHypertext in docwrap.')
		print( shellCommand )
	hypertextFiles = gcodec.getFilesWithFileTypeWithoutWords('html')
	if len( hypertextFiles ) <= 0:
		print('Failed to find any help files in writeHypertext in docwrap.')
		return
	documentDirectoryPath = gcodec.getAbsoluteFolderPath( hypertextFiles[0], 'documentation')
	removeFilesInDirectory( documentDirectoryPath )
	sortedReplaceFiles = []
	for hypertextFile in hypertextFiles:
		sortedReplaceFiles.append( hypertextFile.replace('.html', '. html') )
	sortedReplaceFiles.sort()
	hypertextFiles = []
	for sortedReplaceFile in sortedReplaceFiles:
		hypertextFiles.append( sortedReplaceFile.replace('. html', '.html') )
	transferredFileNames = []
	for hypertextFileIndex in xrange( len( hypertextFiles ) ):
		readWriteDeleteHypertextHelp( documentDirectoryPath, hypertextFileIndex, hypertextFiles, transferredFileNames )
	for transferredFileNameIndex in xrange( len( transferredFileNames ) ):
		readWriteNavigationHelp( documentDirectoryPath, transferredFileNameIndex, transferredFileNames )
	writeContentsFile( documentDirectoryPath, transferredFileNames )
	print('%s files were wrapped.' % len( transferredFileNames ) )
Example #6
0
def processXMLElement(xmlElement):
    "Process the xml element."
    fileName = evaluate.getEvaluatedValue('file', xmlElement)
    if fileName == None:
        return
    parserFileName = xmlElement.getRoot().parser.fileName
    absoluteFileName = gcodec.getAbsoluteFolderPath(parserFileName, fileName)
    xmlText = ''
    if fileName.endswith('.xml'):
        xmlText = gcodec.getFileText(absoluteFileName)
    else:
        xmlText = getXMLFromCarvingFileName(absoluteFileName)
    if xmlText == '':
        print(
            'The file %s could not be found in the folder which the fabmetheus xml file is in.'
            % fileName)
        return
    if '_importname' in xmlElement.attributeDictionary:
        xmlElement.importName = xmlElement.attributeDictionary['_importname']
    else:
        xmlElement.importName = gcodec.getUntilDot(fileName)
        xmlElement.attributeDictionary['_importname'] = xmlElement.importName
    XMLSimpleReader(parserFileName, xmlElement, xmlText)
    originalChildren = xmlElement.children[:]
    xmlElement.children = []
    for child in originalChildren:
        for subchild in child.children:
            subchild.setParentAddToChildren(xmlElement)
        for attributeDictionaryKey in child.attributeDictionary.keys():
            if attributeDictionaryKey != 'version':
                xmlElement.attributeDictionary[
                    attributeDictionaryKey] = child.attributeDictionary[
                        attributeDictionaryKey]
    group.processShape(group.Group, xmlElement)
Example #7
0
 def __init__(self):
     "Set the default settings, execute title & settings fileName."
     skeinforge_profile.addListsToCraftTypeRepository(
         'skeinforge_application.skeinforge_plugins.craft_plugins.export.html',
         self)
     self.fileNameInput = settings.FileNameInput().getFromFileName(
         fabmetheus_interpret.getGNUTranslatorGcodeFileTypeTuples(),
         'Open File for Export', self, '')
     self.openWikiManualHelpPage = settings.HelpPage().getOpenFromAbsolute(
         'http://www.bitsfrombytes.com/wiki/index.php?title=Skeinforge_Export'
     )
     self.activateExport = settings.BooleanSetting().getFromValue(
         'Activate Export', self, True)
     self.alsoSendOutputTo = settings.StringSetting().getFromValue(
         'Also Send Output To:', self, '')
     self.deleteComments = settings.BooleanSetting().getFromValue(
         'Delete Comments', self, True)
     exportPluginsFolderPath = gcodec.getAbsoluteFolderPath(
         __file__, 'export_plugins')
     exportStaticDirectoryPath = os.path.join(exportPluginsFolderPath,
                                              'static_plugins')
     exportPluginFileNames = gcodec.getPluginFileNamesFromDirectoryPath(
         exportPluginsFolderPath)
     exportStaticPluginFileNames = gcodec.getPluginFileNamesFromDirectoryPath(
         exportStaticDirectoryPath)
     self.exportLabel = settings.LabelDisplay().getFromName(
         'Export Operations: ', self)
     self.exportPlugins = []
     exportLatentStringVar = settings.LatentStringVar()
     self.doNotChangeOutput = settings.RadioCapitalized().getFromRadio(
         exportLatentStringVar, 'Do Not Change Output', self, True)
     self.doNotChangeOutput.directoryPath = None
     allExportPluginFileNames = exportPluginFileNames + exportStaticPluginFileNames
     for exportPluginFileName in allExportPluginFileNames:
         exportPlugin = None
         if exportPluginFileName in exportPluginFileNames:
             path = os.path.join(exportPluginsFolderPath,
                                 exportPluginFileName)
             exportPlugin = settings.RadioCapitalizedButton().getFromPath(
                 exportLatentStringVar, exportPluginFileName, path, self,
                 False)
             exportPlugin.directoryPath = exportPluginsFolderPath
         else:
             exportPlugin = settings.RadioCapitalized().getFromRadio(
                 exportLatentStringVar, exportPluginFileName, self, False)
             exportPlugin.directoryPath = exportStaticDirectoryPath
         self.exportPlugins.append(exportPlugin)
     self.fileExtension = settings.StringSetting().getFromValue(
         'File Extension:', self, 'gcode')
     self.savePenultimateGcode = settings.BooleanSetting().getFromValue(
         'Save Penultimate Gcode', self, False)
     self.executeTitle = 'Export'
Example #8
0
 def display(self):
     "Display the export canvas repository dialog."
     for repositoryDialog in settings.globalRepositoryDialogListTable:
         if repositoryDialog.repository.lowerName == self.name:
             repositoryDialog.setCanvasFileNameSuffix(self.canvas, self.skein.fileName, self.suffix)
             settings.liftRepositoryDialogs(settings.globalRepositoryDialogListTable[repositoryDialog])
             return
     exportCanvasPluginsFolderPath = gcodec.getAbsoluteFolderPath(os.path.dirname(__file__), "export_canvas_plugins")
     pluginModule = gcodec.getModuleWithDirectoryPath(exportCanvasPluginsFolderPath, self.name)
     if pluginModule == None:
         return None
     pluginRepository = pluginModule.getNewRepository()
     pluginRepository.setCanvasFileNameSuffix(self.canvas, self.fileName, self.suffix)
     settings.getDisplayedDialogFromConstructor(pluginRepository)
Example #9
0
	def addCanvasMenuRootScrollSkein( self, repository, skein, suffix, title ):
		"Add the canvas, menu bar, scroll bar, skein panes, tableau repository, root and skein."
		self.imagesDirectoryPath = archive.getFabmetheusUtilitiesPath('images')
		self.movementTextID = None
		self.mouseInstantButtons = []
		self.photoImages = {}
		self.repository = repository
		self.root = settings.Tkinter.Tk()
		self.gridPosition = settings.GridVertical( 0, 1 )
		self.gridPosition.master = self.root
		self.root.title( os.path.basename( skein.fileName ) + ' - ' + title )
		self.rulingExtent = 24
		self.rulingTargetSeparation = 150.0
		self.screenSize = skein.screenSize
		self.skein = skein
		self.skeinPanes = skein.skeinPanes
		self.suffix = suffix
		self.timerID = None
		repository.animationSlideShowRate.value = max( repository.animationSlideShowRate.value, 0.01 )
		repository.animationSlideShowRate.value = min( repository.animationSlideShowRate.value, 85.0 )
		repository.drawArrows.setUpdateFunction( self.setWindowToDisplaySaveUpdate )
		repository.goAroundExtruderOffTravel.setUpdateFunction( self.setWindowToDisplaySavePhoenixUpdate )
		repository.layerExtraSpan.setUpdateFunction( self.setWindowToDisplaySaveUpdate )
		repository.widthOfSelectionThread.setUpdateFunction( self.setWindowToDisplaySaveUpdate )
		repository.widthOfTravelThread.setUpdateFunction( self.setWindowToDisplaySaveUpdate )
		repository.window = self
		for menuRadio in repository.mouseMode.menuRadios:
			fileName = menuRadio.name.lower()
			fileName = fileName.replace(' ', '_') + '.ppm'
			menuRadio.mouseButton = self.getPhotoButtonGridIncrement( menuRadio.invoke, fileName, self.gridPosition )
		self.gridPosition = settings.GridHorizontal( 1, 99 )
		self.gridPosition.master = self.root
		self.xScrollbar = HiddenScrollbar( self.root, orient = settings.Tkinter.HORIZONTAL )
		self.xScrollbar.grid( row = 98, column = 2, columnspan = 96, sticky = settings.Tkinter.E + settings.Tkinter.W )
		self.yScrollbar = HiddenScrollbar( self.root )
		self.yScrollbar.grid( row = 1, rowspan = 97, column = 99, sticky = settings.Tkinter.N + settings.Tkinter.S )
		self.canvasHeight = min( int( skein.screenSize.imag ), self.root.winfo_screenheight() - repository.screenVerticalInset.value )
		self.canvasWidth = min( int( skein.screenSize.real ), self.root.winfo_screenwidth() - repository.screenHorizontalInset.value )
		scrollRegionBoundingBox = ( 0, 0, int( skein.screenSize.real ), int( skein.screenSize.imag ) )
		self.canvas = settings.Tkinter.Canvas( self.root, highlightthickness = 3, width = self.canvasWidth, height = self.canvasHeight, scrollregion = scrollRegionBoundingBox )
		self.canvas.grid( row = 1, rowspan = 97, column = 2, columnspan = 96, sticky = settings.Tkinter.E + settings.Tkinter.W + settings.Tkinter.N + settings.Tkinter.S )
		self.fileHelpMenuBar = settings.FileHelpMenuBar( self.root )
		self.exportMenu = settings.Tkinter.Menu( self.fileHelpMenuBar.fileMenu, tearoff = 0 )
		self.fileHelpMenuBar.fileMenu.add_cascade( label = "Export", menu = self.exportMenu, underline = 0 )
		exportCanvasPluginsFolderPath = gcodec.getAbsoluteFolderPath( os.path.dirname( __file__ ), 'export_canvas_plugins')
		exportCanvasPluginFileNames = gcodec.getPluginFileNamesFromDirectoryPath( exportCanvasPluginsFolderPath )
		for exportCanvasPluginFileName in exportCanvasPluginFileNames:
			ExportCanvasDialog().addPluginToMenu( self.canvas, skein.fileName, self.exportMenu, exportCanvasPluginFileName, suffix )
		self.fileHelpMenuBar.fileMenu.add_separator()
		self.fileHelpMenuBar.completeMenu( self.close, repository, self.save, self )
Example #10
0
 def display(self):
     "Display the export canvas repository dialog."
     for repositoryDialog in settings.globalRepositoryDialogListTable:
         if repositoryDialog.repository.lowerName == self.name:
             repositoryDialog.setCanvasFileNameSuffix(
                 self.canvas, self.skein.fileName, self.suffix)
             settings.liftRepositoryDialogs(
                 settings.globalRepositoryDialogListTable[repositoryDialog])
             return
     exportCanvasPluginsFolderPath = gcodec.getAbsoluteFolderPath(
         os.path.dirname(__file__), 'export_canvas_plugins')
     pluginModule = gcodec.getModuleWithDirectoryPath(
         exportCanvasPluginsFolderPath, self.name)
     if pluginModule == None:
         return None
     pluginRepository = pluginModule.getNewRepository()
     pluginRepository.setCanvasFileNameSuffix(self.canvas, self.fileName,
                                              self.suffix)
     settings.getDisplayedDialogFromConstructor(pluginRepository)
Example #11
0
def processXMLElement( xmlElement, xmlProcessor ):
	"Process the xml element."
	fileName = evaluate.getEvaluatedValue( 'file', xmlElement )
	if fileName == None:
		return
	parserFileName = xmlElement.getRoot().parser.fileName
	absoluteFileName = gcodec.getAbsoluteFolderPath( parserFileName, fileName )
	xmlText = getXMLFromFileName( absoluteFileName )
	if xmlText == '':
		print( 'The file %s could not be found in the folder which the fabmetheus xml file is in.' % fileName )
		return
	if '_importname' in xmlElement.attributeDictionary:
		xmlElement.importName = xmlElement.attributeDictionary[ '_importname' ]
	else:
		xmlElement.importName = gcodec.getUntilDot( fileName )
		xmlElement.attributeDictionary[ '_importname' ] = xmlElement.importName
	XMLSimpleParser( parserFileName, xmlElement, xmlText )
	group.processShape( group.Group, xmlElement, xmlProcessor )
	root = xmlElement.getRoot()
	root.idDictionary[ xmlElement.importName ] = evaluate.ElementID( xmlElement )
	root.nameDictionary[ xmlElement.importName ] = evaluate.ElementName( xmlElement )
Example #12
0
def processXMLElement(xmlElement, xmlProcessor):
    "Process the xml element."
    fileName = evaluate.getEvaluatedValue('file', xmlElement)
    if fileName == None:
        return
    parserFileName = xmlElement.getRoot().parser.fileName
    absoluteFileName = gcodec.getAbsoluteFolderPath(parserFileName, fileName)
    xmlText = getXMLFromFileName(absoluteFileName)
    if xmlText == '':
        print(
            'The file %s could not be found in the folder which the fabmetheus xml file is in.'
            % fileName)
        return
    if '_importname' in xmlElement.attributeDictionary:
        xmlElement.importName = xmlElement.attributeDictionary['_importname']
    else:
        xmlElement.importName = gcodec.getUntilDot(fileName)
        xmlElement.attributeDictionary['_importname'] = xmlElement.importName
    XMLSimpleParser(parserFileName, xmlElement, xmlText)
    group.processShape(group.Group, xmlElement, xmlProcessor)
    root = xmlElement.getRoot()
    root.idDictionary[xmlElement.importName] = evaluate.ElementID(xmlElement)
    root.nameDictionary[xmlElement.importName] = evaluate.ElementName(
        xmlElement)
Example #13
0
def getPluginsDirectoryPath():
    "Get the plugins directory path."
    return gcodec.getAbsoluteFolderPath(__file__, 'interpret_plugins')
Example #14
0
def getPluginsDirectoryPath():
	"Get the plugins directory path."
	return gcodec.getAbsoluteFolderPath( __file__, 'skeinforge_plugins')
def getPluginsDirectoryPath():
	"Get the plugins directory path."
	return gcodec.getAbsoluteFolderPath( os.path.dirname( __file__ ), os.path.join( 'skeinforge_plugins', 'analyze_plugins' ) )
Example #16
0
def getPluginsDirectoryPath():
    "Get the plugins directory path."
    return gcodec.getAbsoluteFolderPath(
        os.path.dirname(__file__),
        os.path.join('skeinforge_plugins', 'meta_plugins'))
Example #17
0
 def addCanvasMenuRootScrollSkein(self, repository, skein, suffix, title):
     "Add the canvas, menu bar, scroll bar, skein panes, tableau repository, root and skein."
     self.imagesDirectoryPath = settings.getDirectoryInAboveDirectory(
         os.path.join('fabmetheus_utilities', 'images'))
     self.movementTextID = None
     self.mouseInstantButtons = []
     self.photoImages = {}
     self.repository = repository
     self.root = settings.Tkinter.Tk()
     self.gridPosition = settings.GridVertical(0, 1)
     self.gridPosition.master = self.root
     self.root.title(os.path.basename(skein.fileName) + ' - ' + title)
     self.rulingExtent = 24
     self.rulingTargetSeparation = 150.0
     self.screenSize = skein.screenSize
     self.skein = skein
     self.skeinPanes = skein.skeinPanes
     self.suffix = suffix
     self.timerID = None
     repository.animationSlideShowRate.value = max(
         repository.animationSlideShowRate.value, 0.01)
     repository.animationSlideShowRate.value = min(
         repository.animationSlideShowRate.value, 85.0)
     repository.drawArrows.setUpdateFunction(
         self.setWindowToDisplaySaveUpdate)
     repository.goAroundExtruderOffTravel.setUpdateFunction(
         self.setWindowToDisplaySavePhoenixUpdate)
     repository.layerExtraSpan.setUpdateFunction(
         self.setWindowToDisplaySaveUpdate)
     repository.widthOfSelectionThread.setUpdateFunction(
         self.setWindowToDisplaySaveUpdate)
     repository.widthOfTravelThread.setUpdateFunction(
         self.setWindowToDisplaySaveUpdate)
     repository.window = self
     for menuRadio in repository.mouseMode.menuRadios:
         fileName = menuRadio.name.lower()
         fileName = fileName.replace(' ', '_') + '.ppm'
         menuRadio.mouseButton = self.getPhotoButtonGridIncrement(
             menuRadio.invoke, fileName, self.gridPosition)
     self.gridPosition = settings.GridHorizontal(1, 99)
     self.gridPosition.master = self.root
     self.xScrollbar = settings.HiddenScrollbar(
         self.root, orient=settings.Tkinter.HORIZONTAL)
     self.xScrollbar.grid(row=98,
                          column=2,
                          columnspan=96,
                          sticky=settings.Tkinter.E + settings.Tkinter.W)
     self.yScrollbar = settings.HiddenScrollbar(self.root)
     self.yScrollbar.grid(row=1,
                          rowspan=97,
                          column=99,
                          sticky=settings.Tkinter.N + settings.Tkinter.S)
     self.canvasHeight = min(
         int(skein.screenSize.imag),
         self.root.winfo_screenheight() -
         repository.screenVerticalInset.value)
     self.canvasWidth = min(
         int(skein.screenSize.real),
         self.root.winfo_screenwidth() -
         repository.screenHorizontalInset.value)
     scrollRegionBoundingBox = (0, 0, int(skein.screenSize.real),
                                int(skein.screenSize.imag))
     self.canvas = settings.Tkinter.Canvas(
         self.root,
         highlightthickness=3,
         width=self.canvasWidth,
         height=self.canvasHeight,
         scrollregion=scrollRegionBoundingBox)
     self.canvas.grid(row=1,
                      rowspan=97,
                      column=2,
                      columnspan=96,
                      sticky=settings.Tkinter.E + settings.Tkinter.W +
                      settings.Tkinter.N + settings.Tkinter.S)
     self.fileHelpMenuBar = settings.FileHelpMenuBar(self.root)
     self.exportMenu = settings.Tkinter.Menu(self.fileHelpMenuBar.fileMenu,
                                             tearoff=0)
     self.fileHelpMenuBar.fileMenu.add_cascade(label="Export",
                                               menu=self.exportMenu,
                                               underline=0)
     exportCanvasPluginsFolderPath = gcodec.getAbsoluteFolderPath(
         os.path.dirname(__file__), 'export_canvas_plugins')
     exportCanvasPluginFileNames = gcodec.getPluginFileNamesFromDirectoryPath(
         exportCanvasPluginsFolderPath)
     for exportCanvasPluginFileName in exportCanvasPluginFileNames:
         ExportCanvasDialog().addPluginToMenu(self.canvas, skein.fileName,
                                              self.exportMenu,
                                              exportCanvasPluginFileName,
                                              suffix)
     self.fileHelpMenuBar.fileMenu.add_separator()
     self.fileHelpMenuBar.completeMenu(self.close, repository, self.save,
                                       self)
Example #18
0
def getPluginsDirectoryPath():
    "Get the plugins directory path."
    return gcodec.getAbsoluteFolderPath(__file__, 'skeinforge_tools')
Example #19
0
def getPluginsDirectoryPath():
    "Get the plugins directory path."
    return gcodec.getAbsoluteFolderPath(os.path.dirname(__file__), os.path.join("skeinforge_plugins", "meta_plugins"))