本文整理汇总了Python中history.History.restore方法的典型用法代码示例。如果您正苦于以下问题:Python History.restore方法的具体用法?Python History.restore怎么用?Python History.restore使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类history.History
的用法示例。
在下文中一共展示了History.restore方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from history import History [as 别名]
# 或者: from history.History import restore [as 别名]
def __init__(self, parentFrame, ID, user, message, colorSet = _DEFAULT_COLORSET,
size = wx.DefaultSize,
pos = wx.DefaultPosition,
style = wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER | wx.MAXIMIZE_BOX | wx.MINIMIZE_BOX):
wx.Frame.__init__(self, None, ID, user.name, size = size,
style = style, name = 'message_dialog_' + user.name)
assert isinstance(user, Buddy)
self._user = user
self._parentFrame = parentFrame
self._history = History.restore(self._user)
print len(colorSet), len(_DEFAULT_COLORSET)
assert len(colorSet) == 4
self._colorSet = colorSet
self.topPanel = MessagePanel(self, 'junk')
PersistenceMixin.__init__(self, self.topPanel, 'widgets.save')
# ---
self.setUserName(self._user)
self.setTitle(self._user)
try:
self.restoreObjects([self.GetId(), ID_BUTTON_SEND, ID_SPLITTER],
name = self._user.name)
except:
typ, value, tb = sys.exc_info()
list = traceback.format_tb(tb, None) + \
traceback.format_exception_only(type, value)
err = "%s %s" % (
"".join(list[:-1]),
list[-1],
)
print 'restoreObjects: '
print err
# Shortcuts
self._incoming = self.topPanel._incoming
self._outgoing = self.topPanel._outgoing
# ---
self.Bind(wx.EVT_BUTTON, self.onSendMessage, id = ID_BUTTON_SEND)
self.Bind(wx.EVT_BUTTON, self.onCancel, id = wx.ID_CANCEL)
self.Bind(wx.EVT_CLOSE, self.onClose)
self.populateHistory()
if message is not None:
self.updateMessage(message)