Ejemplo n.º 1
0
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
Ejemplo n.º 2
0
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    
Ejemplo n.º 3
0
    def __init__(self):
        config.set_image_dirs()
        self.os_name = config.get_os_name()
        PREF_HEADING = Pattern("pref_heading.png")
        
        def preference_panel_regions():
            if not exists(PREF_HEADING):
                self.open_prefs()
            exists(PREF_HEADING, 10)
            heading = Region(getLastMatch())
            gtw = heading.getW()/10
            heading.setX(heading.getX() - gtw)
            heading.setW(heading.getW() + gtw*2)
            heading.setH(heading.getH() + 30)
            heading.setAutoWaitTimeout(10)
            settings = Region(heading.below())
            settings.setAutoWaitTimeout(10)
            return (heading, settings)
        

        def screen_region():
            myscreen = Screen()
            screen = Region(myscreen.getBounds())
            return screen
        
        self.hr, self.sr = preference_panel_regions()
        self.screen = screen_region()        
Ejemplo n.º 4
0
 def __init__(self):
     '''
     Constructor
     '''
     config.set_image_dirs()
     self.os_name = config.get_os_name()
     #        CMD or CTRL Key
     if self.os_name == 'osx':
         self.CMDCTRL = Key.CMD
     else:
         self.CMDCTRL = Key.CTRL
Ejemplo n.º 5
0
    def __init__(self):
        '''
        Constructor
        '''
        config.set_image_dirs()
        self.os_name = config.get_os_name()
#        CMD or CTRL Key
        if self.os_name == 'osx':
            self.CMDCTRL = Key.CMD
        else:
            self.CMDCTRL = Key.CTRL
Ejemplo n.º 6
0
    def __init__(self):
        '''
        Constructor
        '''
        import testsetup
        setAutoWaitTimeout(testvars.timeout)
        testsetup.launch_miro()
        reg = testsetup.get_regions()
        config.set_image_dirs()
        self.s = reg["SidebarRegion"]
        self.m = reg["MainViewRegion"]
        self.t = reg["TopHalfRegion"]
        self.tl = reg["TopLeftRegion"]
        self.mtb = reg["MainTitleBarRegion"]
        self.mr = reg["MainAndHeaderRegion"]
        

        myscreen = Screen()
        sr = Region(myscreen.getBounds())
        self.screen_height = sr.getH()
        self.screen_width = sr.getW()
Ejemplo n.º 7
0
    def __init__(self):
        '''
        Constructor
        '''
        import testsetup
        setAutoWaitTimeout(testvars.timeout)
        testsetup.launch_miro()
        reg = testsetup.get_regions()
        config.set_image_dirs()
        self.s = reg["SidebarRegion"]
        self.m = reg["MainViewRegion"]
        self.t = reg["TopHalfRegion"]
        self.tl = reg["TopLeftRegion"]
        self.mtb = reg["MainTitleBarRegion"]
        self.mr = reg["MainAndHeaderRegion"]

        myscreen = Screen()
        sr = Region(myscreen.getBounds())
        self.screen_height = sr.getH()
        self.screen_width = sr.getW()
        #        Settings.ActionLogs = False
        Settings.InfoLogs = False
        Settings.DebugLogs = False
Ejemplo n.º 8
0
def set_regions():
    config.set_image_dirs()
    wait(Pattern("top_app.png"), 20)
    mvc = Region(getLastMatch())
    mvc.setH(mvc.getH()+650)
    return mvc