'preferredName': 'do something', 'shortKey': (NSCommandKeyMask | NSShiftKeyMask, 'b'), }, { 'path': 'doSomethingElse.py', 'preferredName': 'do something else', 'shortKey': (NSAlternateKeyMask, 'o'), }] # license for the extension with open(licensePath) as license: B.license = license.read() # required extensions with open(requirementsPath) as requirements: B.requirements = requirements.read() # expiration date for trial extensions B.expireDate = '2020-12-31' # compile and save the extension bundle print('building extension...', end=' ') B.save(extensionPath, libPath=libPath, htmlPath=htmlPath, resourcesPath=resourcesPath) print('done!') # check for problems in the compiled extension print() print(B.validationErrors())
import os import shutil from mojo.extensions import ExtensionBundle lib_path = os.path.dirname(__file__) extension_file = 'MeasureHandles.roboFontExt' extension_path = os.path.join(os.path.join(lib_path, 'extension'), extension_file) # extension_html = os.path.join(lib_path, "_docs") extension_lib_path = os.path.join(extension_path, 'lib') print 'building extension...', B = ExtensionBundle() B.name = u"Measure Handles Tool" B.developer = u'Gustavo Ferreira, Johannes Breyer' B.developerURL = 'http://hipertipo.com/' B.version = "0.1" B.mainScript = "MeasureHandlesTool.py" B.launchAtStartUp = 1 B.addToMenu = [] B.requiresVersionMajor = '1' B.requiresVersionMinor = '5' B.infoDictionary["html"] = 0 B.infoDictionary["com.robofontmechanic.Mechanic"] = { "repository" : "johannesbreyer/HandleLength", "description" : "A tool to display length & angle of bezier handles in a glyph", } B.save(extension_path, libPath=lib_path, htmlPath=None, resourcesPath=None, pycOnly=False) print 'done.\n'
import os from mojo.extensions import ExtensionBundle basePath = os.path.dirname(__file__) extensionPath = os.path.join(basePath, "SlightlyBetterTransform.roboFontExt") libPath = os.path.join(basePath, "lib") htmlPath = os.path.join(basePath, "html") resourcesPath = os.path.join(basePath, "resources") B = ExtensionBundle() B.name = "Slightly Better Transform" B.version = "1.2" B.mainScript = "SlightlyBetterTransform.py" B.developer = "Andy Clymer" B.developerURL = 'http://www.andyclymer.com/' B.launchAtStartUp = True B.addToMenu = [] B.requiresVersionMajor = '3' B.requiresVersionMinor = '1' B.infoDictionary["html"] = True B.save(extensionPath, libPath=libPath, htmlPath=htmlPath, resourcesPath=resourcesPath, pycOnly=False) print("Done")
elif os.path.exists(os.path.join(docPath, "index.md")): haveDocumentation = True if not haveDocumentation: docPath = None B.html = haveDocumentation B.requiresVersionMajor = roboFontVersion.split(".")[0] B.requiresVersionMinor = roboFontVersion.split(".")[1] B.addToMenu = menuItems with open(licensePath) as license: B.license = license.read() with open(requirementsPath) as requirements: B.requirements = requirements.read() print("Building extension...", end=" ") v = B.save(extensionPath, libPath=libPath, pycOnly=pycOnly, htmlPath=docPath, resourcesPath=resourcesPath) print("done!") errors = B.validationErrors() if errors: print("Uh oh! There were errors:") print(errors) # Install the extension. if installAfterBuild: print("Installing extension...", end=" ") installDirectory = os.path.expanduser( "~/Library/Application Support/RoboFont/plugins") installPath = os.path.join(installDirectory, extensionFile)
B.version = version B.launchAtStartUp = False B.mainScript = "main.py" B.html = os.path.exists(os.path.join(sourcePath, "documentation", "index.html")) B.requiresVersionMajor = roboFontVersion.split(".")[0] B.requiresVersionMinor = roboFontVersion.split(".")[1] B.addToMenu = menuItems if os.path.exists(licensePath): with open(licensePath) as license: B.license = license.read() if os.path.exists(requirementsPath): with open(requirementsPath) as requirements: B.requirements = requirements.read() print("building extension...", end=" ") v = B.save(extensionPath, libPath=libPath, pycOnly=pycOnly) print("done!") print() print(B.validationErrors()) if installAfterBuild: print("Installing extension...", end=" ") installDirectory = os.path.expanduser( "~/Library/Application Support/RoboFont/plugins") installPath = os.path.join(installDirectory, extensionFile) if os.path.exists(installPath): shutil.rmtree(installPath) shutil.copytree(extensionPath, installPath) print("done!") print("RoboFont must now be restarted.")
B.version = "0.1" B.mainScript = "" B.launchAtStartUp = 0 B.addToMenu = [{ "path": "docs.py", "preferredName": "RoboFab Docs", "shortKey": "", }] B.requiresVersionMajor = "1" B.requiresVersionMinor = "5" B.infoDictionary["html"] = 0 B.infoDictionary["com.robofontmechanic.Mechanic"] = { "repository": "roboDocs/roboFabDocs", "description": "The RoboFab Documentation as a RoboFont extension", } B.save(extensionPath, libPath=libPath, resourcesPath=None, pycOnly=False) # remove git repository from extension extensionLibPath = os.path.join(extensionPath, 'lib') if os.path.exists(extensionLibPath): # remove git repository gitPath = os.path.join(extensionLibPath, '.git') if os.path.exists(gitPath): print '\tremoving git repository from extension...' shutil.rmtree(gitPath) # remove gitignore file gitignorePath = os.path.join(extensionLibPath, '.gitignore') if os.path.exists(gitignorePath): print '\tremoving .gitignore file from extension...' os.remove(gitignorePath)
lib_path = os.path.dirname(__file__) extension_file = 'MeasureHandles.roboFontExt' extension_path = os.path.join(os.path.join(lib_path, 'extension'), extension_file) # extension_html = os.path.join(lib_path, "_docs") extension_lib_path = os.path.join(extension_path, 'lib') print 'building extension...', B = ExtensionBundle() B.name = u"Measure Handles Tool" B.developer = u'Gustavo Ferreira, Johannes Breyer' B.developerURL = 'http://hipertipo.com/' B.version = "0.1" B.mainScript = "MeasureHandlesTool.py" B.launchAtStartUp = 1 B.addToMenu = [] B.requiresVersionMajor = '1' B.requiresVersionMinor = '5' B.infoDictionary["html"] = 0 B.infoDictionary["com.robofontmechanic.Mechanic"] = { "repository": "johannesbreyer/HandleLength", "description": "A tool to display length & angle of bezier handles in a glyph", } B.save(extension_path, libPath=lib_path, htmlPath=None, resourcesPath=None, pycOnly=False) print 'done.\n'
import importlib importlib.reload(hTools2) import os from mojo.extensions import ExtensionBundle hTools2_path = os.path.dirname(os.path.dirname(hTools2.__file__ )) hTools2_html = os.path.join(os.path.dirname(hTools2_path), "Docs/build/html") extension_file = 'hTools2.roboFontExt' extension_path = os.path.join(os.path.dirname(__file__), extension_file) print('building extension...', end=' ') B = ExtensionBundle() B.name = "hTools2" B.developer = 'Gustavo Ferreira' B.developerURL = 'http://hipertipo.com/' B.version = "1.9" B.mainScript = "init-RF-extension.py" B.launchAtStartUp = 1 B.addToMenu = [] B.requiresVersionMajor = '1' B.requiresVersionMinor = '5' B.infoDictionary["repository"] = 'gferreira/hTools2' B.infoDictionary["summary"] = 'A collection of tools to help with common type design & font production tasks.' B.infoDictionary["html"] = 1 B.save(extension_path, libPath=hTools2_path, htmlPath=hTools2_html, resourcesPath=None, pycOnly=False) print('done.')
B.version = "0.1" B.mainScript = "" B.launchAtStartUp = 0 B.addToMenu = [{ "path" : "docs.py", "preferredName" : "RoboFab Docs", "shortKey" : "", }] B.requiresVersionMajor = "1" B.requiresVersionMinor = "5" B.infoDictionary["html"] = 0 B.infoDictionary["com.robofontmechanic.Mechanic"] = { "repository" : "roboDocs/roboFabDocs", "description" : "The RoboFab Documentation as a RoboFont extension", } B.save(extensionPath, libPath=libPath, resourcesPath=None, pycOnly=False) # remove git repository from extension extensionLibPath = os.path.join(extensionPath, 'lib') if os.path.exists(extensionLibPath): # remove git repository gitPath = os.path.join(extensionLibPath, '.git') if os.path.exists(gitPath): print '\tremoving git repository from extension...' shutil.rmtree(gitPath) # remove gitignore file gitignorePath = os.path.join(extensionLibPath, '.gitignore') if os.path.exists(gitignorePath): print '\tremoving .gitignore file from extension...' os.remove(gitignorePath)
import hTools2 reload(hTools2) import os from mojo.extensions import ExtensionBundle hTools2_path = os.path.dirname(os.path.dirname(hTools2.__file__ )) hTools2_html = os.path.join(os.path.dirname(hTools2_path), "Docs/build/html") extension_file = 'hTools2.roboFontExt' extension_path = os.path.join(os.path.dirname(__file__), extension_file) print 'building extension...', B = ExtensionBundle() B.name = "hTools2" B.developer = 'Gustavo Ferreira' B.developerURL = 'http://hipertipo.com/' B.version = "1.9" B.mainScript = "init-RF-extension.py" B.launchAtStartUp = 1 B.addToMenu = [] B.requiresVersionMajor = '1' B.requiresVersionMinor = '5' B.infoDictionary["repository"] = 'gferreira/hTools2' B.infoDictionary["summary"] = 'A collection of tools to help with common type design & font production tasks.' B.infoDictionary["html"] = 1 B.save(extension_path, libPath=hTools2_path, htmlPath=hTools2_html, resourcesPath=None, pycOnly=False) print 'done.'
from __future__ import print_function import os from mojo.extensions import ExtensionBundle basePath = os.path.dirname(__file__) extensionPath = os.path.join(basePath, "ImportExportArt.roboFontExt") libPath = os.path.join(basePath, "lib") htmlPath = os.path.join(basePath, "html") B = ExtensionBundle() B.name = "Import/Export Art" B.version = "1.2" B.developer = "Andy Clymer" B.developerURL = 'http://www.andyclymer.com/' B.mainScript = "ImportExportWindow.py" B.launchAtStartUp = False B.addToMenu = [{ 'path': 'ImportExportWindow.py', 'preferredName': 'Import/Export Art...', 'shortKey': '', }] B.requiresVersionMajor = '3' B.requiresVersionMinor = '1' B.infoDictionary["html"] = True B.save(extensionPath, libPath=libPath, htmlPath=htmlPath, pycOnly=False) print("Done")
B.requiresVersionMinor = '5' B.addToMenu = [ { 'path' : 'glyphConstructionUI.py', 'preferredName': 'Glyph Builder', 'shortKey' : '', }, ] with codecs.open(licensePath, mode="r", encoding="utf-8") as f: B.license = f.read() B.repositoryURL = 'http://github.com/typemytype/GlyphConstruction/' B.summary = 'A simple, human-readable, powerful language for describing how shapes are constructed.' # --------------- # build extension # --------------- print('building extension...', end=" ") B.save(extensionPath, libPath=libPath, htmlPath=htmlPath) print('copy module...', end=" ") destModulePath = os.path.join(B.libPath(), "glyphConstruction.py") if os.path.exists(destModulePath): os.path.remove(destModulePath) shutil.copy(modulePath, destModulePath) print('done!') print() print(B.validationErrors())
'path' : 'glyphConstructionUI.py', 'preferredName': 'Glyph Builder', 'shortKey' : '', }, ] with open(licensePath, mode="r", encoding="utf-8") as f: B.license = f.read() B.repositoryURL = 'http://github.com/typemytype/GlyphConstruction/' B.summary = 'A simple, human-readable, powerful language for describing how shapes are constructed.' # --------------- # build extension # --------------- # copy README file into 'html' folder as 'index.md' shutil.copyfile(readmePath, os.path.join(htmlPath, 'index.md')) print('building extension...') B.save(extensionPath, libPath=libPath, htmlPath=htmlPath) print('copying module...') destModulePath = os.path.join(B.libPath(), "glyphConstruction.py") if os.path.exists(destModulePath): os.path.remove(destModulePath) shutil.copy(modulePath, destModulePath) print('...done!') print() print(B.validationErrors())
import os from mojo.extensions import ExtensionBundle basePath = os.path.dirname(__file__) extensionPath = os.path.join(basePath, "ControlBoard.roboFontExt") libPath = os.path.join(basePath, "lib") htmlPath = os.path.join(basePath, "html") resourcesPath = os.path.join(basePath, "resources") B = ExtensionBundle() B.name = "ControlBoard" B.version = "0.22b" B.mainScript = "ControlBoard.py" B.developer = "Andy Clymer" B.developerURL = 'http://www.andyclymer.com/' B.launchAtStartUp = False B.addToMenu = [{"path" : "ControlBoard.py", "preferredName" : "ControlBoard", "shortKey" : ""}] B.requiresVersionMajor = '1' B.requiresVersionMinor = '5' B.infoDictionary["html"] = True B.save(extensionPath, libPath=libPath, htmlPath=htmlPath, resourcesPath=resourcesPath, pycOnly=False) print "Done"