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 = []
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)
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!"
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')
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())
def financialFormSubmit(): backend.start(json.dumps(request.form), 3) return render_template('response.html')
def transportationFormSubmit(): backend.start(json.dumps(request.form), 2) return render_template('response.html')
def medicationsFormSubmit(): backend.start(json.dumps(request.form), 1) return render_template('response.html')
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