本文整理汇总了Python中ui.message函数的典型用法代码示例。如果您正苦于以下问题:Python message函数的具体用法?Python message怎么用?Python message使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了message函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: script_readMessage
def script_readMessage(self,gesture):
num=int(gesture.mainKeyName[-1])
if len(self.lastMessages)>num-1:
ui.message(self.lastMessages[num-1])
else:
# Translators: This is presented to inform the user that no instant message has been received.
ui.message(_("No message yet"))
开发者ID:Alain-Ambazac,项目名称:nvda,代码行数:7,代码来源:miranda32.py
示例2: _callback
def _callback(self):
try:
val = features.get(self.feature_key)
features.set_perm(self.feature_key, not val)
except ValueError as e:
ui.message(str(e), type='error')
self.make_button()
开发者ID:bbqchickenrobot,项目名称:freeciv-android,代码行数:7,代码来源:options.py
示例3: script_saveSynth
def script_saveSynth(self, gesture):
if self.slot not in self.synths:
self.synths[self.slot] = {}
self.synths[self.slot]['name'] = speech.getSynth().name
self.synths[self.slot]['config'] = dict(config.conf['speech'][speech.getSynth().name].iteritems())
self.write()
ui.message(_("saved"))
开发者ID:tspivey,项目名称:switchSynth,代码行数:7,代码来源:switchSynth.py
示例4: script_moveToParent
def script_moveToParent(self, gesture):
# Make sure we're in a editable control
focus = api.getFocusObject()
if focus.role != controlTypes.ROLE_EDITABLETEXT:
ui.message("Not in an edit control.")
return
# Get the current indentation level
textInfo = focus.makeTextInfo(textInfos.POSITION_CARET)
textInfo.expand(textInfos.UNIT_LINE)
indentationLevel = len(textInfo.text) - len(textInfo.text.strip())
onEmptyLine = len(textInfo.text) == 1 #1 because an empty line will have the \n character
# Scan each line until we hit the start of the indentation block, the start of the edit area, or find a line with less indentation level
found = False
while textInfo.move(textInfos.UNIT_LINE, -2) == -2:
textInfo.expand(textInfos.UNIT_LINE)
newIndentation = len(textInfo.text) - len(textInfo.text.strip())
# Skip over empty lines if we didn't start on one.
if not onEmptyLine and len(textInfo.text) == 1:
continue
if newIndentation < indentationLevel:
# Found it
found = True
textInfo.updateCaret()
speech.speakTextInfo(textInfo, unit=textInfos.UNIT_LINE)
break
# If we didn't find it, tell the user
if not found:
ui.message("No parent of indentation block")
开发者ID:cafeventos,项目名称:nvda-indentation-navigation,代码行数:33,代码来源:indentation_navigation.py
示例5: fetchAppModule
def fetchAppModule(processID,appName):
"""Returns an appModule found in the appModules directory, for the given application name.
@param processID: process ID for it to be associated with
@type processID: integer
@param appName: the application name for which an appModule should be found.
@type appName: unicode or str
@returns: the appModule, or None if not found
@rtype: AppModule
"""
# First, check whether the module exists.
# We need to do this separately because even though an ImportError is raised when a module can't be found, it might also be raised for other reasons.
# Python 2.x can't properly handle unicode module names, so convert them.
modName = appName.encode("mbcs")
if doesAppModuleExist(modName):
try:
return __import__("appModules.%s" % modName, globals(), locals(), ("appModules",)).AppModule(processID, appName)
except:
log.error("error in appModule %r"%modName, exc_info=True)
# We can't present a message which isn't unicode, so use appName, not modName.
# Translators: This is presented when errors are found in an appModule (example output: error in appModule explorer).
ui.message(_("Error in appModule %s")%appName)
# Use the base AppModule.
return AppModule(processID, appName)
开发者ID:Alain-Ambazac,项目名称:nvda,代码行数:25,代码来源:appModuleHandler.py
示例6: reportClock
def reportClock(self):
if self.quietHoursAreActive():
return
if config.conf["clockAndCalendar"]["timeReporting"]!=1:
nvwave.playWaveFile(os.path.join(paths.SOUNDS_DIR, config.conf["clockAndCalendar"]["timeReportSound"]))
if config.conf["clockAndCalendar"]["timeReporting"]!=2:
ui.message(datetime.now().strftime(config.conf["clockAndCalendar"]["timeDisplayFormat"]))
开发者ID:Oliver2213,项目名称:clock,代码行数:7,代码来源:clockHandler.py
示例7: reportMessage
def reportMessage(self, text):
# Messages are ridiculously verbose.
# Strip the time and other metadata if possible.
m = self.RE_MESSAGE.match(text)
if m:
text = "%s, %s" % (m.group("from"), m.group("body"))
ui.message(text)
开发者ID:ehollig,项目名称:nvda,代码行数:7,代码来源:skype.py
示例8: take_turn
def take_turn(self):
monster = self.owner
actiontime = 0
oldx = monster.x
oldy = monster.y
#Can it see the player?
if v.detect_player(monster):
#Send a message about it if it couldn't already see you
if not self.can_see_player:
if v.player_can_see(monster.x, monster.y):
ui.message("The " + monster.name + " sees you!", libtcod.red)
self.seesPlayerFunc(monster)
self.can_see_player = True
#monster.fighter.look_towards = (g.player.x, g.player.y)
else:
self.can_see_player = False
#Do the onstep whatever it is
#if self.eachStepFunc:
# self.eachStepFunc(monster)
#If we're next to the player, attack it
if self.attacksPlayer and self.can_see_player and (monster.distance_to(g.player) < 2):
actiontime = monster.fighter.attack(g.player)
#actiontime = monster.move_towards(self.dest[0], self.dest[1])
actiontime = 10
return actiontime
开发者ID:Toxoplasma,项目名称:stealth-rogue,代码行数:34,代码来源:monsters.py
示例9: script_saveBookmark
def script_saveBookmark(self, gesture):
obj = api.getFocusObject()
appName=appModuleHandler.getAppNameFromProcessID(obj.processID,True)
if appName == "MicrosoftEdgeCP.exe":
gesture.send()
return
treeInterceptor=obj.treeInterceptor
if isinstance(treeInterceptor, BrowseModeDocumentTreeInterceptor) and not treeInterceptor.passThrough:
obj=treeInterceptor
else:
gesture.send()
return
bookmark = obj.makeTextInfo(textInfos.POSITION_CARET).bookmark
bookmarks = getSavedBookmarks()
noteTitle = obj.makeTextInfo(textInfos.POSITION_SELECTION).text[:100].encode("utf-8")
if bookmark.startOffset in bookmarks:
noteBody = bookmarks[bookmark.startOffset].body
else:
noteBody = ""
bookmarks[bookmark.startOffset] = Note(noteTitle, noteBody)
fileName = getFileBookmarks()
try:
pickle.dump(bookmarks, file(fileName, "wb"))
ui.message(
# Translators: message presented when a position is saved as a bookmark.
_("Saved position at character %d") % bookmark.startOffset)
except Exception as e:
log.debugWarning("Error saving bookmark", exc_info=True)
ui.message(
# Translators: message presented when a bookmark cannot be saved.
_("Cannot save bookmark"))
raise e
开发者ID:nvdaes,项目名称:placeMarkers,代码行数:32,代码来源:__init__.py
示例10: script_reportFormatting
def script_reportFormatting(self,gesture):
formatConfig={
"detectFormatAfterCursor":False,
"reportFontName":True,"reportFontSize":True,"reportFontAttributes":True,"reportColor":True,
"reportStyle":True,"reportAlignment":True,"reportSpellingErrors":True,
"reportPage":False,"reportLineNumber":False,"reportTables":False,
"reportLinks":False,"reportHeadings":False,"reportLists":False,
"reportBlockQuotes":False,
}
o=api.getFocusObject()
v=o.treeInterceptor
if v and not v.passThrough:
o=v
try:
info=o.makeTextInfo(textInfos.POSITION_CARET)
except (NotImplementedError, RuntimeError):
info=o.makeTextInfo(textInfos.POSITION_FIRST)
info.expand(textInfos.UNIT_CHARACTER)
formatField=textInfos.FormatField()
for field in info.getTextWithFields(formatConfig):
if isinstance(field,textInfos.FieldCommand) and isinstance(field.field,textInfos.FormatField):
formatField.update(field.field)
text=speech.getFormatFieldSpeech(formatField,formatConfig=formatConfig) if formatField else None
if not text:
ui.message(_("No formatting information"))
return
ui.message(text)
开发者ID:atsuoishimoto,项目名称:tweetitloud,代码行数:27,代码来源:globalCommands.py
示例11: script_toggleRightMouseButton
def script_toggleRightMouseButton(self,gesture):
if winUser.getKeyState(winUser.VK_RBUTTON)&32768:
ui.message(_("right mouse button unlock"))
winUser.mouse_event(winUser.MOUSEEVENTF_RIGHTUP,0,0,None,None)
else:
ui.message(_("right mouse button lock"))
winUser.mouse_event(winUser.MOUSEEVENTF_RIGHTDOWN,0,0,None,None)
开发者ID:atsuoishimoto,项目名称:tweetitloud,代码行数:7,代码来源:globalCommands.py
示例12: script_previousSynthSetting
def script_previousSynthSetting(self,gesture):
previousSettingName=globalVars.settingsRing.previous()
if not previousSettingName:
ui.message(_("No settings"))
return
previousSettingValue=globalVars.settingsRing.currentSettingValue
ui.message("%s %s"%(previousSettingName,previousSettingValue))
开发者ID:atsuoishimoto,项目名称:tweetitloud,代码行数:7,代码来源:globalCommands.py
示例13: script_nextSynthSetting
def script_nextSynthSetting(self,gesture):
nextSettingName=globalVars.settingsRing.next()
if not nextSettingName:
ui.message(_("No settings"))
return
nextSettingValue=globalVars.settingsRing.currentSettingValue
ui.message("%s %s"%(nextSettingName,nextSettingValue))
开发者ID:atsuoishimoto,项目名称:tweetitloud,代码行数:7,代码来源:globalCommands.py
示例14: script_decreaseSynthSetting
def script_decreaseSynthSetting(self,gesture):
settingName=globalVars.settingsRing.currentSettingName
if not settingName:
ui.message(_("No settings"))
return
settingValue=globalVars.settingsRing.decrease()
ui.message("%s %s" % (settingName,settingValue))
开发者ID:atsuoishimoto,项目名称:tweetitloud,代码行数:7,代码来源:globalCommands.py
示例15: event_UIA_elementSelected
def event_UIA_elementSelected(self, obj, nextHandler):
# #7273: When this is fired on categories, the first emoji from the new category is selected but not announced.
# Therefore, move the navigator object to that item if possible.
# However, in recent builds, name change event is also fired.
# For consistent experience, report the new category first by traversing through controls.
# #8189: do not announce candidates list itself (not items), as this is repeated each time candidate items are selected.
if obj.UIAElement.cachedAutomationID == "CandidateList": return
speech.cancelSpeech()
# Sometimes clipboard candidates list gets selected, so ask NvDA to descend one more level.
if obj.UIAElement.cachedAutomationID == "TEMPLATE_PART_ClipboardItemsList":
obj = obj.firstChild
candidate = obj
# Sometimes, due to bad tree traversal, something other than the selected item sees this event.
parent = obj.parent
if obj.UIAElement.cachedClassName == "ListViewItem" and isinstance(parent, UIA) and parent.UIAElement.cachedAutomationID != "TEMPLATE_PART_ClipboardItemsList":
# The difference between emoji panel and suggestions list is absence of categories/emoji separation.
# Turns out automation ID for the container is different, observed in build 17666 when opening clipboard copy history.
candidate = obj.parent.previous
if candidate is not None:
# Emoji categories list.
ui.message(candidate.name)
obj = candidate.firstChild
if obj is not None:
api.setNavigatorObject(obj)
obj.reportFocus()
braille.handler.message(braille.getBrailleTextForProperties(name=obj.name, role=obj.role, positionInfo=obj.positionInfo))
# Cache selected item.
self._recentlySelected = obj.name
else:
# Translators: presented when there is no emoji when searching for one in Windows 10 Fall Creators Update and later.
ui.message(_("No emoji"))
nextHandler()
开发者ID:MarcoZehe,项目名称:nvda,代码行数:32,代码来源:windowsinternal_composableshell_experiences_textinput_inputapp.py
示例16: _tableMovementScriptHelper
def _tableMovementScriptHelper(self, movement="next", axis=None):
if isScriptWaiting():
return
formatConfig=config.conf["documentFormatting"].copy()
formatConfig["reportTables"]=True
formatConfig["includeLayoutTables"]=True
try:
tableID, origRow, origCol, origRowSpan, origColSpan = self._getTableCellCoords(self.selection)
except LookupError:
# Translators: The message reported when a user attempts to use a table movement command
# when the cursor is not within a table.
ui.message(_("Not in a table cell"))
return
try:
info = self._getNearestTableCell(tableID, self.selection, origRow, origCol, origRowSpan, origColSpan, movement, axis)
except LookupError:
# Translators: The message reported when a user attempts to use a table movement command
# but the cursor can't be moved in that direction because it is at the edge of the table.
ui.message(_("Edge of table"))
# Retrieve the cell on which we started.
info = next(self._iterTableCells(tableID, row=origRow, column=origCol))
speech.speakTextInfo(info,formatConfig=formatConfig,reason=controlTypes.REASON_CARET)
info.collapse()
self.selection = info
开发者ID:Alain-Ambazac,项目名称:nvda,代码行数:26,代码来源:__init__.py
示例17: script_goToError
def script_goToError(self, gesture):
(file, line) = error_finder.get_file_and_line(self.get_navigator_line())
if file is None:
ui.message(_("Unable to find target file and line"))
return
arguments = "/g %s \"%s\"" % (line, file)
win32api.ShellExecute(0, 'open', "notepad.exe", arguments, '', 1)
开发者ID:ctoth,项目名称:jumpToError,代码行数:7,代码来源:addon.py
示例18: event_liveRegionChange
def event_liveRegionChange(self):
# The base liveRegionChange event is not enough as Skype for Business concatinates recent chat messages from the same person within the same minute
# Therefore, specifically strip out the chat content and only report the most recent part added.
# The object's name contains the full message (I.e. person: content, timestamp) loosely separated by commas.
# Example string: "Michael Curran : , , Hello\r\n\r\nThis is a test , 10:45 am."
# Where person is "Michael Curran", content is "Hello\nThis is a test" and timestamp is "10:45 am"
# The object's value just contains the content.
# Example: "Hello\rThis is a test"
# We are only interested in person and content
# Therefore use value (content) to locate and split off the person from the name (fullText)
# Normalize the usage of end-of-line characters (name and value seem to expose them differently, which would break comparison)
content=self.value.replace('\r','\n').strip()
fullText=self.name.replace('\r\n\r\n','\n')
contentLines=content.split('\n')
contentStartIndex=fullText.find(content)
pretext=fullText[:contentStartIndex]
# There are some annoying comma characters after the person's name
pretext=pretext.replace(' ,','')
# If the objects are the same, the person is the same, and the new content is the old content but with more appended, report the appended content
# Otherwise, report the person and the initial content
runtimeID=self.UIAElement.getRuntimeId()
lastRuntimeID,lastPretext,lastContentLines=self.appModule._lastLiveChatMessageData
contentLinesLen=len(contentLines)
lastContentLinesLen=len(lastContentLines)
if runtimeID==lastRuntimeID and pretext==lastPretext and contentLinesLen>lastContentLinesLen and contentLines[:lastContentLinesLen]==lastContentLines:
message="\n".join(contentLines[lastContentLinesLen:])
else:
message=pretext+content
ui.message(message)
# Cache the message data for later possible comparisons
self.appModule._lastLiveChatMessageData=runtimeID,pretext,contentLines
开发者ID:BabbageCom,项目名称:nvda,代码行数:31,代码来源:lync.py
示例19: handleInputCandidateListUpdate
def handleInputCandidateListUpdate(candidatesString,selectionIndex,inputMethod):
candidateStrings=candidatesString.split('\n')
import speech
from NVDAObjects.inputComposition import InputComposition, CandidateList, CandidateItem
focus=api.getFocusObject()
if not (0<=selectionIndex<len(candidateStrings)):
if isinstance(focus,CandidateItem):
oldSpeechMode=speech.speechMode
speech.speechMode=speech.speechMode_off
eventHandler.executeEvent("gainFocus",focus.parent)
speech.speechMode=oldSpeechMode
return
oldCandidateItemsText=None
if isinstance(focus,CandidateItem):
oldCandidateItemsText=focus.visibleCandidateItemsText
parent=focus.parent
wasCandidate=True
else:
parent=focus
wasCandidate=False
item=CandidateItem(parent=parent,candidateStrings=candidateStrings,candidateIndex=selectionIndex,inputMethod=inputMethod)
if wasCandidate and focus.windowHandle==item.windowHandle and focus.candidateIndex==item.candidateIndex and focus.name==item.name:
return
if config.conf["inputComposition"]["autoReportAllCandidates"] and item.visibleCandidateItemsText!=oldCandidateItemsText:
import ui
ui.message(item.visibleCandidateItemsText)
eventHandler.executeEvent("gainFocus",item)
开发者ID:bramd,项目名称:nvda,代码行数:27,代码来源:NVDAHelper.py
示例20: _callback
def _callback(self):
val = uidialog.inputbox('Value for %s' % self.feature_key)
try:
features.set_perm(self.feature_key, val)
except ValueError as e:
ui.message(str(e), type='error')
self.make_button()
开发者ID:renatolouro,项目名称:freeciv-android,代码行数:7,代码来源:options.py
注:本文中的ui.message函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论