Пример #1
0
    def _setup_root_model(self):
        pixbuf = icon.guess_from_path(self.dir, 24)

        iter = self.model.append(None, (pixbuf, os.path.basename(self.dir),
                                 self.dir, False))

        return iter
Пример #2
0
    def _setup_root_model(self):
        pixbuf = icon.guess_from_path(self.dir, 24)

        iter = self.model.append(None, (pixbuf, os.path.basename(self.dir),
                                 self.dir, False))

        return iter
Пример #3
0
    def __setup_root_model(self):
        iter = self.model.append(None)
        pixbuf = icon.guess_from_path(self.dir, 24)

        self.model.set(iter, DIR_ICON, pixbuf, DIR_TITLE,
                       os.path.basename(self.dir), DIR_PATH, self.dir,
                       DIR_EDITABLE, False)

        return iter
Пример #4
0
    def do_update_model(self, dir, iter):
        for item in os.listdir(dir):
            fullname = os.path.join(dir, item)
            pixbuf = icon.guess_from_path(fullname, 24)

            child_iter = self.model.append(iter,
                                           (pixbuf, os.path.basename(fullname),
                                            fullname, False))

            if os.path.isdir(fullname):
                self.do_update_model(fullname, child_iter)
Пример #5
0
    def __setup_root_model(self):
        iter = self.model.append(None)
        pixbuf = icon.guess_from_path(self.dir, 24)

        self.model.set(iter,
                DIR_ICON, pixbuf,
                DIR_TITLE, os.path.basename(self.dir),
                DIR_PATH, self.dir,
                DIR_EDITABLE, False)

        return iter
Пример #6
0
    def do_update_model(self, dir, iter):
        for item in os.listdir(dir):
            fullname = os.path.join(dir, item)
            pixbuf = icon.guess_from_path(fullname, 24)

            child_iter = self.model.append(iter,
                                           (pixbuf, os.path.basename(fullname),
                                            fullname, False))

            if os.path.isdir(fullname):
                self.do_update_model(fullname, child_iter)
Пример #7
0
    def do_update_model(self, dir, iter):
        for item in os.listdir(dir):
            fullname = os.path.join(dir, item)
            pixbuf = icon.guess_from_path(fullname, 24)

            child_iter = self.model.append(iter)
            self.model.set(child_iter, DIR_ICON, pixbuf, DIR_TITLE,
                           os.path.basename(fullname), DIR_PATH, fullname,
                           DIR_EDITABLE, False)

            if os.path.isdir(fullname):
                self.do_update_model(fullname, child_iter)
Пример #8
0
    def do_update_model(self, dir, iter):
        for item in os.listdir(dir):
            fullname = os.path.join(dir, item)
            pixbuf = icon.guess_from_path(fullname, 24)

            child_iter = self.model.append(iter)
            self.model.set(child_iter,
                              DIR_ICON, pixbuf,
                              DIR_TITLE, os.path.basename(fullname),
                              DIR_PATH, fullname, 
                              DIR_EDITABLE, False)

            if os.path.isdir(fullname):
                self.do_update_model(fullname, child_iter)
Пример #9
0
    def do_update_model(self, dir, iter):
        for item in os.listdir(dir):
            fullname = os.path.join(dir, item)
            pixbuf = icon.guess_from_path(fullname)

            child_iter = self.model.append(
                iter, (pixbuf, os.path.basename(fullname), fullname, False))

            if os.path.isdir(fullname):
                self.do_update_model(fullname, child_iter)
            else:
                if not os.access(fullname, os.X_OK):
                    try:
                        os.chmod(fullname, stat.S_IRWXU)
                    except:
                        pass
Пример #10
0
    def do_update_model(self, dir, iter):
        for item in os.listdir(dir):
            fullname = os.path.join(dir, item)
            pixbuf = icon.guess_from_path(fullname)

            child_iter = self.model.append(iter,
                                           (pixbuf, os.path.basename(fullname),
                                            fullname, False))

            if os.path.isdir(fullname):
                self.do_update_model(fullname, child_iter)
            else:
                if not os.access(fullname, os.X_OK):
                    try:
                        os.chmod(fullname, stat.S_IRWXU)
                    except:
                        pass
Пример #11
0
    def update_model(self):
        self.model.clear()

        dir = self.dir
        self.exist_lsit = []
        if self.exclude_dir:
            for root, dirs, files in os.walk(self.exclude_dir):
                if files:
                    self.exist_lsit.extend(files)

        for item in os.listdir(dir):
            fullname = os.path.join(dir, item)
            title = os.path.basename(fullname)
            if title in self.exist_lsit:
                continue
            pixbuf = icon.guess_from_path(fullname, 24)

            self.model.append((pixbuf, title, fullname))
Пример #12
0
    def update_model(self):
        self.model.clear()

        dir = self.dir
        self.exist_lsit = []
        if self.exclude_dir:
            for root, dirs, files in os.walk(self.exclude_dir):
                if files:
                    self.exist_lsit.extend(files)

        for item in os.listdir(dir):
            fullname = os.path.join(dir, item)
            title = os.path.basename(fullname)
            if title in self.exist_lsit:
                continue
            pixbuf = icon.guess_from_path(fullname, 24)

            self.model.append((pixbuf, title, fullname))
Пример #13
0
 def get_icon(self):
     return icon.guess_from_path(self.get_path())
Пример #14
0
 def get_icon(self):
     return icon.guess_from_path(self.get_path())