本文整理汇总了Python中Client.Client.setAvatar方法的典型用法代码示例。如果您正苦于以下问题:Python Client.setAvatar方法的具体用法?Python Client.setAvatar怎么用?Python Client.setAvatar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Client.Client
的用法示例。
在下文中一共展示了Client.setAvatar方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from Client import Client [as 别名]
# 或者: from Client.Client import setAvatar [as 别名]
class Login:
PORTNO = 10102
#BACKGROUND = "#c0a9cf"
BACKGROUND = "#c098af"
def __init__(self):
self.window = Tk()
self.window["bg"] = self.BACKGROUND
self.window.title(APP_NAME)
self.window.minsize(700, 550)
tksupport.install(self.window)
self.window.protocol("WM_DELETE_WINDOW", self.application_quit)
self.createMenu()
selectionGet = self.window.selection_get
self.client = Client(self, selectionGet)
self.client.pack()
self.factory = pb.PBClientFactory()
self.window.wait_visibility()
self.logindialog = LoginDialog(self.window, self.loginSuccess, self.application_quit, REMOTE_SERVER, self.PORTNO, self.factory, self.client.cc)
reactor.callWhenRunning(self.logindialog.run)
reactor.run()
def loginSuccess(self, avatar):
self.client.setAvatar(avatar)
#self.client.swb.focus_set()
self.window.bind("<FocusIn>", lambda e: self.client.swb.focus_set())
df = avatar.callRemote("getWbServer")
df.addCallback(self.gotRootObject)
df2 = avatar.callRemote("whoami")
df2.addCallback(self.updateMenu)
df3 = avatar.callRemote("myName")
df3.addCallback(self.client.setName)
df3.addCallback(lambda a: self.setWindowStatus())
def setWindowStatus(self, desc=OUT):
self.window.title(APP_NAME + " - " + self.client.name + " (" + statusMsg[desc] +")")
def showRoomAdmin(self, event=None):
self.client.showRooms()
def showPostAdmin(self, event=None):
self.client.showPost()
def showQuestionAdmin(self, event=None):
self.client.showQuestions()
def showSubjectAdmin(self, event=None):
self.client.showSubjects()
def gotRootObject(self, root):
self.client.setRoot(root)
def createMenu(self):
menubar = Menu(self.window)
self.fileMenu = Menu(menubar, tearoff=0)
self.fileMenu.add_command(label=_("Lista de aulas"), command=self.showRoomAdmin)
self.fileMenu.add_command(label=_("Lista de materias"), command=self.showSubjectAdmin)
self.fileMenu.add_separator()
self.fileMenu.add_command(label=_("Imprimir"))
self.fileMenu.add_separator()
self.fileMenu.add_command(label=_("Salir"), command=self.application_quit)
menubar.add_cascade(label=_("Archivo"), menu=self.fileMenu)
self.editMenu = Menu(menubar, tearoff=0)
menubar.add_cascade(label=_("Edicion"), menu=self.editMenu)
self.emoticMenu = Menu(menubar, tearoff=0)
menubar.add_cascade(label=_("Emoticonos"), menu=self.emoticMenu)
self.symbolMenu = Menu(menubar, tearoff=0)
menubar.add_cascade(label=_("Simbolos"), menu=self.symbolMenu)
self.mathMenu = Menu(self.symbolMenu, tearoff=0)
self.symbolMenu.add_cascade(label=_("Matematica"), menu=self.mathMenu)
self.greekMenu = Menu(self.symbolMenu, tearoff=0)
self.symbolMenu.add_cascade(label=_("Griego"), menu=self.greekMenu)
self.helpMenu = Menu(menubar, tearoff=0)
self.helpMenu.add_command(label=_("Manual de instrucciones"), command=self.showHelp)
self.helpMenu.add_command(label=_("Acerca de..."), command=self.showAbout)
menubar.add_cascade(label=_("Ayuda"), menu=self.helpMenu)
self.linksMenu = Menu(menubar, tearoff=0)
self.linksMenu.add_command(label=_("Links utiles"), command=self.showLinks)
menubar.add_cascade(label=_("Links"), menu=self.linksMenu)
self.window.config(menu=menubar)
def showHelp(self):
webbrowser.open(APP_URL + '/content/help.html', new=0)
def showLinks(self):
webbrowser.open(APP_URL + '/content/links.html', new=0)
#.........这里部分代码省略.........