Ejemplo n.º 1
0
    def init_backend(self):
        try:
            address = backend.get_address()
            if address is None:
                raise Exception

        except Exception:
            wx.MessageBox('No cjdns interface detected!', 'Error',
                          wx.OK | wx.ICON_ERROR)
            sys.exit(1)

        self.ipshow.ChangeValue(address)

        backend.start()

        node = backend.get_node()
        self.setalias.SetValue(node['alias'])
        self.statusmsg.SetValue(node['status-message'])
        self.statusmenu.SetValue('Available')

        try:
            (self.friends_by_name,
                self.friends_by_obj) = zip(*backend.get_friends())
            self.friendlist.Set(self.friends_by_name)
        except ValueError:
            self.friends_by_name = []
            self.friends_by_obj = []
Ejemplo n.º 2
0
    def start(self) -> None:
        """ Starts the transport systems. Must be called after initiate / listen.

        :return: This function does not return.
        """
        backend.start(self.__context)
        backend.clean_up(self.__context)
Ejemplo n.º 3
0
 def run_optimize(self):
     self.label_result.config(text="Calculando...")
     self.root.update()
     start(self.entry_input.get(),
           path.join(self.entry_output.get(), "resultado.txt"),
           self.entry_images.get() + "/")
     self.label_result['text'] = "Listo!"
Ejemplo n.º 4
0
    def init_backend(self):
        try:
            address = backend.get_address()
            if address is None:
                raise Exception

        except Exception:
            wx.MessageBox('No cjdns interface detected!', 'Error',
                          wx.OK | wx.ICON_ERROR)
            sys.exit(1)

        self.ipshow.ChangeValue(address)

        backend.start()

        node = backend.get_node()
        self.setalias.SetValue(node['alias'])
        self.statusmsg.SetValue(node['status-message'])
        self.statusmenu.SetValue('Available')

        try:
            (self.friends_by_name,
             self.friends_by_obj) = zip(*backend.get_friends())
            self.friendlist.Set(self.friends_by_name)
        except ValueError:
            self.friends_by_name = []
            self.friends_by_obj = []
Ejemplo n.º 5
0
def test_interface(selenium):
    backend.start(block=False, webpath="web")
    eel.sleep(10)
    selenium.get("http://localhost:8000/additions_diary.html")
    eel.sleep(10)
    print(selenium.find_element_by_tag_name("body").get_attribute('innerHTML'))
    wait_for(wait_for_value1, selenium, delay=10)
    selenium.execute_script(
        "document.getElementsByName('value_1')[0].value='6'")
    selenium.execute_script(
        "document.getElementsByName('value_2')[0].value='10'")
    selenium.find_element_by_id("compute").click()
    # time.sleep(4)
    assert "16" in selenium.find_element_by_id("result").get_attribute(
        'innerHTML')
Ejemplo n.º 6
0
def btn_start():
    print("start")
    backend.start(entry0.get().upper(), entry8.get(), entry9.get(),
                  entry1.get(), entry2.get(), entry3.get(), entry4.get(),
                  entry5.get(), entry6.get(), entry7.get())
Ejemplo n.º 7
0
def financialFormSubmit():
    backend.start(json.dumps(request.form), 3)
    return render_template('response.html')
Ejemplo n.º 8
0
def transportationFormSubmit():
    backend.start(json.dumps(request.form), 2)
    return render_template('response.html')
Ejemplo n.º 9
0
def medicationsFormSubmit():
    backend.start(json.dumps(request.form), 1)
    return render_template('response.html')
Ejemplo n.º 10
0
import redis
import pymongo
import urlparse

import backend

backend.app.config['MONGO_DB'] = 'backend_test'
backend.app.config['REDIS_DB'] = 15
backend.app.config['TESTING'] = True
backend.start()

test_client = backend.app.test_client()

mongo_client = pymongo.MongoClient( backend.app.config['MONGO_URL'] )

redis_client = backend.sessions