コード例 #1
0
class WordPusherGui(QMainWindow):
    def __init__(self, serverAddr, port=ECHO_TREE_NEW_ROOT_PORT):
        super(WordPusherGui, self).__init__()

        self.serverAddr = serverAddr
        self.port = port

        self.pusher = RootWordPusher(self.serverAddr, port=self.port)

        self.ui = QtBindingHelper.loadUi(GUI_PATH, self)
        self.dialogService = DialogService(parent=self)
        self.connectWidgets()
        self.show()

    def connectWidgets(self):
        # self.wordField.textChanged.connect(self.wordFieldAction);
        self.submitButton.clicked.connect(self.submitAction)
        # self.treeDisplayField

    def submitAction(self):
        word = self.wordField.toPlainText()
        if len(word) == 0:
            self.dialogService.showErrorMsg("Enter a single word in the 'Word' textbox before clicking New Tree")
            return
        result = self.pusher.pushEchoTreeToServer(word)
        if result is not None:
            # Error:
            self.dialogService.showErrorMsg(` result `)
コード例 #2
0
class WordPusherGui(QMainWindow):
    def __init__(self, serverAddr, port=ECHO_TREE_NEW_ROOT_PORT):
        super(WordPusherGui, self).__init__()

        self.serverAddr = serverAddr
        self.port = port

        self.pusher = RootWordPusher(self.serverAddr, port=self.port)

        self.ui = QtBindingHelper.loadUi(GUI_PATH, self)
        self.dialogService = DialogService(parent=self)
        self.connectWidgets()
        self.show()

    def connectWidgets(self):
        #self.wordField.textChanged.connect(self.wordFieldAction);
        self.submitButton.clicked.connect(self.submitAction)
        #self.treeDisplayField

    def submitAction(self):
        word = self.wordField.toPlainText()
        if len(word) == 0:
            self.dialogService.showErrorMsg(
                "Enter a single word in the 'Word' textbox before clicking New Tree"
            )
            return
        result = self.pusher.pushEchoTreeToServer(word)
        if result is not None:
            # Error:
            self.dialogService.showErrorMsg( ` result `)
コード例 #3
0
ファイル: tester_cli.py プロジェクト: imclab/echo_tree
    def __init__(self, serverAddr, rootWord, thePort=None):

        if thePort is None:
            pusher = RootWordPusher(serverAddr)
        else:
            pusher = RootWordPusher(serverAddr, port=thePort)
        result = pusher.pushEchoTreeToServer(rootWord)
        if result is not None:
            # Error:
            #print `result;`
            #print traceback.print_exc();
            raise result
        else:
            print "Seems to have worked. Check whether your browsers updated their EchoTree."
コード例 #4
0
ファイル: tester_cli.py プロジェクト: imclab/echo_tree
 def __init__(self, serverAddr, rootWord, thePort=None):
 
     if thePort is None:
         pusher = RootWordPusher(serverAddr);
     else:
         pusher = RootWordPusher(serverAddr, port=thePort);
     result = pusher.pushEchoTreeToServer(rootWord);
     if result is not None:
         # Error:
         #print `result;`
         #print traceback.print_exc();
         raise result;
     else:
         print "Seems to have worked. Check whether your browsers updated their EchoTree.";