libqtile/widget/maildir.py
def poll(self):
        """Scans the mailbox for new messages

        Returns
        =======
        A string representing the current mailbox state
        """
        state = {}

        def to_maildir_fmt(paths):
            for path in iter(paths):
                yield path.rsplit(":")[0]

        for subFolder in self.subFolders:
            path = os.path.join(os.path.expanduser(self.maildirPath),
                                subFolder["path"])
            maildir = mailbox.Maildir(path)
            state[subFolder["label"]] = 0

            for file in to_maildir_fmt(os.listdir(os.path.join(path, "new"))):
                if file in maildir:
                    state[subFolder["label"]] += 1

        return self.format_text(state)
Scans the mailbox for new messages

        Returns
        =======
        A string representing the current mailbox state
        
Scans the mailbox for new messages
Returns

A string representing the current mailbox state
Scans the mailbox for new messages Returns A string representing the current mailbox state
def poll(self):
        state = {}
        def to_maildir_fmt(paths):
            for path in iter(paths):
                yield path.rsplit(":")[0]
        for subFolder in self.subFolders:
            path = os.path.join(os.path.expanduser(self.maildirPath),
                                subFolder["path"])
            maildir = mailbox.Maildir(path)
            state[subFolder["label"]] = 0
            for file in to_maildir_fmt(os.listdir(os.path.join(path, "new"))):
                if file in maildir:
                    state[subFolder["label"]] += 1
        return self.format_text(state)
def poll ( self ) : state = { } def to_maildir_fmt ( paths ) : for path in iter ( paths ) : yield path . rsplit ( ":" ) [ 0 ] for subFolder in self . subFolders : path = os . path . join ( os . path . expanduser ( self . maildirPath ) , subFolder [ "path" ] ) maildir = mailbox . Maildir ( path ) state [ subFolder [ "label" ] ] = 0 for file in to_maildir_fmt ( os . listdir ( os . path . join ( path , "new" ) ) ) : if file in maildir : state [ subFolder [ "label" ] ] += 1 return self . format_text ( state )
Scans the mailbox for new messages
Returns
Scans the mailbox for new messages Returns
"""Scans the mailbox for new messages

        Returns
        =======
        A string representing the current mailbox state
        """
self