boa-constructor /

# Name:
# Purpose:
# Author:      Riaan Booysen
# Created:     2000/09/24
# RCS-ID:      $Id$
# Copyright:   (c) 2000 Riaan Booysen
# Licence:     GPL

class BrowsePage:
    def __init__(self, modulepage, view, marker):
        self.modulePage = modulepage
        self.view = view
        self.marker = marker

    def goto(self):
        # XXX What if page has been closed, notification

    def __repr__(self):
        return 'BrowsePage(%s, %s, %s)' % (`self.modulePage`, `self.view`,

class Browser:
    def __init__(self):
        self.pages = []
        self.idx = -1

    def add(self, page):
        if self.idx == len(self.pages)-1:
            self.pages[self.idx:] = [page]
        self.idx = len(self.pages)-1
#        print 'add idx', self.idx, self.pages

    def checkRemoval(self, modPage):
        for page in self.pages[:]:
            if page.modulePage == modPage:
                idx = self.pages.index(page)
                if idx < self.idx:
                    self.idx = self.idx - 1
                del self.pages[idx]

    def step(self, dir):
        self.idx = self.idx + dir

    def canForward(self):
        return self.idx < len(self.pages)-1

    def forward(self):
#        print 'forward', self.idx, self.canForward()
        if self.canForward():

    def canBack(self):
        return self.idx >= 0

    def back(self):
#        print 'back', self.idx, self.canBack()
        if self.canBack():
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.