本文整理汇总了Python中mojo.extensions.setExtensionDefault函数的典型用法代码示例。如果您正苦于以下问题:Python setExtensionDefault函数的具体用法?Python setExtensionDefault怎么用?Python setExtensionDefault使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setExtensionDefault函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: previewCallback
def previewCallback(self, sender):
value = sender.get()
self.w.fill.enable(value)
self.w.stroke.enable(value)
self.w.color.enable(value)
setExtensionDefault("%s.%s" % (outlinePaletteDefaultKey, "preview"), value)
self.updateView()
开发者ID:RevolverTypeFoundry,项目名称:RoboFontExtensions,代码行数:7,代码来源:outline.py
示例2: windowCloseCallback
def windowCloseCallback(self, sender):
removeObserver(self, "draw")
removeObserver(self, "drawInactive")
removeObserver(self, "currentGlyphChanged")
setExtensionDefault("%s.%s" % (extensionID, "tension"), self.w.HobbySlider.get())
super(metapolator, self).windowCloseCallback(sender)
UpdateCurrentGlyphView()
开发者ID:davelab6,项目名称:hobbyspline,代码行数:7,代码来源:hobbyspline.py
示例3: resetCallback
def resetCallback(self, sender):
if self.w.tabs.get() == 0:
self.settings.set(None)
else:
setExtensionDefault("%s.htmlPreview" % settingsIdentifier, htmlPreviewDefault)
self.html.set(htmlPreviewDefault)
setExtensionDefault("%s.globalCSSPreview" % settingsIdentifier, "")
self.globalCss.set("")
开发者ID:typemytype,项目名称:batchRoboFontExtension,代码行数:8,代码来源:__init__.py
示例4: saveCallback
def saveCallback(self, sender):
data = {
"threaded": self.w.threaded.get(),
"exportInFolders": self.w.exportInFolders.get(),
"keepFileNames": self.w.keepFileNames.get()
}
setExtensionDefault(self.identifier, data)
self.closeCallback(sender)
开发者ID:typemytype,项目名称:batchRoboFontExtension,代码行数:8,代码来源:toolBox.py
示例5: saveComponentList
def saveComponentList(self):
# Save the component list as an extension user default, just without the component objects.
cleanedComponentList = []
for component in self.components:
cleanedComponentList.append(
{"type": component["type"],
"name": component["name"],
"pins": component["pins"],
"object": None,
"problem": True})
setExtensionDefault("lastComponentList", cleanedComponentList)
开发者ID:sannorozco,项目名称:ControlBoard,代码行数:11,代码来源:ControlBoard.py
示例6: closeCallback
def closeCallback(self, sender):
overWrite = self.w.overWrite.get()
markColor = None
if self.w.markGlyphs.get():
markColor = self.w.markGlyphColor.get()
setExtensionDefault(self.overWriteKey, overWrite)
setExtensionDefault(self.useMarkColorKey, bool(markColor))
if markColor is not None:
setExtensionDefaultColor(self.markColorKey, markColor)
self.w.close()
开发者ID:br-niko,项目名称:GlyphConstruction,代码行数:12,代码来源:glyphConstructionUI.py
示例7: gridInputCallback
def gridInputCallback(self, sender):
value = sender.get()
## must be int
try:
value = int(value)
except:
value = self.tool.size
sender.set(value)
return
self.tool.size = value
setExtensionDefault(GRID_DEFAULTS_KEY, value)
开发者ID:christophknoth,项目名称:RoboFontExtensions,代码行数:12,代码来源:PixelTool.py
示例8: get_folder_callback
def get_folder_callback(self, sender):
folder = getFolder(
messageText='choose a folder for the output files',
title=self.title,
allowsMultipleSelection=False)
if folder is not None:
folder = folder[0]
if len(folder) > 0:
self.folder = folder
if os.path.exists(self.folder):
setExtensionDefault('%s.folder' % self.extension_key, self.folder)
self.w.folder_status.set('%s' % unichr(10003))
开发者ID:gferreira,项目名称:compare-otfs,代码行数:12,代码来源:compare-otfs.py
示例9: get_otf_2_callback
def get_otf_2_callback(self, sender):
otf_2 = getFile(
messageText='choose a first .otf font',
title=self.title,
allowsMultipleSelection=False)
if otf_2 is not None:
otf_2 = otf_2[0]
if len(otf_2) > 0:
self.otf_2 = otf_2
if os.path.exists(self.otf_2):
setExtensionDefault('%s.otf_2' % self.extension_key, self.otf_2)
self.w.otf_2_status.set('%s' % unichr(10003))
开发者ID:gferreira,项目名称:compare-otfs,代码行数:12,代码来源:compare-otfs.py
示例10: replaceSuffixes
def replaceSuffixes(self, sender):
""" Handle replacing/appending of suffixes. """
mode = "replace" if self.w.replace.get() == 1 else "append"
oldSuffix = self.w.oldSuffix.getItems()[self.w.oldSuffix.get()]
enteredSuffix = self.w.newSuffix.get()
suffixes_in = [oldSuffix, enteredSuffix]
suffixes = [] # build proper suffixes list
for s in suffixes_in:
if s is not None and len(s) > 0:
if s[0] == ".":
s = s[1:] # handle suffixes without periods
suffixes.append(s)
if mode == "replace" and suffixes[0] == suffixes[1]:
Message(u"Cannot replace a suffix with itself.\nI mean I could, but there seems to be little point :)")
elif mode == "append" and suffixes[1] == "":
Message(u"Cannot append an empty suffix.\n(Or you could just pretend I've already done it.)")
else:
scope = self.f.keys() if self.w.scope.get() == 1 else self.f.selection
if mode == "replace":
for gname in scope:
if gname.endswith(suffixes[0]):
sufLen = len(suffixes[0])
if len(suffixes[1]) > 0:
newName = gname[:-sufLen] + suffixes[1]
else:
sufLenWithPeriod = sufLen+1
newName = gname[:-sufLenWithPeriod]
self._changeGlyphname(gname, newName)
elif mode == "append":
for gname in scope:
newName = gname + "." + suffixes[1]
self._changeGlyphname(gname, newName)
self.f.autoUnicodes()
self.f.update()
# store new values as defaults
savedPresets = getExtensionDefault("nl.typologic.suffixer.presetSuffixes")
if enteredSuffix != "" and enteredSuffix not in savedPresets:
savedPresetsList = savedPresets.split()
savedPresetsList.append(enteredSuffix)
savedPresetsList.sort()
newPresets = " ".join(savedPresetsList)
setExtensionDefault("nl.typologic.suffixer.presetSuffixes", newPresets)
self.w.close()
开发者ID:ninastoessinger,项目名称:Suffixer,代码行数:51,代码来源:suffixer.py
示例11: save
def save(self):
setExtensionDefault(onOffKey, self.onOff)
setExtensionDefault(lineWidthKey, self.lineWidth)
setExtensionDefaultColor(lineColorKey, self.lineColor)
setExtensionDefaultColor(fillColorKey, self.fillColor)
setExtensionDefault(lineRGBA, self.lineRGBA)
setExtensionDefault(fillRGBA, self.fillRGBA)
开发者ID:thomgb,项目名称:ContoursLock,代码行数:7,代码来源:contourLockData.py
示例12: windowCloseCallback
def windowCloseCallback(self, sender):
removeObserver(self, "draw")
removeObserver(self, "drawInactive")
#removeObserver(self, "currentGlyphChanged")
setExtensionDefault("%s.%s" % (extensionID, "method"), self.w.eqMethodSelector.get())
setExtensionDefault("%s.%s" % (extensionID, "curvature"), self.w.eqCurvatureSelector.get())
setExtensionDefault("%s.%s" % (extensionID, "curvatureFree"), self.w.eqCurvatureSlider.get())
setExtensionDefault("%s.%s" % (extensionID, "tension"), self.w.eqHobbyTensionSlider.get())
super(CurveEqualizer, self).windowCloseCallback(sender)
UpdateCurrentGlyphView()
开发者ID:metapolator,项目名称:RoboFont,代码行数:10,代码来源:EqualizeCurves.py
示例13: toggle_panels
def toggle_panels():
'''Show/hide all floating windows in the current workspace.'''
# get panels
windows = NSApp.windows()
panels = [ window for window in windows if isinstance(window, NSPanel) ]
# get state
show_panels = getExtensionDefault('com.hipertipo.showHidePanels', fallback=True)
# hide panels
if show_panels:
for panel in panels:
panel.orderOut_(None)
setExtensionDefault('com.hipertipo.showHidePanels', False)
# show panels
if show_panels is False:
for panel in panels:
if str(type(panel)) != '<objective-c class NSColorPanel at 0x7fff750fad60>':
panel.orderBack_(None)
setExtensionDefault('com.hipertipo.showHidePanels', True)
开发者ID:gferreira,项目名称:hTools2,代码行数:18,代码来源:sysutils.py
示例14: okCallback
def okCallback(self, sender):
userName = self.w.userName.get()
password = self.w.password.get()
twit = TwitPicAPI(userName, password)
i = self.w.view.get()
viewName = self._viewNames[i]
image = self.getImageForView(viewName)
if image is None:
self.showMessage("Oeps!", "Open a glyph window or space center window")
return
message = self.w.message.get()
status = twit.upload(image, "%s #robofont" %message, post_to_twitter=True)
if status == 1001:
self.showMessage("Oeps!", "Invalid user or password")
elif status in [1002, 1003, 1004]:
self.showMessage("Oeps!", "An error occured 'somewhere', try again")
else:
self.showMessage("Send to Twitter", "%s" %status)
setExtensionDefault("%s.%s" %(defaultKey, "userName"), userName)
setExtensionDefault("%s.%s" %(defaultKey, "password"), password)
开发者ID:Hofstede,项目名称:RoboFontExtensions,代码行数:23,代码来源:send2twitter.py
示例15: saveDefaults
def saveDefaults(self, sender):
for setting in self.webSettings:
key = setting.replace(" ", "_").lower()
value = getattr(self, key).get()
setExtensionDefault("%s.%s" % (settingsIdentifier, key), value)
if "Woff" in setting:
value = getattr(self, "%s_format" % key).get()
setExtensionDefault("%s.format_%s" % (settingsIdentifier, key), value)
for key in ["webSuffix", "preserveTTFhints", "generateHTML"]:
value = getattr(self, key).get()
setExtensionDefault("%s.%s" % (settingsIdentifier, key), value)
开发者ID:typemytype,项目名称:batchRoboFontExtension,代码行数:12,代码来源:__init__.py
示例16: drawingModeCallback
def drawingModeCallback(self, sender):
i = self.view.drawingMode.get()
value = self.drawingChoices[i]
self.tool.drawingMode = value
setExtensionDefault(DRAWING_DEFAULTS_KEY, value)
componentName = ""
if value == COMPONENT_MODE:
self.view.componentName.show(True)
componentName = str(self.view.componentName.get())
else:
self.view.componentName.show(False)
self.view.componentName.set("")
self.tool.componentName = componentName
setExtensionDefault(COMPONENT_DEFAULT_KEY, componentName)
useGrid = self.view.useGrid.get()
self.tool.useGrid = useGrid
setExtensionDefault(USEGRID_DEFAULT_KEY, useGrid)
开发者ID:christophknoth,项目名称:RoboFontExtensions,代码行数:20,代码来源:PixelTool.py
示例17: parametersChanged
def parametersChanged(self, sender=None, glyph=None):
tickness = int(self.w.tickness.get())
setExtensionDefault("%s.%s" % (outlinePaletteDefaultKey, "thickness"), tickness)
contrast = int(self.w.contrast.get())
setExtensionDefault("%s.%s" % (outlinePaletteDefaultKey, "contrast"), contrast)
contrastAngle = int(self.w.contrastAngle.get())
setExtensionDefault("%s.%s" % (outlinePaletteDefaultKey, "contrastAngle"), contrastAngle)
keepBounds = self.w.keepBounds.get()
setExtensionDefault("%s.%s" % (outlinePaletteDefaultKey, "keepBounds"), keepBounds)
preserveComponents = bool(self.w.preserveComponents.get())
setExtensionDefault("%s.%s" % (outlinePaletteDefaultKey, "preserveComponents"), preserveComponents)
miterLimit = int(self.w.miterLimit.get())
if self.w.connectmiterLimit.get():
miterLimit = tickness
self.w.miterLimit.set(miterLimit)
setExtensionDefault("%s.%s" % (outlinePaletteDefaultKey, "miterLimit"), miterLimit)
corner = self.w.corner.getItems()[self.w.corner.get()]
setExtensionDefault("%s.%s" % (outlinePaletteDefaultKey, "corner"), corner )
cap = self.w.cap.getItems()[self.w.cap.get()]
setExtensionDefault("%s.%s" % (outlinePaletteDefaultKey, "cap"), cap )
drawOriginal = self.w.addOriginal.get()
setExtensionDefault("%s.%s" % (outlinePaletteDefaultKey, "addOriginal"), drawOriginal)
drawInner = self.w.addInner.get()
setExtensionDefault("%s.%s" % (outlinePaletteDefaultKey, "addLeft"), drawInner)
drawOuter = self.w.addOuter.get()
setExtensionDefault("%s.%s" % (outlinePaletteDefaultKey, "addRight"), drawOuter)
self.w.ticknessText.set("%i" % tickness)
self.w.contrastText.set("%i" % contrast)
self.w.contrastAngleText.set("%i" % contrastAngle)
self.w.miterLimitText.set("%i" % miterLimit)
self.updateView()
开发者ID:RevolverTypeFoundry,项目名称:RoboFontExtensions,代码行数:38,代码来源:outline.py
示例18: useCapCallback
def useCapCallback(self, sender):
value = sender.get()
setExtensionDefault("%s.%s" % (outlinePaletteDefaultKey, "closeOpenPath"), value)
self.w.cap.enable(value)
self.parametersChanged(sender)
开发者ID:RevolverTypeFoundry,项目名称:RoboFontExtensions,代码行数:5,代码来源:outline.py
示例19: connectmiterLimit
def connectmiterLimit(self, sender):
setExtensionDefault("%s.%s" % (outlinePaletteDefaultKey, "connectmiterLimit"), sender.get())
value = not sender.get()
self.w.miterLimit.enable(value)
self.w.miterLimitText.enable(value)
self.parametersChanged(sender)
开发者ID:RevolverTypeFoundry,项目名称:RoboFontExtensions,代码行数:6,代码来源:outline.py
示例20: save
def save(self):
setExtensionDefaultColor(_fillColorDefaultKey, self.fillColor)
setExtensionDefaultColor(_strokeColorDefaultKey, self.strokeColor)
setExtensionDefault(_showPreviewDefaultKey, self.showPreview)
setExtensionDefault(_dataDefaultKey, self.data)
开发者ID:RevolverTypeFoundry,项目名称:RoboFontExtensions,代码行数:5,代码来源:ramsayStData.py
注:本文中的mojo.extensions.setExtensionDefault函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论