예제 #1
0
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())
예제 #3
0
 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)
예제 #5
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)
예제 #6
0
파일: icemap.py 프로젝트: zzJenKins/polygon
 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()
예제 #7
0
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()
예제 #8
0
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()
예제 #9
0
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())
예제 #10
0
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())
예제 #11
0
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)
예제 #13
0
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)
예제 #14
0
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)
예제 #15
0
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())
예제 #16
0
 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()
예제 #17
0
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())
예제 #19
0
def typeTicketName():
    rs()
    d.tapBitmap("assets/textinput_heading.png", tapPos=(0.2, 2.5))
    wait(0.5)
    clearText()
    typeDelay(TypeHelper.getTicketName())
예제 #20
0
 def get_kvtypes(self):
     icr = IceRecord()
     tids = icr.get_tids_by_rid(self.rid).split(',')
     th = TypeHelper()
     return th.get_kvtypes(tids)
예제 #21
0
def typeTicketName():
    rs()
    d.tapBitmap("assets/textinput_heading.png", tapPos=(0.2,2.5))
    wait(0.5)
    clearText()
    typeDelay(TypeHelper.getTicketName())
예제 #22
0
def typeBoardName():
    rs()
    d.tapBitmap("assets/textinput_heading.png", tapPos=(0.1,2.5))
    clearText()
    typeDelay(TypeHelper.getBoardName())
예제 #23
0
def typeBoardName():
    rs()
    b.find_element_by_css_selector("input#headingInput").send_keys(TypeHelper.getBoardName())