def get_regions(): config.set_image_dirs() click(Pattern("sidebar_top.png").similar(0.6)) topx = int(getLastMatch().getX())-15 topy = int(getLastMatch().getY())-40 try: sidebar_width = int(config.get_val_from_mirodb("global_state","tabs_width")) except: sidebar_width = 250 sidex = sidebar_width+topx find("BottomCorner.png") vbarx = int(getLastMatch().getX())+30 vbary = int(getLastMatch().getY())+10 vbarw = getLastMatch().getW() app_height = int(vbary-topy) mainwidth = int((vbarx-sidex)+vbarw) AppRegions = {"SidebarRegion": Region(topx,topy, sidebar_width, app_height), "MainViewRegion": Region(sidex, topy+70, mainwidth, app_height), "TopHalfRegion": Region(0,0,mainwidth+sidebar_width,app_height/2), "TopLeftRegion": Region(0,0,mainwidth/2,app_height/2), "MainTitleBarRegion": Region(sidex, topy, mainwidth, 120), "MainAndHeaderRegion": Region(sidex, topy, mainwidth, app_height+50), "PodcastLowerRegion": Region(sidex, vbary - 80, mainwidth, 70) } for regs in AppRegions.itervalues(): regs.setAutoWaitTimeout(30) return AppRegions
def get_regions(): config.set_image_dirs() click(Pattern("sidebar_top.png").similar(0.6)) topx = int(getLastMatch().getX()) - 15 topy = int(getLastMatch().getY()) - 40 try: sidebar_width = int( config.get_val_from_mirodb("global_state", "tabs_width")) except: sidebar_width = 250 sidex = sidebar_width + topx find("BottomCorner.png") vbarx = int(getLastMatch().getX()) + 30 vbary = int(getLastMatch().getY()) + 10 vbarw = getLastMatch().getW() app_height = int(vbary - topy) mainwidth = int((vbarx - sidex) + vbarw) AppRegions = { "SidebarRegion": Region(topx, topy, sidebar_width, app_height), "MainViewRegion": Region(sidex, topy + 70, mainwidth, app_height), "TopHalfRegion": Region(0, 0, mainwidth + sidebar_width, app_height / 2), "TopLeftRegion": Region(0, 0, mainwidth / 2, app_height / 2), "MainTitleBarRegion": Region(sidex, topy, mainwidth, 120), "MainAndHeaderRegion": Region(sidex, topy, mainwidth, app_height + 50), "PodcastLowerRegion": Region(sidex, vbary - 80, mainwidth, 70) } for regs in AppRegions.itervalues(): regs.setAutoWaitTimeout(30) return AppRegions
def get_regions(): regions = [] myscreen = Screen() pr = Region(myscreen.getBounds()) ## hw = pr.getW()/2 ## hh = pr.getH()/2 ## pr.setW(hw) ## pr.setH(hh) pr.setY(10) sidebar_width = int(config.get_val_from_mirodb("global_state","tabs_width")) topx = 50 topy = 30 if pr.exists("Music",5): click(pr.getLastMatch()) topx = int(pr.getLastMatch().getX())-55 topy = int(pr.getLastMatch().getY())-80 sidex = sidebar_width+topx find("BottomCorner.png") vbarx = int(getLastMatch().getX())+30 vbary = int(getLastMatch().getY())+10 vbarw = getLastMatch().getW() app_height = int(vbary-topy) #Sidebar Region SidebarRegion = Region(topx,topy,sidebar_width,app_height) SidebarRegion.setAutoWaitTimeout(30) regions.append(SidebarRegion) #Mainview Region mainwidth = int((vbarx-sidex)+vbarw) #MainViewRegion = Region(sidex,topy+tbar_height,mainwidth,app_height-155) - old m MainViewRegion = Region(sidex,topy+70,mainwidth,app_height) MainViewRegion.setAutoWaitTimeout(30) regions.append(MainViewRegion) #Top Half of screen, width of Miro app Region TopHalfRegion = Region(0,0,mainwidth+sidebar_width,app_height/2) TopHalfRegion.setAutoWaitTimeout(30) regions.append(TopHalfRegion) #Top Left Half of screen, 1/2 width of Miro app from left side TopLeftRegion = Region(0,0,mainwidth/2,app_height/2) TopLeftRegion.setAutoWaitTimeout(30) regions.append(TopLeftRegion) #Main Title bar section of the main view MainTitleBarRegion = Region(sidex,topy,mainwidth,120) MainTitleBarRegion.setAutoWaitTimeout(30) regions.append(MainTitleBarRegion) return regions