コード例 #1
0
def survey():
    '''performs a survey'''
    from relational import maintenance

    post = {'software': 'Relational algebra (web)', 'version': "0.0.1"}

    fields = ('System', 'Country', 'School', 'Age', 'How did you find', 'email (only if you want a reply)', 'Comments')
    for i in fields:
        a = raw_input('%s: ' % i)
        post[i] = a
    maintenance.send_survey(post)
コード例 #2
0
ファイル: linegui.py プロジェクト: chippography/relational
def survey():
    '''performs a survey'''

    post = {'software': 'Relational algebra (cli)', 'version': version}

    fields = ('System', 'Country', 'School', 'Age', 'How did you find',
              'email (only if you want a reply)', 'Comments')
    for i in fields:
        a = input('%s: ' % i)
        post[i] = a
    maintenance.send_survey(post)
コード例 #3
0
ファイル: surveyForm.py プロジェクト: andy737/relational
    def send(self):
        '''Sends the data inserted in the form'''

        post = {}
        post['software'] = "Relational algebra"
        post["version"] = version
        post["system"] = self.ui.txtSystem.text()
        post["country"] = self.ui.txtCountry.text()
        post["school"] = self.ui.txtSchool.text()
        post["age"] = self.ui.txtAge.text()
        post["find"] = self.ui.txtFind.text()
        post["email"] = self.ui.txtEmail.text()
        post["comments"] = self.ui.txtComments.toPlainText()

        # Clears the form
        self.ui.txtSystem.clear()
        self.ui.txtCountry.clear()
        self.ui.txtSchool.clear()
        self.ui.txtAge.clear()
        self.ui.txtFind.clear()
        self.ui.txtEmail.clear()
        self.ui.txtComments.clear()

        response = maintenance.send_survey(post)

        if response != 200:
            QtWidgets.QMessageBox.information(None, QtWidgets.QApplication.translate(
                "Form", "Error"), QtWidgets.QApplication.translate("Form", "Unable to send the data!"))
        else:
            QtWidgets.QMessageBox.information(None, QtWidgets.QApplication.translate(
                "Form", "Thanks"), QtWidgets.QApplication.translate("Form", "Thanks for sending!"))

        self.hide()
コード例 #4
0
ファイル: surveyForm.py プロジェクト: ltworf/relational
    def send(self):
        '''Sends the data inserted in the form'''

        post = {}
        post['software'] = "Relational algebra"
        post["version"] = version
        post["system"] = self.ui.txtSystem.text()
        post["country"] = self.ui.txtCountry.text()
        post["school"] = self.ui.txtSchool.text()
        post["age"] = self.ui.txtAge.text()
        post["find"] = self.ui.txtFind.text()
        post["email"] = self.ui.txtEmail.text()
        post["comments"] = self.ui.txtComments.toPlainText()

        # Clears the form
        self.ui.txtSystem.clear()
        self.ui.txtCountry.clear()
        self.ui.txtSchool.clear()
        self.ui.txtAge.clear()
        self.ui.txtFind.clear()
        self.ui.txtEmail.clear()
        self.ui.txtComments.clear()

        response = maintenance.send_survey(post)

        if response == 200:
            QtWidgets.QMessageBox.information(None, _('Thanks'), _('Thanks for sending!'))
        elif response == -1:
            QtWidgets.QMessageBox.information(None, _('Seriously?'), _('Yeah, not sending that.'))
        else:
            QtWidgets.QMessageBox.information(None, _('Error'), _('Unable to send the data!'))

        self.hide()
コード例 #5
0
def survey() -> None:
    '''performs a survey'''
    post = {'software': 'Relational algebra (cli)', 'version': version}

    fields = ('System', 'Country', 'School', 'Age', 'How did you find',
              'email (only if you want a reply)', 'Comments')
    for i in fields:
        a = input('%s: ' % i)
        post[i] = a
    response = maintenance.send_survey(post)
    if response == -1:
        print('Yeah, not sending that.')
コード例 #6
0
ファイル: linegui.py プロジェクト: ltworf/relational
def survey() -> None:
    '''performs a survey'''
    post = {'software': 'Relational algebra (cli)', 'version': version}

    fields = ('System', 'Country', 'School', 'Age', 'How did you find',
              'email (only if you want a reply)', 'Comments')
    for i in fields:
        a = input('%s: ' % i)
        post[i] = a
    response = maintenance.send_survey(post)
    if response == -1:
        print('Yeah, not sending that.')
コード例 #7
0
    def send(self):
        '''Sends the data inserted in the form'''

        post = {}
        post['software'] = "Relational algebra"
        post["version"] = version
        post["system"] = compatibility.get_py_str(self.ui.txtSystem.text())
        post["country"] = compatibility.get_py_str(self.ui.txtCountry.text())
        post["school"] = compatibility.get_py_str(self.ui.txtSchool.text())
        post["age"] = compatibility.get_py_str(self.ui.txtAge.text())
        post["find"] = compatibility.get_py_str(self.ui.txtFind.text())
        post["email"] = compatibility.get_py_str(self.ui.txtEmail.text())
        post["comments"] = compatibility.get_py_str(
            self.ui.txtComments.toPlainText())

        #Clears the form
        self.ui.txtSystem.clear()
        self.ui.txtCountry.clear()
        self.ui.txtSchool.clear()
        self.ui.txtAge.clear()
        self.ui.txtFind.clear()
        self.ui.txtEmail.clear()
        self.ui.txtComments.clear()

        response = maintenance.send_survey(post)

        if response.status != 200:
            QtGui.QMessageBox.information(
                None, QtGui.QApplication.translate("Form", "Error"),
                QtGui.QApplication.translate("Form",
                                             "Unable to send the data!"))
        else:
            QtGui.QMessageBox.information(
                None, QtGui.QApplication.translate("Form", "Thanks"),
                QtGui.QApplication.translate("Form", "Thanks for sending!"))

        self.hide()