def api(): # POST请求:传递types和polygon给后端处理 if request.method == 'POST': types = request.form['types'] polygon = request.form['polygon'] if request.form['do'] == 'lbs': icd = IceDrumstick(types=types, polygon=polygon) icd.save_to_db() im = IceMap(types=types, polygon=polygon) im.save_data() icr = IceRecord(types=types, polygon=polygon) icr.save_to_db() return icr.rid else: ph = PolygonHelper(polygon) th = TypeHelper(types) return ph.get_hash() + th.get_hash() # GET请求 # do=view: 返回数据给前端展示 if request.method == 'GET': tid = request.args.get('tid') rid = request.args.get('rid') if request.args.get('do') == 'view': pc = PoiCtrl(tid=tid, rid=rid) return Response(json.dumps(pc.get_location()), mimetype='application/json') # do=excel: 生成excel表 elif request.args.get('do') == 'excel': ec = ExcelCtrl(tid=tid, rid=rid) return ec.save_to_xlsx()
def typeTicketName(): rs() b.find_element_by_css_selector("input#headingInput").send_keys( TypeHelper.getTicketName()) b.find_element_by_css_selector("div#contentInput div.form-control").click() b.find_element_by_css_selector( "div#contentInput div[contenteditable]").send_keys( TypeHelper.getTicketContent())
def _set_record(self): ph = PolygonHelper(self.polygon) self.polygon = ph.to_str() self.center = ph.get_center_str() th = TypeHelper(self.types) self.types = th.to_str() self.tids = th.get_tids_str() self.rid = ph.get_hash() + th.get_hash()
def init(): b.maximize_window() TypeHelper.initWords() global account if os.path.isfile('account'): f = open('account', 'r') account = f.readline() wait(2.0)
def init(): b.maximize_window() TypeHelper.initWords() global account if os.path.isfile('account'): f = open('account','r') account = f.readline() wait(2.0)
def __init__(self, **kwargs): types = kwargs.get('types', '050000') polygon = kwargs.get('polygon', '120.107076,30.326175;120.085948,30.316822;') th = TypeHelper(types) ph = PolygonHelper(polygon) self.types_list = th.to_list() self.polygon = ph.to_str() self.rid = ph.get_hash() + th.get_hash() self.key = 'e444f2d824f09ff1708854c1e66d0e19' self.offset = 20 self.url = 'http://restapi.amap.com/v3/place/polygon' self.lock = threading.Lock()
def init(): TypeHelper.initWords() global account if os.path.isfile('account'): f = open('account', 'r') account = f.readline() wipeScreens() if not os.path.exists(resultsPath): os.makedirs(resultsPath) d.setScreenshotDir(resultsPath) d.enableVisualLog(resultsPath + "/testlog.html") homePage()
def init(): TypeHelper.initWords() global account if os.path.isfile('account'): f = open('account','r') account = f.readline() wipeScreens() if not os.path.exists(resultsPath): os.makedirs(resultsPath) d.setScreenshotDir(resultsPath) d.enableVisualLog(resultsPath + "/testlog.html") homePage()
def typeTicketContent(): rs() d.tapBitmap("assets/textinput_content.png", tapPos=(0.2, 4.5)) count = random.randint(2, 5) i = 0 while i < count: i += 1 typeDelay(TypeHelper.getTicketContent())
def typeTicketContent(): rs() d.tapBitmap("assets/textinput_content.png", tapPos=(0.2,4.5)) count = random.randint(2,5) i = 0 while i < count: i += 1 typeDelay(TypeHelper.getTicketContent())
def typeRegisterInfo(): global account if account: return account = TypeHelper.getUsername() f = open('account','w') f.write(account) f.close() rs() b.find_element_by_css_selector("input[name='email']").send_keys(account) b.find_element_by_css_selector("input[name='password']").send_keys(account)
def typeRegisterInfo(): global account if account: return account = TypeHelper.getUsername() f = open('account', 'w') f.write(account) f.close() rs() b.find_element_by_css_selector("input[name='email']").send_keys(account) b.find_element_by_css_selector("input[name='password']").send_keys(account)
def typeRegisterInfo(): global account if account: return account = TypeHelper.getUsername() f = open('account','w') f.write(account) f.close() rs() d.tapBitmap("assets/email.png") clearText() typeDelay(account) d.tapBitmap("assets/pass.png") clearText() typeDelay(account)
def typeRegisterInfo(): global account if account: return account = TypeHelper.getUsername() f = open('account', 'w') f.write(account) f.close() rs() d.tapBitmap("assets/email.png") clearText() typeDelay(account) d.tapBitmap("assets/pass.png") clearText() typeDelay(account)
def typeTicketContent(): rs() b.find_element_by_css_selector("div#contentInput div.form-control").click() b.find_element_by_css_selector("div#contentInput div[contenteditable]"). send_keys(TypeHelper.getTicketContent())
def __init__(self, **kwargs): polygon = kwargs.get('polygon', '') types = kwargs.get('types', '') ph = PolygonHelper(polygon) th = TypeHelper(types) self.rid = ph.get_hash() + th.get_hash()
def typeBoardName(): rs() d.tapBitmap("assets/textinput_heading.png", tapPos=(0.1, 2.5)) clearText() typeDelay(TypeHelper.getBoardName())
def typeBoardName(): rs() b.find_element_by_css_selector("input#headingInput").send_keys( TypeHelper.getBoardName())
def typeTicketName(): rs() d.tapBitmap("assets/textinput_heading.png", tapPos=(0.2, 2.5)) wait(0.5) clearText() typeDelay(TypeHelper.getTicketName())
def get_kvtypes(self): icr = IceRecord() tids = icr.get_tids_by_rid(self.rid).split(',') th = TypeHelper() return th.get_kvtypes(tids)
def typeTicketName(): rs() d.tapBitmap("assets/textinput_heading.png", tapPos=(0.2,2.5)) wait(0.5) clearText() typeDelay(TypeHelper.getTicketName())
def typeBoardName(): rs() d.tapBitmap("assets/textinput_heading.png", tapPos=(0.1,2.5)) clearText() typeDelay(TypeHelper.getBoardName())
def typeBoardName(): rs() b.find_element_by_css_selector("input#headingInput").send_keys(TypeHelper.getBoardName())